예제 #1
0
    public string GetMemberList(PremiumRank rank)
    {
        if (rank is Cloth)
        {
            if (Cloth.Members.Count == 0)
            {
                return("No members yet :( Be the first by typing r!premium");
            }
            else
            {
                StringBuilder members = new StringBuilder();

                foreach (PremiumUser user in Cloth.Members)
                {
                    members.Append($"{user.Name}\n");
                }

                return(members.ToString());
            }
        }
        else if (rank is Wooden)
        {
            if (Wooden.Members.Count == 0)
            {
                return("No members yet :( Be the first by typing r!premium");
            }
            else
            {
                StringBuilder members = new StringBuilder();

                foreach (PremiumUser user in Wooden.Members)
                {
                    members.Append($"{user.Name}\n");
                }

                return(members.ToString());
            }
        }
        else if (rank is HighQuality)
        {
            if (HighQuality.Members.Count == 0)
            {
                return("No members yet :( Be the first by typing r!premium");
            }
            else
            {
                StringBuilder members = new StringBuilder();

                foreach (PremiumUser user in HighQuality.Members)
                {
                    members.Append($"{user.Name}\n");
                }

                return(members.ToString());
            }
        }

        return("Not found");
    }
예제 #2
0
    public async Task VerifyPremium(string transactionId)
    {
        Stopwatch sw = new Stopwatch();

        sw.Start();



        PremiumRank p = await PremiumUtils.VerifyPremium(transactionId, Context.User.Id);

        if (p == null || !PremiumUtils.AssignPremiumRank(Context.User, p))
        {
            await ReplyAsync("", false, Utilities.GetEmbedMessage("Premium Verification", "Verification Failed", Language.Premium_Verification_Error_Failed, Context.User));
        }
        else
        {
            EmbedBuilder       eb = new EmbedBuilder();
            EmbedFooterBuilder fb = new EmbedFooterBuilder();

            fb.WithIconUrl(Context.Message.Author.GetAvatarUrl());

            eb.WithTitle($"Premium Verification");
            eb.WithColor(PremiumUtils.SelectEmbedColour(Context.User));
            eb.WithFooter(fb);
            eb.AddField("Verification Successful", "Congratulations, your rank has been assigned.");

            if ((object)p is Cloth)
            {
                eb.AddField("Rank Assigned", "Cloth");
            }
            else if ((object)p is Wooden)
            {
                eb.AddField("Rank Assigned", "Wooden");
            }
            else if ((object)p is HighQuality)
            {
                eb.AddField("Rank Assigned", "High Quality");
            }

            fb.WithText(PremiumUtils.SelectFooterEmbedText(Context.User, sw));;
            eb.WithFooter(fb);

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