Skip to content

Commit d0c3265

Browse files
committed
bulklogs: add guard for db support being disabled
1 parent 59589b4 commit d0c3265

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Commands/UtilityCmds.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,12 @@ await LogChannelHelper.LogMessageAsync("secret",
194194
[RequireHomeserverPerm(ServerPermLevel.Moderator), RequirePermissions(DiscordPermission.ModerateMembers)]
195195
public async Task BulkLogsCmd(CommandContext ctx, [Parameter("user"), Description("The user you're looking for bulk logs containing")] DiscordUser user)
196196
{
197+
if (!Program.cfgjson.EnablePersistentDb)
198+
{
199+
await ctx.RespondAsync($"{Program.cfgjson.Emoji.Error} Database support is not enabled, so this command does nothing.");
200+
return;
201+
}
202+
197203
if (ctx is SlashCommandContext)
198204
await ctx.As<SlashCommandContext>().DeferResponseAsync(ephemeral: false);
199205

0 commit comments

Comments
 (0)