Skip to content

Commit 3b9fa87

Browse files
committed
Fix handling of Canary+Dev insider builds, prevent duplicate insider channels
1 parent 4dc82d9 commit 3b9fa87

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Commands/InteractionCommands/AnnouncementInteractions.cs

+7-2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ public async Task AnnounceBuildSlashCommand(InteractionContext ctx,
4040
return;
4141
}
4242

43+
if (insiderChannel1 == insiderChannel2)
44+
{
45+
await ctx.RespondAsync($"{Program.cfgjson.Emoji.Error} Both insider channels cannot be the same! Simply set one instead.", ephemeral: true);
46+
}
47+
4348
if (windowsVersion == 10 && insiderChannel1 != "RP")
4449
{
4550
await ctx.RespondAsync(text: $"{Program.cfgjson.Emoji.Error} Windows 10 only has a Release Preview Channel.", ephemeral: true);
@@ -128,7 +133,7 @@ public async Task AnnounceBuildSlashCommand(InteractionContext ctx,
128133
{
129134
pingMsgString += $"\n\nDiscuss it here: {threadChannel.Mention}";
130135
}
131-
else if (insiderChannel1 == "Canary" && Program.cfgjson.InsiderCanaryThread != 0 && autothreadName == "Build {0} ({1})" && !canaryCreateNewThread)
136+
else if (insiderChannel1 == "Canary" && insiderChannel2 == "" && Program.cfgjson.InsiderCanaryThread != 0 && autothreadName == "Build {0} ({1})" && !canaryCreateNewThread)
132137
{
133138
threadChannel = await ctx.Client.GetChannelAsync(Program.cfgjson.InsiderCanaryThread);
134139
pingMsgString += $"\n\nDiscuss it here: {threadChannel.Mention}";
@@ -165,7 +170,7 @@ public async Task AnnounceBuildSlashCommand(InteractionContext ctx,
165170
{
166171
noPingMsgString += $"\n\nDiscuss it here: {threadChannel.Mention}";
167172
}
168-
else if (insiderChannel1 == "Canary" && Program.cfgjson.InsiderCanaryThread != 0 && autothreadName == "Build {0} ({1})" && !canaryCreateNewThread)
173+
else if (insiderChannel1 == "Canary" && insiderChannel2 == "" && Program.cfgjson.InsiderCanaryThread != 0 && autothreadName == "Build {0} ({1})" && !canaryCreateNewThread)
169174
{
170175
threadChannel = await ctx.Client.GetChannelAsync(Program.cfgjson.InsiderCanaryThread);
171176
noPingMsgString += $"\n\nDiscuss it here: {threadChannel.Mention}";

0 commit comments

Comments
 (0)