another broken query that I can't properly fix myself

This commit is contained in:
13xforever 2019-11-06 04:32:50 +05:00
parent a33c69a2bd
commit 4a9fcb2156

View File

@ -45,6 +45,8 @@ namespace CompatBot.Commands
[Command("users"), Aliases("top"), RequiresBotModRole, TriggersTyping] [Command("users"), Aliases("top"), RequiresBotModRole, TriggersTyping]
[Description("List users with warnings, sorted from most warned to least")] [Description("List users with warnings, sorted from most warned to least")]
public async Task Users(CommandContext ctx, [Description("Optional number of items to show. Default is 10")] int number = 10) public async Task Users(CommandContext ctx, [Description("Optional number of items to show. Default is 10")] int number = 10)
{
try
{ {
var isMod = ctx.User.IsWhitelisted(ctx.Client, ctx.Guild); var isMod = ctx.User.IsWhitelisted(ctx.Client, ctx.Guild);
if (number < 1) if (number < 1)
@ -71,6 +73,12 @@ namespace CompatBot.Commands
} }
await ctx.SendAutosplitMessageAsync(new StringBuilder("Warning count per user:").Append(table)).ConfigureAwait(false); await ctx.SendAutosplitMessageAsync(new StringBuilder("Warning count per user:").Append(table)).ConfigureAwait(false);
} }
catch (Exception e)
{
Config.Log.Error(e);
await ctx.ReactWithAsync(Config.Reactions.Failure, "SQL query for this command is broken at the moment", true).ConfigureAwait(false);
}
}
[Command("by"), RequiresBotModRole] [Command("by"), RequiresBotModRole]
[Description("Shows warnings issued by the specified moderator")] [Description("Shows warnings issued by the specified moderator")]