public async Task Reanalyze(CommandContext ctx) { try { LogParsingHandler.EnqueueLogProcessing(ctx.Client, ctx.Channel, ctx.Message, ctx.Member, true, true); } catch (Exception e) { Config.Log.Warn(e); await ctx.ReactWithAsync(Config.Reactions.Failure).ConfigureAwait(false); } }
public async Task Reanalyze(CommandContext ctx) { try { if (ctx.Message.Attachments.Any()) { LogParsingHandler.EnqueueLogProcessing(ctx.Client, ctx.Channel, ctx.Message, ctx.Member, true, true); } else if (ctx.Message.ReferencedMessage is {} refMsg&& refMsg.Attachments.Any()) { LogParsingHandler.EnqueueLogProcessing(ctx.Client, ctx.Channel, refMsg, ctx.Member, true, true); } } catch (Exception e) { Config.Log.Warn(e); await ctx.ReactWithAsync(Config.Reactions.Failure).ConfigureAwait(false); } }
public async Task Reanalyze(CommandContext ctx, [Description("Message ID from the same channel")] ulong messageId) { try { var msg = await ctx.Channel.GetMessageAsync(messageId).ConfigureAwait(false); if (msg == null) { await ctx.ReactWithAsync(Config.Reactions.Failure).ConfigureAwait(false); } else { LogParsingHandler.EnqueueLogProcessing(ctx.Client, ctx.Channel, msg, ctx.Member, true); } } catch { await ctx.ReactWithAsync(Config.Reactions.Failure).ConfigureAwait(false); } }
public async Task Reanalyze(CommandContext ctx, [Description("Full message link")] string messageLink) { try { var msg = await ctx.GetMessageAsync(messageLink).ConfigureAwait(false); if (msg == null) { await ctx.ReactWithAsync(Config.Reactions.Failure).ConfigureAwait(false); } else { LogParsingHandler.EnqueueLogProcessing(ctx.Client, ctx.Channel, msg, ctx.Member, true); } } catch (Exception e) { Config.Log.Warn(e); await ctx.ReactWithAsync(Config.Reactions.Failure).ConfigureAwait(false); } }