Esempio n. 1
0
        public async Task ShowStringConfiguration()
        {
            EmbedBuilder eb = new EmbedBuilder()
                              .WithTitle("String Configuration")
                              .WithFooter("Bot Owner permissions required to change these variables!");

            eb.WithDescription("```INI\n" +
                               "[ 1] Default Website Name [ " + (StringConfiguration.Load().DefaultWebsiteName ?? "UNDEFINED") + " ]\n" +
                               "```");

            await ReplyAsync("", false, eb.Build());
        }
Esempio n. 2
0
        public async Task UserAbout(IUser user = null)
        {
            var userSpecified = user as SocketGuildUser ?? Context.User as SocketGuildUser;

            if (userSpecified == null)
            {
                await ReplyAsync("User not found, please try again.");

                return;
            }

            EmbedAuthorBuilder eab = new EmbedAuthorBuilder();

            if (!String.IsNullOrEmpty(userSpecified.Nickname))
            {
                eab.WithName("About " + userSpecified.Nickname);
            }
            else
            {
                eab.WithName("About " + userSpecified.Username);
            }

            eab.WithUrl(Configuration.Load().PROFILE_URL_ID_TAGGED + userSpecified.Id);

            EmbedFooterBuilder efb = new EmbedFooterBuilder();

            if (userSpecified.IsTeamMember())
            {
                eab.WithIconUrl(userSpecified.GetEmbedAuthorBuilderIconUrl());
            }
            if (!String.IsNullOrEmpty(userSpecified.GetFooterText()))
            {
                efb.WithText(userSpecified.GetFooterText());
                efb.WithIconUrl(userSpecified.GetEmbedFooterBuilderIconUrl());
            }

            EmbedBuilder eb = new EmbedBuilder()
                              .WithAuthor(eab)
                              .WithFooter(efb)
                              .WithThumbnailUrl(userSpecified.GetAvatarUrl())
                              .WithDescription(User.Load(userSpecified.Id).About)
                              .WithColor(userSpecified.GetCustomRGB());

            if (!String.IsNullOrEmpty(userSpecified.GetName()))
            {
                eb.AddField("Name", userSpecified.GetName(), true);
            }

            if (!String.IsNullOrEmpty(userSpecified.GetGender()))
            {
                eb.AddField("Gender", userSpecified.GetGender(), true);
            }

            if (!String.IsNullOrEmpty(userSpecified.GetPronouns()))
            {
                eb.AddField("Pronouns", userSpecified.GetPronouns(), true);
            }

            eb.AddField("Level", userSpecified.GetLevel(), true);
            eb.AddField("EXP", userSpecified.GetEXP() + " (" + (Math.Round(userSpecified.EXPToLevelUp()) - userSpecified.GetEXP()) + " EXP to level up)", true);
            eb.AddField("Account Created", userSpecified.UserCreateDate(), true);
            eb.AddField("Joined Guild", userSpecified.GuildJoinDate(), true);

            if (!String.IsNullOrEmpty(userSpecified.GetMinecraftUsername()))
            {
                eb.AddField("Minecraft Username", userSpecified.GetMinecraftUsername(), true);
            }

            if (!String.IsNullOrEmpty(userSpecified.GetWebsiteUrl()))
            {
                eb.AddField(StringConfiguration.Load().DefaultWebsiteName,
                            "[" + (userSpecified.GetWebsiteName() ?? StringConfiguration.Load().DefaultWebsiteName) + "](" +
                            userSpecified.GetWebsiteUrl() + ")", true);
            }

            if (!String.IsNullOrEmpty(userSpecified.GetInstagramUsername()))
            {
                eb.AddField("Instagram",
                            "[" + userSpecified.GetInstagramUsername() + "](https://www.instagram.com/" +
                            userSpecified.GetInstagramUsername() + "/)", true);
            }

            if (!String.IsNullOrEmpty(userSpecified.GetSnapchatUsername()))
            {
                eb.AddField("Snapchat",
                            "[" + userSpecified.GetSnapchatUsername() + "](https://www.snapchat.com/add/" +
                            userSpecified.GetSnapchatUsername() + "/)", true);
            }

            if (!String.IsNullOrEmpty(userSpecified.GetGitHubUsername()))
            {
                eb.AddField("GitHub",
                            "[" + userSpecified.GetGitHubUsername() + "](https://github.com/" +
                            userSpecified.GetGitHubUsername() + "/)", true);
            }

            if (!String.IsNullOrEmpty(userSpecified.GetPokemonGoFriendCode()))
            {
                eb.AddField("Pokémon Go Friend Code",
                            "[" + userSpecified.GetPokemonGoFriendCode() +
                            "](https://chart.googleapis.com/chart?chs=300x300&cht=qr&" +
                            userSpecified.GetPokemonGoFriendCode().Replace(" ", "") + "&choe=UTF-8)", true);
            }

            if (!String.IsNullOrEmpty(userSpecified.GetCustomPrefix()))
            {
                eb.AddField("Custom Prefix", userSpecified.GetCustomPrefix(), true);
            }

            eb.AddField("Profile", "[Online Profile](" + Configuration.Load().PROFILE_URL_ID_TAGGED + userSpecified.Id + ")", true);

            await ReplyAsync("", false, eb.Build());
        }