Beispiel #1
0
        public async Task Info([Summary("The user you want to display XP")]
                               IGuildUser user)
        {
            try
            {
                if (!GuildConfigManager.Get(Context.Guild.Id).EnableXpSystem)
                {
                    await ReplyAsync("XP System is disabled for this Guild! An Admin can use `$togglexp`!");

                    return;
                }

                var xp = XpManager.Get(Context.Guild, user);

                var builder = new EmbedBuilder
                {
                    Author = new EmbedAuthorBuilder
                    {
                        Name    = user.IsBot ? $"{Helper.GetName(user)}'s XP (Bot)" : $"{Helper.GetName(user)}'s XP",
                        IconUrl = user.GetAvatarUrl()
                    },
                    Color = new Color(50, 125, 0)
                };
                builder.AddInlineField("XP", xp.Xp);
                builder.AddInlineField("Level", xp.Level);
                builder.AddInlineField("Next Level", XpManager.GetXp(xp.Level + 1) - xp.Xp);

                await ReplyAsync("", embed : builder.Build());
            } catch
            {
                await ReplyAsync($"I couldn't look up any Info about {Helper.GetName(user)}, sorry..");
            }
        }
Beispiel #2
0
        public async Task Info([Summary("The user you want to display XP")] IGuildUser user)
        {
            try {
                XpManager.UserXp xp = XpManager.Get(user);

                EmbedBuilder builder = new EmbedBuilder {
                    Author = new EmbedAuthorBuilder {
                        Name    = user.IsBot ? $"{Helper.GetName(user)}'s XP (Bot)" : $"{Helper.GetName(user)}'s XP",
                        IconUrl = user.GetAvatarUrl()
                    },
                    Color = new Color(50, 125, 0)
                };
                builder.AddField("XP", xp.Xp);
                builder.AddField("Reserve XP", xp.XpReserve);
                builder.AddField("Level", xp.Level);
                builder.AddField("Next Level", XpManager.GetXp(xp.Level + 1) - xp.Xp);

                await ReplyAsync("", embed : builder.Build());
            } catch {
                await ReplyAsync($"I couldn't look up any Info about {Helper.GetName(user)}, sorry..");
            }
        }
Beispiel #3
0
        public async Task Info()
        {
            try {
                XpManager.UserXp xp = XpManager.Get(Context.User);

                EmbedBuilder builder = new EmbedBuilder {
                    Author = new EmbedAuthorBuilder {
                        Name    = Context.User.IsBot ? $"{Helper.GetName(Context.User)}'s XP (Bot)" : $"{Helper.GetName(Context.User)}'s XP",
                        IconUrl = Context.User.GetAvatarUrl()
                    },
                    Color = new Color(50, 125, 0)
                };
                builder.AddField("XP", xp.Xp);
                builder.AddField("Reserve XP", xp.XpReserve);
                builder.AddField("Level", xp.Level);
                builder.AddField("Next Level", XpManager.GetXp(xp.Level + 1) - xp.Xp);

                await ReplyAsync("", embed : builder.Build());
            } catch {
                await ReplyAsync("I couldn't look up any Info about you, sorry..");
            }
        }