Exemple #1
0
        public static DiscordActiveSubscription PurchaseGuildBoost(this DiscordClient client, ulong paymentMethodId, int quantity = 1)
        {
            var activeSubs = client.GetActiveSubscriptions();

            if (activeSubs.Count > 0)
            {
                return(client.AddPlanToSubscription(paymentMethodId, activeSubs[0].Id, DiscordNitroSubTypes.GuildBoost.SubscriptionPlanId, quantity));
            }
            else
            {
                return(client.PurchaseSubscription(paymentMethodId, DiscordNitroSubTypes.GuildBoost.SkuId, new List <AdditionalSubscriptionPlan>()
                {
                    new AdditionalSubscriptionPlan()
                    {
                        Id = DiscordNitroSubTypes.GuildBoost.SubscriptionPlanId,
                        Quantity = quantity
                    }
                }));
            }
        }