Skip to content

Commit 41620b0

Browse files
config: Make insiderCommandLockedToChannel an alias of insidersChannel
Also changes usages to InsidersChannel; config.json accepts both, but only InsidersChannel can be used in code
1 parent 0c9ef0a commit 41620b0

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

Commands/InteractionCommands/AnnouncementInteractions.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public async Task AnnounceBuildSlashCommand(InteractionContext ctx,
3434
[Option("lockdown", "Set 0 to not lock. Lock the channel for a certain period of time after announcing the build.")] string lockdownTime = "auto"
3535
)
3636
{
37-
if (Program.cfgjson.InsiderCommandLockedToChannel != 0 && ctx.Channel.Id != Program.cfgjson.InsiderCommandLockedToChannel)
37+
if (Program.cfgjson.InsidersChannel != 0 && ctx.Channel.Id != Program.cfgjson.InsidersChannel)
3838
{
39-
await ctx.RespondAsync($"{Program.cfgjson.Emoji.Error} This command only works in <#{Program.cfgjson.InsiderCommandLockedToChannel}>!", ephemeral: true);
39+
await ctx.RespondAsync($"{Program.cfgjson.Emoji.Error} This command only works in <#{Program.cfgjson.InsidersChannel}>!", ephemeral: true);
4040
return;
4141
}
4242

Structs.cs

+7-2
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,16 @@ public class ConfigJson
269269
[JsonProperty("insiderAnnouncementChannel")]
270270
public ulong InsiderAnnouncementChannel { get; private set; } = 0;
271271

272+
private ulong insidersChannel;
272273
[JsonProperty("insidersChannel")]
273-
public ulong InsidersChannel { get; private set; }
274+
public ulong InsidersChannel
275+
{
276+
get => insidersChannel == 0 ? InsiderCommandLockedToChannel : insidersChannel;
277+
private set => insidersChannel = value;
278+
}
274279

275280
[JsonProperty("insiderCommandLockedToChannel")]
276-
public ulong InsiderCommandLockedToChannel { get; private set; } = 0;
281+
private ulong InsiderCommandLockedToChannel { get; set; } = 0;
277282

278283
[JsonProperty("dmAutoresponseTimeLimit")]
279284
public int DmAutoresponseTimeLimit { get; private set; } = 0;

config.json

-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@
318318
"insiderAnnouncementChannel": 1043898319883219004,
319319
"insiderInfoChannel": 1279201622651572317,
320320
"insidersChannel": 187649467611086849,
321-
"insiderCommandLockedToChannel": 187649467611086849,
322321
"dmAutoresponseTimeLimit": 6,
323322
"autoDeleteEmptyThreads": true,
324323
"insiderCanaryThread": 1082394217168523315,

0 commit comments

Comments
 (0)