private async Task LogVerboseError(CommandInfo cmd, ITextChannel channel, string reason)
        {
            if (channel == null || !guildsEnabled.Contains(channel.GuildId))
            {
                return;
            }

            try
            {
                var embed = _hs.GetCommandHelp(cmd, channel.Guild)
                            .WithTitle("Command Error")
                            .WithDescription(reason)
                            .WithErrorColor();

                await channel.EmbedAsync(embed).ConfigureAwait(false);
            }
            catch
            {
                //ignore
            }
        }
Exemple #2
0
        private async Task LogVerboseError(CommandInfo cmd, ITextChannel channel, string reason)
        {
            if (channel == null)
            {
                return;
            }

            using var uow = _db.UnitOfWork;

            if (!uow.GuildConfigs.For(channel.GuildId).VerboseErrors)
            {
                return;
            }

            try {
                var embed = _hs.GetCommandHelp(cmd, channel.Guild)
                            .WithTitle("Command Error")
                            .WithDescription(reason)
                            .WithErrorColor();

                await channel.EmbedAsync(embed).ConfigureAwait(false);
            } catch { }
        }