-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCommandsHandler.cs
More file actions
1606 lines (1474 loc) · 105 KB
/
CommandsHandler.cs
File metadata and controls
1606 lines (1474 loc) · 105 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
using Discord;
using Discord.Commands;
using Discord.Net;
using Discord.WebSocket;
using Newtonsoft.Json;
using System.Diagnostics;
using System.Text.RegularExpressions;
namespace DonderHelper
{
public class CommandsHandler
{
private readonly string donShop_Spring_img = "https://taiko-ch.net/urgybrhm3ukw/blog/wp-content/uploads/2018/05/8251a977b1344fff217f31f37cd1e8fe.png";
private readonly string donShop_Summer_img = "https://taiko-ch.net/urgybrhm3ukw/blog/wp-content/uploads/2025/05/5dd72fe33b6af14311cb975f2a70a065.png";
private readonly string donShop_Autumn_img = "https://taiko-ch.net/urgybrhm3ukw/blog/wp-content/uploads/2025/08/4f6df8253e818bc82ad0df7c19e5467d.png";
private readonly string donShop_Winter_img = "https://taiko-ch.net/urgybrhm3ukw/blog/wp-content/uploads/2025/11/5b376df35c337270e961d9a61c2b9e67.png";
private readonly Color donShop_Spring_color = new(254, 137, 187);
private readonly Color donShop_Summer_color = new(117, 237, 254);
private readonly Color donShop_Autumn_color = new(248, 72, 40);
private readonly Color donShop_Winter_color = new(186, 202, 255);
#region Statistics
public static string last_Update => $"Last update: {Process.GetCurrentProcess().StartTime:yyyy/MM/dd}";
public static DateTimeOffset readyTime = new();
private struct RegionStats
{
public int Available;
public int Exclusive;
public int SouUchi;
public int Unavailable;
public RegionStats() { Available = 0; Exclusive = 0; SouUchi = 0; Unavailable = 0; }
public RegionStats(int available, int exclusive, int souuchi, int unavailable) { Available = available; Exclusive = exclusive; SouUchi = souuchi; Unavailable = unavailable; }
}
// Set these stats once on initialize, as the songlist does not update at any point during uptime, and can be a waste of resources to constantly recalculate.
private RegionStats statsJapan = new();
private RegionStats statsAsia = new();
private RegionStats statsOceania = new();
private RegionStats statsAmerica = new();
private RegionStats statsChina = new();
private int statsTitleJa = 0;
private int statsTitleEn_US = 0;
private int statsTitleKo = 0;
private int statsTitleZh_TW = 0;
private int statsTitleZh_CN = 0;
private int statsAvailable = 0;
private int statsUnavailable = 0;
private int statsUnknown = 0;
private int statsMissingNotes = 0;
#endregion
private readonly DiscordSocketClient _client;
private readonly CommandService _commands;
private readonly Discord.Interactions.InteractionService _interaction;
private IReadOnlyCollection<SocketApplicationCommand> command_list = [];
public CommandsHandler(DiscordSocketClient client, CommandService commands)
{
_commands = commands;
_client = client;
_interaction = new(_client);
_client.Ready += Client_Ready;
_client.SlashCommandExecuted += SlashCommandExecuted;
_client.AutocompleteExecuted += AutocompleteExecuted;
_client.ButtonExecuted += ButtonExecuted;
#region Statistics
// Set these stats once on initialize, as the songlist does not update at any point during uptime, and can be a waste of resources to constantly recalculate.
statsJapan = new();
statsAsia = new();
statsOceania = new();
statsAmerica = new();
statsChina = new();
var songs = SongDatabase.Songs.Values;
statsJapan = new(
songs.Where(song => song.Region.Japan.IsAvailable()).Count(),
songs.Where(song => song.Region.IsJapanOnly).Count(),
songs.Where(song => song.Region.Japan.IsAvailable()).Where(song => song.Title.Contains("【双打】")).Count(),
songs.Where(song => !song.Region.Japan.IsAvailable()).Count()
);
statsAsia = new(
songs.Where(song => song.Region.Asia.IsAvailable()).Count(),
songs.Where(song => song.Region.IsAsiaOnly).Count(),
songs.Where(song => song.Region.Asia.IsAvailable()).Where(song => song.Title.Contains("【双打】")).Count(),
songs.Where(song => !song.Region.Asia.IsAvailable()).Count()
);
statsOceania = new(
songs.Where(song => song.Region.Oceania.IsAvailable()).Count(),
songs.Where(song => song.Region.IsOceaniaOnly).Count(),
songs.Where(song => song.Region.Oceania.IsAvailable()).Where(song => song.Title.Contains("【双打】")).Count(),
songs.Where(song => !song.Region.Oceania.IsAvailable()).Count()
);
statsAmerica = new(
songs.Where(song => song.Region.UnitedStates.IsAvailable()).Count(),
songs.Where(song => song.Region.IsUnitedStatesOnly).Count(),
songs.Where(song => song.Region.UnitedStates.IsAvailable()).Where(song => song.Title.Contains("【双打】")).Count(),
songs.Where(song => !song.Region.UnitedStates.IsAvailable()).Count()
);
statsChina = new(
songs.Where(song => song.Region.China.IsAvailable()).Count(),
songs.Where(song => song.Region.IsChinaOnly).Count(),
songs.Where(song => song.Region.China.IsAvailable()).Where(song => song.Title.Contains("【双打】")).Count(),
songs.Where(song => !song.Region.China.IsAvailable()).Count()
);
statsTitleJa = songs.Where(song => song.TryGetTitle("ja", out string? title)).Count();
statsTitleEn_US = songs.Where(song => song.TryGetTitle("en-US", out string? title)).Count();
statsTitleKo = songs.Where(song => song.TryGetTitle("ko", out string? title)).Count();
statsTitleZh_TW = songs.Where(song => song.TryGetTitle("zh-TW", out string? title)).Count();
statsTitleZh_CN = songs.Where(song => song.TryGetTitle("zh-CN", out string? title)).Count();
statsAvailable = songs.Where(song => song.Region.IsAvailableEverywhere).Count();
statsUnavailable = songs.Where(song => song.Region.IsUnavailableEverywhere).Count();
statsUnknown = songs.Where(song => song.Region.ContainsUnknown).Count();
statsMissingNotes = songs.Where(song => !song.Difficulties.ContainsNotes()).Count();
#endregion
}
private async Task ButtonExecuted(SocketMessageComponent component)
{
Console.WriteLine($"Executing button with CustomId '{component.Data.CustomId}' requested by user {component.User.Id}.");
try
{
string id = component.Data.CustomId;
if (id.StartsWith("diff"))
{
string[] values = id.Split(',', 3);
if (SongDatabase.Songs.TryGetValue(values[2], out Song? song)) {
await PostDiff(component, song, Song.GetDifficultyFromString(values[1]));
return;
}
else
{
Console.WriteLine($"Button interaction failed for 'diff' with title '{values[2]}' and diff '{values[1]}'.");
await component.RespondAsync("This button interaction failed, as the song title was not recognized.", null, false, true);
return;
}
}
else if (id.StartsWith("song"))
{
string[] values = id.Split(',', 2);
if (SongDatabase.Songs.TryGetValue(values[1], out Song? song))
{
await PostSong(component, song);
return;
}
else
{
Console.WriteLine($"Button interaction failed for 'song' with title '{values[1]}'.");
await component.RespondAsync("This button interaction failed, as the song title was not recognized.", null, false, true);
return;
}
}
Console.WriteLine($"Button execution with CustomId '{component.Data.CustomId}' failed, or is not yet implemented.");
await component.RespondAsync("This button interaction failed, or is not implemented.", null, false, true);
return;
}
catch (Exception ex)
{
Console.WriteLine($"[General/Error] Something went wrong while interacting with a button. Id: {component.Data.CustomId} / User: {component.User.Id} / Guild: {component.GuildId?.ToString() ?? "(null)"} / Channel: {component.ChannelId?.ToString() ?? "(none)"} / Details:\n{ex}");
await component.RespondAsync(LocaleData.GetString("DISCLAIMER_ERROR", GetLocale(component)), null, false, true);
return;
}
}
private async Task AutocompleteExecuted(SocketAutocompleteInteraction interaction)
{
DateTimeOffset offset = DateTimeOffset.UtcNow;
string locale = GetLocale(interaction);
string name = (string)interaction.Data.Current.Value;
int Priority(string str1, string str2)
{
if (str1.Equals(str2, StringComparison.InvariantCultureIgnoreCase)) return -999;
if (str1.StartsWith(str2, StringComparison.InvariantCultureIgnoreCase)) return -998;
return string.Compare(str1, str2, true);
}
List<AutocompleteResult> result = [];
#region Song Title
if (interaction.Data.CommandName == "song" && interaction.Data.Current.Name == "title")
{
if (string.IsNullOrEmpty((string)interaction.Data.Current.Value))
{
Random rand = new();
List<Song> songlist = [];
for (int i = 0; i < 10; i++)
songlist.Add(SongDatabase.Songs.ElementAt(rand.Next(SongDatabase.Songs.Count)).Value);
var autocomp = songlist.Select(song => new AutocompleteResult(song.GetTitle(locale), song.Title));
await interaction.RespondAsync(autocomp, null);
goto end;
}
result = SongDatabase.SongNames.
Where(song => song.Key.Contains(name, StringComparison.OrdinalIgnoreCase)).
OrderBy(song => Priority(song.Key, name)).Take(25).
Select(song => new AutocompleteResult(song.Key, song.Value)).ToList();
await interaction.RespondAsync(result, null);
}
#endregion
#region Gaiden Title
else if (interaction.Data.CommandName == "gaiden" && interaction.Data.Current.Name == "title")
{
if (string.IsNullOrEmpty((string)interaction.Data.Current.Value))
{
Random rand = new();
var autocomp = GaidenSonglist.Gaidens.Values.Take(20).
Select(gaiden => new AutocompleteResult(gaiden.GetSubtitle(locale), gaiden.Subtitle));
await interaction.RespondAsync(autocomp, null);
goto end;
}
result = GaidenSonglist.GaidenNames.
Where(song => song.Key.Contains(name, StringComparison.OrdinalIgnoreCase)).
OrderBy(song => Priority(song.Key, name)).Take(25).
Select(song => new AutocompleteResult(song.Key, song.Value)).ToList();
await interaction.RespondAsync(result, null);
}
#endregion
end:
Console.WriteLine($"AutocompleteExecuted (Finished in {(DateTimeOffset.UtcNow - offset).TotalSeconds}s)");
Console.WriteLine($"Data: {Regex.Replace(name, @"[^\w\.@-]", "")}");
}
private async Task Client_Ready()
{
readyTime = DateTime.UtcNow;
try
{
InteractionContextType[] context_types = [InteractionContextType.Guild, InteractionContextType.BotDm, InteractionContextType.PrivateChannel];
ApplicationIntegrationType[] integration_types = [ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall];
Dictionary<string, string> test = new Dictionary<string, string>();
var command_help = new SlashCommandBuilder();
command_help.WithName("help");
command_help.WithDescription("Lists all available commands and their uses.");
command_help.WithNameLocalizations(LocaleData.GetStrings("COMMAND_HELP_NAME"));
command_help.WithDescriptionLocalizations(LocaleData.GetStrings("COMMAND_HELP_DESC"));
command_help.WithContextTypes(context_types);
command_help.WithIntegrationTypes(integration_types);
var command_random = new SlashCommandBuilder();
command_random.WithName("random");
command_random.WithDescription("Select a random song.");
command_random.WithNameLocalizations(LocaleData.GetStrings("COMMAND_RANDOM_NAME"));
command_random.WithDescriptionLocalizations(LocaleData.GetStrings("COMMAND_RANDOM_DESC"));
command_random.AddOption("difficulty", ApplicationCommandOptionType.String, "The specific difficulty of a song.", false, null, false, null, null, null, null, LocaleData.GetStrings("OPTION_DIFFICULTY_NAME"), LocaleData.GetStrings("OPTION_DIFFICULTY_DESC"), null, null,
new ApplicationCommandOptionChoiceProperties()
{
Name = "Easy",
NameLocalizations = LocaleData.GetStrings("DIFFICULTY_EASY"),
Value = "easy"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Normal",
NameLocalizations = LocaleData.GetStrings("DIFFICULTY_NORMAL"),
Value = "normal"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Hard",
NameLocalizations = LocaleData.GetStrings("DIFFICULTY_HARD"),
Value = "hard"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Extreme",
NameLocalizations = LocaleData.GetStrings("DIFFICULTY_EX"),
Value = "ex"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Hidden",
NameLocalizations = LocaleData.GetStrings("DIFFICULTY_HIDDEN"),
Value = "hidden"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Extreme/Hidden",
NameLocalizations = LocaleData.GetStrings("DIFFICULTY_BOTH"),
Value = "both"
});
command_random.AddOption("level", ApplicationCommandOptionType.Integer, "The difficulty level.", false, null, false, 1, 10, null, null, LocaleData.GetStrings("OPTION_LEVEL_NAME"), LocaleData.GetStrings("OPTION_LEVEL_DESC"), null, null,
new ApplicationCommandOptionChoiceProperties() { Name = "1★", Value = 1 },
new ApplicationCommandOptionChoiceProperties() { Name = "2★", Value = 2 },
new ApplicationCommandOptionChoiceProperties() { Name = "3★", Value = 3 },
new ApplicationCommandOptionChoiceProperties() { Name = "4★", Value = 4 },
new ApplicationCommandOptionChoiceProperties() { Name = "5★", Value = 5 },
new ApplicationCommandOptionChoiceProperties() { Name = "6★", Value = 6 },
new ApplicationCommandOptionChoiceProperties() { Name = "7★", Value = 7 },
new ApplicationCommandOptionChoiceProperties() { Name = "8★", Value = 8 },
new ApplicationCommandOptionChoiceProperties() { Name = "9★", Value = 9 },
new ApplicationCommandOptionChoiceProperties() { Name = "10★", Value = 10 }
);
command_random.AddOption("genre", ApplicationCommandOptionType.String, "The specific genre that a song belongs in.", false, null, false, null, null, null, null, LocaleData.GetStrings("OPTION_GENRE_NAME"), LocaleData.GetStrings("OPTION_GENRE_DESC"), null, null,
new ApplicationCommandOptionChoiceProperties()
{
Name = "Pop",
NameLocalizations = LocaleData.GetGenreAsStrings(Song.SongGenre.Pop),
Value = "pop"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Kids",
NameLocalizations = LocaleData.GetGenreAsStrings(Song.SongGenre.Kids),
Value = "kids"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Anime",
NameLocalizations = LocaleData.GetGenreAsStrings(Song.SongGenre.Anime),
Value = "anime"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Vocaloid",
NameLocalizations = LocaleData.GetGenreAsStrings(Song.SongGenre.Vocaloid),
Value = "vocaloid"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Game Music",
NameLocalizations = LocaleData.GetGenreAsStrings(Song.SongGenre.Game),
Value = "game"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Variety",
NameLocalizations = LocaleData.GetGenreAsStrings(Song.SongGenre.Variety),
Value = "variety"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Classical",
NameLocalizations = LocaleData.GetGenreAsStrings(Song.SongGenre.Classical),
Value = "classical"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Namco Original",
NameLocalizations = LocaleData.GetGenreAsStrings(Song.SongGenre.Namco),
Value = "namco"
}
);
command_random.WithContextTypes(context_types);
command_random.WithIntegrationTypes(integration_types);
var command_song = new SlashCommandBuilder();
command_song.WithName("song");
command_song.WithDescription("Get info about a song.");
command_song.WithNameLocalizations(LocaleData.GetStrings("COMMAND_SONG_NAME"));
command_song.WithDescriptionLocalizations(LocaleData.GetStrings("COMMAND_SONG_DESC"));
command_song.AddOption("title", ApplicationCommandOptionType.String, "The title of the song.", true, null, true, null, null, null, null, LocaleData.GetStrings("OPTION_TITLE_NAME"), LocaleData.GetStrings("OPTION_TITLE_DESC"));
command_song.AddOption("difficulty", ApplicationCommandOptionType.String, "The specific difficulty of a song.", false, null, false, null, null, null, null, LocaleData.GetStrings("OPTION_DIFFICULTY_NAME"), LocaleData.GetStrings("OPTION_DIFFICULTY_DESC"), null, null,
new ApplicationCommandOptionChoiceProperties()
{
Name = "Easy",
NameLocalizations = LocaleData.GetStrings("DIFFICULTY_EASY"),
Value = "easy"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Normal",
NameLocalizations = LocaleData.GetStrings("DIFFICULTY_NORMAL"),
Value = "normal"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Hard",
NameLocalizations = LocaleData.GetStrings("DIFFICULTY_HARD"),
Value = "hard"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Extreme",
NameLocalizations = LocaleData.GetStrings("DIFFICULTY_EX"),
Value = "ex"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Hidden",
NameLocalizations = LocaleData.GetStrings("DIFFICULTY_HIDDEN"),
Value = "hidden"
});
command_song.WithContextTypes(context_types);
command_song.WithIntegrationTypes(integration_types);
var command_region = new SlashCommandBuilder();
command_region.WithName("region");
command_region.WithDescription("Get the URL for all region locked songs.");
command_region.WithNameLocalizations(LocaleData.GetStrings("COMMAND_REGION_NAME"));
command_region.WithDescriptionLocalizations(LocaleData.GetStrings("COMMAND_REGION_DESC"));
command_region.WithContextTypes(context_types);
command_region.WithIntegrationTypes(integration_types);
var command_campaign = new SlashCommandBuilder();
command_campaign.WithName("campaign");
command_campaign.WithDescription("Get the current list of active campaigns.");
command_campaign.WithNameLocalizations(LocaleData.GetStrings("COMMAND_CAMPAIGN_NAME"));
command_campaign.WithDescriptionLocalizations(LocaleData.GetStrings("COMMAND_CAMPAIGN_DESC"));
command_campaign.AddOption("name", ApplicationCommandOptionType.String, "The name of a currently active campaign.", true, null, false, null, null, null, null, LocaleData.GetStrings("OPTION_CAMPAIGNNAME_NAME"), LocaleData.GetStrings("OPTION_CAMPAIGNNAME_DESC"), null, null,
new ApplicationCommandOptionChoiceProperties()
{
Name = "HATSUNE MIKU: COLORFUL STAGE! x Taiko no Tatsujin Collaboration Campaign",
Value = "project_sekai",
NameLocalizations = new Dictionary<string, string>()
{
{ "ja", "プロジェクトセカイ カラフルステージ! feat. 初音ミク × 太鼓の達人 コラボキャンペーン" },
{ "zh-TW", "世界計畫 繽紛舞台! feat. 初音未來 × 太鼓之達人 合作活動" },
{ "ko", "프로젝트 세카이 컬러풀 스테이지! feat. 하츠네 미쿠 × 태고의 달인 콜라보레이션 캠페인" }
}
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "ARKNIGHTS × Taiko no Tatsujin Collaboration Campaign",
Value = "arknights",
NameLocalizations = new Dictionary<string, string>()
{
{ "ja", "アークナイツ×太鼓の達人 コラボキャンペーン" },
{ "zh-TW", "明日方舟×太鼓之達人 合作活動" },
{ "ko", "명일방주×태고의 달인 콜라보레이션 캠페인" }
}
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Oodles of Outfits Campaign Winter 2025",
Value = "winter2025",
NameLocalizations = new Dictionary<string, string>()
{
{ "ja", "きせかえザクザクキャンペーン2025冬" },
{ "zh-TW", "換裝道具滿滿活動2025冬" },
{ "ko", "갈아입히기 아이템 듬뿍 캠페인 2025 겨울" }
}
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "『Got Boost?』Campaign",
Value = "kamen2025",
NameLocalizations = new Dictionary<string, string>()
{
{ "ja", "『Got Boost?』キャンペーン" }
}
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "彁",
Value = "ka"
}
);
command_campaign.WithContextTypes(context_types);
command_campaign.WithIntegrationTypes(integration_types);
var command_shop = new SlashCommandBuilder();
command_shop.WithName("shop");
command_shop.WithDescription("Get the current active Don Medal shop.");
command_shop.WithNameLocalizations(LocaleData.GetStrings("COMMAND_SHOP_NAME"));
command_shop.WithDescriptionLocalizations(LocaleData.GetStrings("COMMAND_SHOP_DESC"));
command_shop.WithContextTypes(context_types);
command_shop.WithIntegrationTypes(integration_types);
var command_about = new SlashCommandBuilder();
command_about.WithName("about");
command_about.WithDescription("Information about the bot and its resources.");
command_about.WithNameLocalizations(LocaleData.GetStrings("COMMAND_ABOUT_NAME"));
command_about.WithDescriptionLocalizations(LocaleData.GetStrings("COMMAND_ABOUT_DESC"));
command_about.WithContextTypes(context_types);
command_about.WithIntegrationTypes(integration_types);
var command_stats = new SlashCommandBuilder();
command_stats.WithName("stats");
command_stats.WithDescription("Get statistic about the bot and its song database.");
command_stats.WithNameLocalizations(LocaleData.GetStrings("COMMAND_STATS_NAME"));
command_stats.WithDescriptionLocalizations(LocaleData.GetStrings("COMMAND_STATS_DESC"));
command_stats.WithContextTypes(context_types);
command_stats.WithIntegrationTypes(integration_types);
var command_dan = new SlashCommandBuilder();
command_dan.WithName("dan");
command_dan.WithDescription("Get the current Dan Dojo courses.");
command_dan.WithNameLocalizations(LocaleData.GetStrings("COMMAND_DAN_NAME"));
command_dan.WithDescriptionLocalizations(LocaleData.GetStrings("COMMAND_DAN_DESC"));
command_dan.AddOption("title", ApplicationCommandOptionType.String, "The title of the dan.", true, null, false, null, null, null, null, LocaleData.GetStrings("OPTION_DANTITLE_NAME"), LocaleData.GetStrings("OPTION_DANTITLE_DESC"), null, null,
DanSonglist.Dans.Values.Select(dan => dan.AsChoice()).ToArray()
);
command_dan.WithContextTypes(context_types);
command_dan.WithIntegrationTypes(integration_types);
var command_gaiden = new SlashCommandBuilder();
command_gaiden.WithName("gaiden");
command_gaiden.WithDescription("Search for Gaidens and their corresponding QR codes.");
command_gaiden.WithNameLocalizations(LocaleData.GetStrings("COMMAND_GAIDEN_NAME"));
command_gaiden.WithDescriptionLocalizations(LocaleData.GetStrings("COMMAND_GAIDEN_DESC"));
command_gaiden.AddOption("title", ApplicationCommandOptionType.String, "The title of the gaiden.", true, null, true, null, null, null, null, LocaleData.GetStrings("OPTION_GAIDENTITLE_NAME"), LocaleData.GetStrings("OPTION_GAIDENTITLE_DESC"), null, null);
command_gaiden.WithContextTypes(context_types);
command_gaiden.WithIntegrationTypes(integration_types);
var command_hiroba = new SlashCommandBuilder();
command_hiroba.WithName("hiroba");
command_hiroba.WithDescription("Get information about using Donder Hiroba.");
command_hiroba.WithNameLocalizations(LocaleData.GetStrings("COMMAND_HIROBA_NAME"));
command_hiroba.WithDescriptionLocalizations(LocaleData.GetStrings("COMMAND_HIROBA_DESC"));
command_hiroba.AddOption("guide", ApplicationCommandOptionType.String, "Select a specific area of Donder Hiroba to read about.", false, false, false, null, null, null, null, LocaleData.GetStrings("OPTION_GUIDE_NAME"), LocaleData.GetStrings("OPTION_GUIDE_DESC"), null, null,
new ApplicationCommandOptionChoiceProperties()
{
Name = "Change Your Name",
Value = "name"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Change Your Title",
Value = "title"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Change Your Costume/Mini Character",
Value = "costume"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Change Your My-DON's Colors",
Value = "color"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Add a Friend",
Value = "friend"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Challenge Other Players",
Value = "challenge"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Create a Tournament",
Value = "tournament_create"
},
new ApplicationCommandOptionChoiceProperties()
{
Name = "Join a Tournament",
Value = "tournament_join"
}
);
command_hiroba.WithContextTypes(context_types);
command_hiroba.WithIntegrationTypes(integration_types);
var command_missing = new SlashCommandBuilder();
command_missing.WithName("missing");
command_missing.WithDescription("Lists all songs with missing note counts and region status.");
command_missing.WithNameLocalizations(LocaleData.GetStrings("COMMAND_MISSING_NAME"));
command_missing.WithDescriptionLocalizations(LocaleData.GetStrings("COMMAND_MISSING_DESC"));
command_missing.WithContextTypes(context_types);
command_missing.WithIntegrationTypes(integration_types);
var command_invite = new SlashCommandBuilder();
command_invite.WithName("invite");
command_invite.WithDescription("Add me to your server, or add me as an app!");
command_invite.WithNameLocalizations(LocaleData.GetStrings("COMMAND_INVITE_NAME"));
command_invite.WithDescriptionLocalizations(LocaleData.GetStrings("COMMAND_INVITE_DESC"));
command_invite.WithContextTypes(context_types);
command_invite.WithIntegrationTypes(integration_types);
await _client.BulkOverwriteGlobalApplicationCommandsAsync([command_help.Build(), command_random.Build(), command_song.Build(), command_region.Build(), command_campaign.Build(), command_shop.Build(), command_about.Build(), command_stats.Build(), command_dan.Build(), command_gaiden.Build(), command_hiroba.Build(), command_missing.Build(), command_invite.Build()]);
command_list = await _client.GetGlobalApplicationCommandsAsync(true) ?? [];
Console.WriteLine(command_list.Count + " global commands found.");
if (command_list.Count == 0) Console.WriteLine("Bruh??? Why are there zero commands???");
foreach (SocketApplicationCommand command in command_list)
{
Console.WriteLine("Command name: " + (command.Name ?? "null") + "\n" +
"Integrations: " + (command.IntegrationTypes != null ? string.Join(", ", command.IntegrationTypes) : "null") + "\n" +
"Contexts: " + (command.ContextTypes != null ? string.Join(", ", command.ContextTypes) : "null") + "\n");
}
Console.WriteLine("Global commands built successfully!");
}
catch (HttpException exception)
{
var json = JsonConvert.SerializeObject(exception.Errors, Formatting.Indented);
Console.WriteLine("Global commands failed to build.\n" + json);
}
}
private async Task PostSong(SocketInteraction interaction, Song song)
{
Console.WriteLine("PostSong interaction created at " + interaction.CreatedAt);
Console.WriteLine("Current time is " + DateTimeOffset.UtcNow);
Console.WriteLine("InteractionType is " + interaction.Type);
try
{
string locale = GetLocale(interaction);
var builder = new EmbedBuilder()
{
Title = song.TitleList.Values.Distinct().Count() > 1 ? song.GetTitleList(true, locale) : song.GetTitle(locale),
Description = song.SubtitleList.Values.Distinct().Count() > 1 ? song.GetSubtitleList(true, locale) : song.GetSubtitle(locale),
Color = Song.GetGenreAsColor(song.Genre),
Fields = new() {
new()
{
Name = LocaleData.GetString("GENRE_TITLE", locale),
Value = song.GenreList.Count > 1
? string.Join("\n", song.GenreList.Select(genre => "- " + LocaleData.GetGenreAsString(genre, locale)))
: LocaleData.GetGenreAsString(song.Genre, locale),
IsInline = false
},
new() {
Name = LocaleData.GetString("DIFFICULTY_TITLE", locale),
Value =
$"{(song.Difficulties.Hidden.Level > -1 ? ($"{EmoteData.GetDifficulty(Song.SongDifficulty.Hidden)} " + song.Difficulties.Hidden.Level + "★ " + song.Difficulties.Hidden.NoteCount.ToString() + "\n") : "")}" +
$"{EmoteData.GetDifficulty(Song.SongDifficulty.Extreme)} {(song.Difficulties.Extreme.Level > -1 ? song.Difficulties.Extreme.Level + "★ " : "- ") + song.Difficulties.Extreme.NoteCount.ToString()}\n" +
$"{EmoteData.GetDifficulty(Song.SongDifficulty.Hard)} {(song.Difficulties.Hard.Level > -1 ? song.Difficulties.Hard.Level + "★ " : "- ") + song.Difficulties.Hard.NoteCount.ToString()}\n" +
$"{EmoteData.GetDifficulty(Song.SongDifficulty.Normal)} {(song.Difficulties.Normal.Level > -1 ? song.Difficulties.Normal.Level + "★ " : "- ") + song.Difficulties.Normal.NoteCount.ToString()}\n" +
$"{EmoteData.GetDifficulty(Song.SongDifficulty.Easy)} {(song.Difficulties.Easy.Level > -1 ? song.Difficulties.Easy.Level + "★ " : "- ") + song.Difficulties.Easy.NoteCount.ToString()}",
IsInline = true
},
new()
{
Name = LocaleData.GetString("AVAILABLE_TITLE", locale),
Value =
LocaleData.GetJapanRegionStatusAsString(song, locale) + "\n" +
LocaleData.GetAsiaRegionStatusAsString(song, locale) + "\n" +
LocaleData.GetOceaniaRegionStatusAsString(song, locale) + "\n" +
LocaleData.GetUSARegionStatusAsString(song, locale) + "\n" +
LocaleData.GetChinaRegionStatusAsString(song, locale),
IsInline = true
}
},
Timestamp = new(DateTime.UtcNow),
Footer = GetFooter(interaction)
};
var component_builder = new ComponentBuilder();
if (song.Difficulties.Easy.Level > 0 || song.Difficulties.Easy.NoteCount.ContainsNotes()) component_builder.WithButton(CreateSongButton(interaction, SongDatabase.SongNames[song.Title], Song.SongDifficulty.Easy));
if (song.Difficulties.Normal.Level > 0 || song.Difficulties.Normal.NoteCount.ContainsNotes()) component_builder.WithButton(CreateSongButton(interaction, SongDatabase.SongNames[song.Title], Song.SongDifficulty.Normal));
if (song.Difficulties.Hard.Level > 0 || song.Difficulties.Hard.NoteCount.ContainsNotes()) component_builder.WithButton(CreateSongButton(interaction, SongDatabase.SongNames[song.Title], Song.SongDifficulty.Hard));
if (song.Difficulties.Extreme.Level > 0 || song.Difficulties.Extreme.NoteCount.ContainsNotes()) component_builder.WithButton(CreateSongButton(interaction, SongDatabase.SongNames[song.Title], Song.SongDifficulty.Extreme));
if (song.Difficulties.Hidden.Level > 0 || song.Difficulties.Hidden.NoteCount.ContainsNotes()) component_builder.WithButton(CreateSongButton(interaction, SongDatabase.SongNames[song.Title], Song.SongDifficulty.Hidden));
await interaction.RespondAsync(null, [builder.Build()], false, !CanSendMessage(interaction), null, component_builder.Build());
}
catch
{
Console.WriteLine($"[General/Error] PostSong failed to respond with song titled \"{song.Title}\".");
throw;
}
}
private async Task PostDiff(SocketInteraction interaction, Song song, Song.SongDifficulty difficulty)
{
Console.WriteLine("PostDiff interaction created at " + interaction.CreatedAt);
Console.WriteLine("Current time is " + DateTimeOffset.UtcNow);
Console.WriteLine("InteractionType is " + interaction.Type);
try
{
Song.Chart chart = song.Difficulties[difficulty];
if (chart.Level < 1 && !chart.NoteCount.ContainsNotes())
{
await interaction.RespondAsync($"The difficulty selected does not exist for this song, or is missing data. {EmoteData.GetEmote("MISS")}", null, false, true);
return;
}
string locale = GetLocale(interaction);
var builder = new EmbedBuilder()
{
Title = song.GetTitle(locale) + $" {EmoteData.GetDifficulty(difficulty)} {(chart.Level > -1 ? chart.Level + "★" : "")}",
Description = song.GetSubtitle(locale) + $"{(chart.NoteCount.ContainsNotes() ? "\n" : "")}{chart.NoteCount}\n\n" +
$"**{LocaleData.GetString("AVAILABLE_TITLE", locale)}**\n" +
LocaleData.GetJapanRegionStatusAsString(song, locale) + "\n" +
LocaleData.GetAsiaRegionStatusAsString(song, locale) + "\n" +
LocaleData.GetOceaniaRegionStatusAsString(song, locale) + "\n" +
LocaleData.GetUSARegionStatusAsString(song, locale) + "\n" +
LocaleData.GetChinaRegionStatusAsString(song, locale),
Color = Song.GetGenreAsColor(song.Genre),
Timestamp = DateTimeOffset.UtcNow,
Fields = new()
{
new()
{
Name = "Details (Taiko Fumen Wiki)",
Value = !string.IsNullOrWhiteSpace(chart.Url) ? chart.Url : $"-# {LocaleData.GetString("URL_MISSING", locale, EmoteData.GetEmote("MISS"))}"
},
new()
{
Name = "Details (taiko.wiki)",
Value = !string.IsNullOrWhiteSpace(chart.UrlKo) ? chart.UrlKo : $"-# {LocaleData.GetString("URL_MISSING", locale, EmoteData.GetEmote("MISS"))}"
}
},
Url = chart.ImageUrl,
ImageUrl = chart.ImageUrl,
Footer = GetFooter(interaction)
};
var component_builder = new ComponentBuilder();
if (song.Difficulties.Easy.Level > -1 || song.Difficulties.Easy.NoteCount.ContainsNotes()) component_builder.WithButton(CreateSongButton(interaction, SongDatabase.SongNames[song.Title], Song.SongDifficulty.Easy));
if (song.Difficulties.Normal.Level > -1 || song.Difficulties.Normal.NoteCount.ContainsNotes()) component_builder.WithButton(CreateSongButton(interaction, SongDatabase.SongNames[song.Title], Song.SongDifficulty.Normal));
if (song.Difficulties.Hard.Level > -1 || song.Difficulties.Hard.NoteCount.ContainsNotes()) component_builder.WithButton(CreateSongButton(interaction, SongDatabase.SongNames[song.Title], Song.SongDifficulty.Hard));
if (song.Difficulties.Extreme.Level > -1 || song.Difficulties.Extreme.NoteCount.ContainsNotes()) component_builder.WithButton(CreateSongButton(interaction, SongDatabase.SongNames[song.Title], Song.SongDifficulty.Extreme));
if (song.Difficulties.Hidden.Level > -1 || song.Difficulties.Hidden.NoteCount.ContainsNotes()) component_builder.WithButton(CreateSongButton(interaction, SongDatabase.SongNames[song.Title], Song.SongDifficulty.Hidden));
await interaction.RespondAsync(null, [builder.Build()], false, !CanSendMessage(interaction), null, component_builder.Build());
}
catch
{
Console.WriteLine($"[General/Error] PostDiff failed to respond with song titled \"{song.Title}\".");
throw;
}
}
private async Task SlashCommandExecuted(SocketSlashCommand command)
{
try
{
Console.WriteLine($"User {command.User.Id} executed the '{command.Data.Name}' " +
$"command{(command.IsDMInteraction ? " in a DM" : (" in guild " + (command.GuildId?.ToString() ?? "(null)") + " in channel " + (command.ChannelId?.ToString() ?? "(null)") + $" ({command.Channel?.ChannelType.ToString() ?? "null Channel Type"})"))} with the following parameters: {(command.Data.Options.Count > 0 ? string.Join(", ", command.Data.Options.Select(option => $"({option.Name} - {Regex.Replace(option.Value.ToString() ?? "", @"[^\w\.@-]", "")})")) : "(No options)")}");
string locale = GetLocale(command);
bool canSendMessage = CanSendMessage(command);
Console.WriteLine($"Command's locale is {locale}");
Console.WriteLine($"Message can be sent: {canSendMessage}");
string command_name = command.Data.Name;
switch (command_name)
{
case "help":
{
var help = new EmbedBuilder() {};
foreach (SocketApplicationCommand slashcommand in command_list ?? [])
{
if (string.IsNullOrWhiteSpace(slashcommand.Name)) continue;
if (slashcommand.Name == "help") continue;
help.AddField(
"/" + (slashcommand.NameLocalizations.GetValueOrDefault(locale) ?? slashcommand.Name),
slashcommand.DescriptionLocalizations.GetValueOrDefault(locale) ?? slashcommand.Description ?? "",
true);
};
await command.RespondAsync(null, [help.Build()], false, false);
break;
}
case "random":
{
Random rand = new Random();
var level_option = command.Data.Options.Where(item => item.Name == "level");
var diff_option = command.Data.Options.Where(item => item.Name == "difficulty");
var genre_option = command.Data.Options.Where(item => item.Name == "genre");
int level = (int)(level_option.Count() > 0 ? (long)level_option.First().Value : 0);
string difficulty = diff_option.Count() > 0 ? (string)diff_option.First().Value : "";
string genre = genre_option.Count() > 0 ? (string)genre_option.First().Value : "";
bool uses_diff_or_level = level > 0 || difficulty != "";
Dictionary<string, Song> songlist = SongDatabase.Songs;
if (genre != "") songlist = songlist.Where(song => song.Value.GetAllGenres().Contains(Song.GetGenreFromString(genre))).ToDictionary();
if (uses_diff_or_level)
{
if (level > 0 && difficulty != "") {
if (difficulty == "both")
songlist = songlist.Where(song => song.Value.Difficulties["ex"].Level == level || song.Value.Difficulties["hidden"].Level == level).ToDictionary();
else
songlist = songlist.Where(song => song.Value.Difficulties[difficulty].Level == level).ToDictionary();
}
else if (level > 0) {
songlist = songlist.Where(song => song.Value.Difficulties["ex"].Level == level || song.Value.Difficulties["hidden"].Level == level).ToDictionary();
}
else if (difficulty != "")
{
if (difficulty == "both")
songlist = songlist.Where(song => song.Value.Difficulties["ex"].Level > 0).ToDictionary();
else
songlist = songlist.Where(song => song.Value.Difficulties[difficulty].Level > 0).ToDictionary();
}
if (songlist.Count > 0)
{
Song.SongDifficulty randomEx(Song song)
{
if (song.Difficulties["hidden"].Level <= 0) return Song.SongDifficulty.Extreme;
if ((level <= 0) || (song.Difficulties["ex"].Level == level && song.Difficulties["hidden"].Level == level)) {
return rand.Next(2) == 1 ? Song.SongDifficulty.Hidden : Song.SongDifficulty.Extreme;
}
return song.Difficulties["hidden"].Level == level ? Song.SongDifficulty.Hidden : Song.SongDifficulty.Extreme;
}
Song song = songlist.ElementAt(rand.Next(songlist.Count)).Value;
await PostDiff(command, song, difficulty switch
{
"easy" => Song.SongDifficulty.Easy,
"normal" => Song.SongDifficulty.Normal,
"hard" => Song.SongDifficulty.Hard,
"ex" => Song.SongDifficulty.Extreme,
"hidden" => Song.SongDifficulty.Hidden,
"both" => randomEx(song),
_ => Song.SongDifficulty.Extreme
});
}
else
{
await command.RespondAsync("Could not find any songs with the given parameters.", null, false, true);
}
}
else
{
Song song = songlist.ElementAt(rand.Next(songlist.Count)).Value;
await PostSong(command, song);
}
break;
}
case "song":
{
if (command.Data.Options.Count == 1 || command.Data.Options.Count == 2)
{
string title = (string)command.Data.Options.First(option => option.Name == "title").Value;
string found_title = SongDatabase.SongNames.TryGetValue(title, out string? result) ? result : title;
if (SongDatabase.Songs.TryGetValue(found_title, out Song? song))
{
if (command.Data.Options.Any(option => option.Name == "difficulty"))
{
switch ((string)command.Data.Options.First(option => option.Name == "difficulty").Value)
{
case "easy": await PostDiff(command, song, Song.SongDifficulty.Easy); break;
case "normal": await PostDiff(command, song, Song.SongDifficulty.Normal); break;
case "hard": await PostDiff(command, song, Song.SongDifficulty.Hard); break;
case "ex": await PostDiff(command, song, Song.SongDifficulty.Extreme); break;
case "hidden": await PostDiff(command, song, Song.SongDifficulty.Hidden); break;
default: await PostSong(command, song); break;
}
}
else
await PostSong(command, song);
}
else
await command.RespondAsync(LocaleData.GetString("DISCLAIMER_MISSING", command.UserLocale ?? "en-US", title), null, false, true);
}
else
{
await command.RespondAsync(
"Attempted to run the `/song` command, but 0, or more than 2, options were received. If this error persists, let the bot owner know.", null, false, true);
}
break;
}
case "region":
{
await command.RespondAsync("Information on the region lock status of all songs can be found on this spreadsheet, courtesy of Taiko Time :\n<https://docs.google.com/spreadsheets/d/1Piucd3Wv-QVQJ_yMQjC1xV08Cl2IXGze_8bf8nQZGjs/>\nYou can also help Taiko Time by filling out this form when songs are added/updated :\n<https://forms.gle/49VyswkbbBDp1YB89>", null, false, false);
break;
}
case "campaign":
{
var campaign_option = command.Data.Options.Where(option => option.Name == "name");
string campaign_name = campaign_option.Count() > 0 ? (string)campaign_option.First().Value : "";
switch (campaign_name)
{
case "project_sekai":
{
string title = locale switch
{
"ja" => "プロジェクトセカイ カラフルステージ! feat. 初音ミク × 太鼓の達人 コラボキャンペーン",
"zh-TW" => "世界計畫 繽紛舞台! feat. 初音未來 × 太鼓之達人 合作活動",
"ko" => "프로젝트 세카이 컬러풀 스테이지! feat. 하츠네 미쿠 × 태고의 달인 콜라보레이션 캠페인",
_ => "HATSUNE MIKU: COLORFUL STAGE! x Taiko no Tatsujin Collaboration Campaign"
};
string url = locale switch
{
"ja" => "https://taiko.namco-ch.net/taiko/special/pjsekai/",
"zh-TW" => "https://taiko.namco-ch.net/taiko/tc/special/pjsekai/",
"ko" => "https://taiko.namco-ch.net/taiko/kr/special/pjsekai/",
_ => "https://taiko.namco-ch.net/taiko/en/special/pjsekai/"
};
string image_url = locale switch
{
"ja" => "https://media.discordapp.net/attachments/1345259022684524544/1476378835963609238/634910926_1429624629178967_2506341827598295343_n.png",
"zh-TW" => "https://media.discordapp.net/attachments/1345259022684524544/1476378836366266528/637707403_1429888152485948_9083978382669198856_n.png",
"ko" => "https://media.discordapp.net/attachments/1345259022684524544/1476378836777173024/636849544_1429888412485922_5908332965979990529_n.png",
_ => "https://media.discordapp.net/attachments/1345259022684524544/1476378837284815020/639680609_1429888079152622_844361099815887236_n.png"
};
var project_sekai = new EmbedBuilder()
{
Title = title,
Color = new(0x00ccbb),
Url = url,
ImageUrl = image_url,
Description =
$"{LocaleData.GetString("CAMPAIGN_URL", locale, url)}\n" +
$"{LocaleData.GetString("CAMPAIGN_HIROBAURL", locale, "https://donderhiroba.jp/campaign_top.php?campaign_id=53")}\n\n" +
$"{LocaleData.GetString("CAMPAIGN_AVAILABLE", locale, 1776618000)}",
Timestamp = DateTimeOffset.UtcNow,
Footer = GetFooter(command)
};
var component = new ComponentBuilder();
component.WithButton(CreateSongButton(command, "てらてら"));
component.WithButton(CreateSongButton(command, "モア!ジャンプ!モア!"));
component.WithButton(CreateSongButton(command, "CR詠ZY"));
component.WithButton(CreateSongButton(command, "トンデモワンダーズ"));
component.WithButton(CreateSongButton(command, "バグ"));
await command.RespondAsync(null, [project_sekai.Build()], false, false, null, component.Build());
break;
}
case "arknights":
{
string url = locale switch
{
"ja" => "https://taiko.namco-ch.net/taiko/special/arknights/",
"zh-TW" => "https://taiko.namco-ch.net/taiko/tc/special/arknights/",
"ko" => "https://taiko.namco-ch.net/taiko/kr/special/arknights/",
_ => "https://taiko.namco-ch.net/taiko/en/special/arknights/"
};
var arknights = new EmbedBuilder()
{
Title = locale switch
{
"ja" => "アークナイツ×太鼓の達人 コラボキャンペーン",
"zh-TW" => "明日方舟×太鼓之達人 合作活動",
"ko" => "명일방주×태고의 달인 콜라보레이션 캠페인",
_ => "ARKNIGHTS × Taiko no Tatsujin Collaboration Campaign"
},
Color = new(0x00ffff),
Url = url,
// Use Don or Katsu profile pictures from Arknights, based on user ID :^)
ThumbnailUrl = ((command.User?.Id ?? 1) % 2 == 1) ?
"https://arknights.wiki.gg/images/thumb/Enthusiastic_Don_Don_profile.png/120px-Enthusiastic_Don_Don_profile.png?b357de" :
"https://arknights.wiki.gg/images/thumb/Cheerful_Ka_Ka_profile.png/120px-Cheerful_Ka_Ka_profile.png?9961df",
ImageUrl = "https://taiko-ch.net/urgybrhm3ukw/blog/wp-content/uploads/2025/12/cae4027c45f059c7c6d3fbb3cabf1318.png",
Description =
$"{LocaleData.GetString("CAMPAIGN_URL", locale, url)}\n" +
$"{LocaleData.GetString("CAMPAIGN_HIROBAURL", locale, "https://donderhiroba.jp/campaign_top.php?campaign_id=54")}\n\n" +
$"__{LocaleData.GetString("ITEM_PUCHI", locale)}__\n{LocaleData.GetString("CAMPAIGN_AVAILABLE", locale, 1774198800)}\n\n" +
$"__{LocaleData.GetString("CAMPAIGN_GOODS", locale)}__\n{LocaleData.GetString("CAMPAIGN_AVAILABLE", locale, 1774803600)}\n-# {LocaleData.GetString("DISCLAIMER_ONLYJAPAN", locale)}",
Timestamp = DateTimeOffset.UtcNow,
Footer = GetFooter(command)
};
var component = new ComponentBuilder();
component.WithButton(CreateSongButton(command, "Radiant"));
component.WithButton(CreateSongButton(command, "Break Through the Dome"));
await command.RespondAsync(null, [arknights.Build()], false, false, null, component.Build());
break;
}
case "winter2025":
{
var winter2025 = new EmbedBuilder()
{
Title = locale switch
{
"ja" => "きせかえザクザクキャンペーン2025冬",
"zh-TW" => "換裝道具滿滿活動2025冬",
"ko" => "갈아입히기 아이템 듬뿍 캠페인 2025 겨울",
_ => "Oodles of Outfits Campaign Winter 2025"
},
Color = donShop_Winter_color,
Url = "https://www.facebook.com/photo/?fbid=1396519069156190&set=ecnf.100063943299686",
ThumbnailUrl = donShop_Winter_img,
ImageUrl = "https://taiko-ch.net/urgybrhm3ukw/blog/wp-content/uploads/2026/01/d7e9fa9a9aede1e71079379f6575e85d.png",
Description = LocaleData.GetString("CAMPAIGN_UNLOCKURL", locale, "[English](https://docs.google.com/spreadsheets/d/1rVC1x8jPCvgJ1KK6W0XIxdHwyMsZiasqp-pnt7sAOAA/) / [日本語](https://wikiwiki.jp/taiko-fumen/%E4%BD%9C%E5%93%81/%E6%96%B0AC/%E3%82%AD%E3%83%A3%E3%83%B3%E3%83%9A%E3%83%BC%E3%83%B3#campaign2025win)"
+ "\n\n" + LocaleData.GetString("CAMPAIGN_AVAILABLE", locale, 1773594000)),
Timestamp = DateTimeOffset.UtcNow,
Footer = GetFooter(command)
};
await command.RespondAsync(null, [winter2025.Build()], false, false);
break;
}
case "kamen2025":
{
var kamen2025 = new EmbedBuilder()