Skip to content

Commit

Permalink
config: Make insiderCommandLockedToChannel an alias of insidersChannel
Browse files Browse the repository at this point in the history
Also changes usages to InsidersChannel; config.json accepts both, but only InsidersChannel can be used in code
  • Loading branch information
FloatingMilkshake committed Jan 2, 2025
1 parent 0c9ef0a commit 41620b0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Commands/InteractionCommands/AnnouncementInteractions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public async Task AnnounceBuildSlashCommand(InteractionContext ctx,
[Option("lockdown", "Set 0 to not lock. Lock the channel for a certain period of time after announcing the build.")] string lockdownTime = "auto"
)
{
if (Program.cfgjson.InsiderCommandLockedToChannel != 0 && ctx.Channel.Id != Program.cfgjson.InsiderCommandLockedToChannel)
if (Program.cfgjson.InsidersChannel != 0 && ctx.Channel.Id != Program.cfgjson.InsidersChannel)
{
await ctx.RespondAsync($"{Program.cfgjson.Emoji.Error} This command only works in <#{Program.cfgjson.InsiderCommandLockedToChannel}>!", ephemeral: true);
await ctx.RespondAsync($"{Program.cfgjson.Emoji.Error} This command only works in <#{Program.cfgjson.InsidersChannel}>!", ephemeral: true);
return;
}

Expand Down
9 changes: 7 additions & 2 deletions Structs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,16 @@ public class ConfigJson
[JsonProperty("insiderAnnouncementChannel")]
public ulong InsiderAnnouncementChannel { get; private set; } = 0;

private ulong insidersChannel;
[JsonProperty("insidersChannel")]
public ulong InsidersChannel { get; private set; }
public ulong InsidersChannel
{
get => insidersChannel == 0 ? InsiderCommandLockedToChannel : insidersChannel;
private set => insidersChannel = value;
}

[JsonProperty("insiderCommandLockedToChannel")]
public ulong InsiderCommandLockedToChannel { get; private set; } = 0;
private ulong InsiderCommandLockedToChannel { get; set; } = 0;

[JsonProperty("dmAutoresponseTimeLimit")]
public int DmAutoresponseTimeLimit { get; private set; } = 0;
Expand Down
1 change: 0 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@
"insiderAnnouncementChannel": 1043898319883219004,
"insiderInfoChannel": 1279201622651572317,
"insidersChannel": 187649467611086849,
"insiderCommandLockedToChannel": 187649467611086849,
"dmAutoresponseTimeLimit": 6,
"autoDeleteEmptyThreads": true,
"insiderCanaryThread": 1082394217168523315,
Expand Down

0 comments on commit 41620b0

Please sign in to comment.