Exemplo n.º 1
0
        public async Task Error(params string[] args)
        {
            await p.DoAction(Context.User, Program.Module.Information);

            if (args.Length == 0)
            {
                await ReplyAsync(Sentences.ErrorHelp(Context.Guild));

                return;
            }
            string id = string.Join("", args);

            if (!Program.p.exceptions.ContainsKey(id))
            {
                await ReplyAsync(Sentences.ErrorNotFound(Context.Guild));

                return;
            }
            var elem = Program.p.exceptions[id];

            await ReplyAsync("", false, new EmbedBuilder
            {
                Color       = Color.Purple,
                Title       = elem.exception.InnerException.GetType().ToString(),
                Description = "```" + Environment.NewLine + elem.exception.InnerException.Message + Environment.NewLine + "```",
                Fields      = new List <EmbedFieldBuilder>
                {
                    new EmbedFieldBuilder
                    {
                        Name  = Sentences.Command(Context.Guild),
                        Value = elem.exception.Context.Message.ToString().Replace("@", "@\u200b")
                    },
                    new EmbedFieldBuilder
                    {
                        Name  = Sentences.Date(Context.Guild),
                        Value = elem.date.ToString(Base.Sentences.DateHourFormat(Context.Guild))
                    }
                },
                Footer = new EmbedFooterBuilder
                {
                    Text = Sentences.ErrorGdpr(Context.Guild, "https://sanara.zirk.eu/gdpr.html#collectedError")
                }
            }.Build());
        }