public static Models.Nitro GetNitroInfo(string nitroCode, DiscordSocketClient client)
        {
            Models.Nitro nitro     = new Models.Nitro();
            string       nitroInfo = client.GetNitroGift(nitroCode).SubscriptionPlan.Name;

            if (nitroInfo.Contains("Classic"))
            {
                nitro.Type = "Classic";

                if (nitroInfo.Contains("Yearly"))
                {
                    nitro.Cost = 49.99;
                }
                else
                {
                    nitro.Cost = 4.99;
                }
            }
            else
            {
                nitro.Type = "Booster";

                if (nitroInfo.Contains("Yearly"))
                {
                    nitro.Cost = 99.99;
                }
                else if (nitroInfo.Contains("Quarterly"))
                {
                    nitro.Cost = 29.97;
                }
                else
                {
                    nitro.Cost = 9.99;
                }
            }

            nitro.Code        = nitroCode;
            nitro.DateOfClaim = DateTime.Now;

            return(nitro);
        }
Exemplo n.º 2
0
        private static string redeemcode(string result, Stopwatch timer)
        {
            timer.Start();
            if (result.Contains("https://discord.gift/"))
            {
                result = result.Replace("https://discord.gift/", "");
            }
            else if (result.Contains("https://discord.com/gifts/"))
            {
                result = result.Replace("https://discord.com/gifts/", "");
            }
            string rstatus;

            try
            {
                mainacc.RedeemGift(result);
                timer.Stop();

                rstatus = "REDEEMED";
            }
            catch
            {
                try
                {
                    if (mainacc.GetNitroGift(result).Consumed == true)
                    {
                        rstatus = "ALREADY REDEEMED";
                    }
                    else
                    {
                        rstatus = "ERROR REDEEMING";
                    }
                }
                catch
                {
                    rstatus = "UNKNOWN ERROR";
                }
            }
            return(rstatus);
        }
Exemplo n.º 3
0
        private static void Client_OnMessageReceived(DiscordSocketClient client, MessageEventArgs args)
        {
            messages++;

            Console.Title =
                $"AutoNitro - By iLinked | Account: {username} | Hits: {successes}/{attempts}/{messages} | Balance: ${balance} | Drops/Giveaways Participated: {giveawaysParticipated}/{giveawaysTotal}";

            string          nitroMessage     = args.Message.Content;
            Regex           regex            = new Regex(@"[^\s]+iscord.gift/[^\s]+|[^\s]+iscordapp.com/gifts/[^\s]+");
            MatchCollection nitroCodeMatches = regex.Matches(nitroMessage);

            for (int i = 0; i < nitroCodeMatches.Count; i++)
            {
                string nitroCode = nitroCodeMatches[i].ToString();

                nitroCode = nitroCode.Replace("https://discord.gift/", "");
                nitroCode = nitroCode.Replace("https://discordapp.com/gifts/", "");
                nitroCode = nitroCode.Replace("discord.gift/", "");
                nitroCode = nitroCode.Replace("discordapp.com/gifts/", "");
                try
                {
                    Client.RedeemNitroGift(nitroCode, args.Message.ChannelId);
                    string planName = client.GetNitroGift(nitroCode).SubscriptionPlan.Name;
                    if (planName.Contains("Classic"))
                    {
                        planName = Convert.ToString("$5 Classic");
                        Console.WriteLine(string.Concat(new string[]
                        {
                            "[SUCCESS] Redeemed Nitro Gift: ",
                            nitroCode,
                            " | Server: ",
                            Client.GetGuild(args.Message.GuildId.Value).Name,
                            " | Time: ",
                            DateTime.Now.ToLocalTime().ToString("dd/MM/yyyy HH:mm:ss"),
                            " | [",
                            planName,
                            "]"
                        }), Console.ForegroundColor = ConsoleColor.Green);
                        successes++;
                        balance      += 4.99;
                        Console.Title =
                            $"AutoNitro - By iLinked | Account: {username} | Hits: {successes}/{attempts}/{messages} | Balance: ${balance} | Drops/Giveaways Participated: {giveawaysParticipated}/{giveawaysTotal}";;
                    }
                    else if (planName.Contains("Classic") && planName.Contains("Yearly"))
                    {
                        planName = Convert.ToString("$50 Nitro");
                        Console.WriteLine(string.Concat(new string[]
                        {
                            "[SUCCESS] Redeemed Nitro Gift: ",
                            nitroCode,
                            " | Server: ",
                            Client.GetGuild(args.Message.GuildId.Value).Name,
                            " | Time: ",
                            DateTime.Now.ToLocalTime().ToString("dd/MM/yyyy HH:mm:ss"),
                            " | [",
                            planName,
                            "]"
                        }), Console.ForegroundColor = ConsoleColor.Green);
                        attempts++;
                        balance      += 49.99;
                        Console.Title =
                            $"AutoNitro - By iLinked | Account: {username} | Hits: {successes}/{attempts}/{messages} | Balance: ${balance} | Drops/Giveaways Participated: {giveawaysParticipated}/{giveawaysTotal}";;
                    }
                    else if (planName == "Nitro Yearly")
                    {
                        planName = Convert.ToString("$100 Nitro");
                        Console.WriteLine(string.Concat(new string[]
                        {
                            "[SUCCESS] Redeemed Nitro Gift: ",
                            nitroCode,
                            " | Server: ",
                            Client.GetGuild(args.Message.GuildId.Value).Name,
                            " | Time: ",
                            DateTime.Now.ToLocalTime().ToString("dd/MM/yyyy HH:mm:ss"),
                            " | [",
                            planName,
                            "]"
                        }), Console.ForegroundColor = ConsoleColor.Green);
                        successes++;
                        balance      += 99.99;
                        Console.Title =
                            $"AutoNitro - By iLinked | Account: {username} | Hits: {successes}/{attempts}/{messages} | Balance: ${balance} | Drops/Giveaways Participated: {giveawaysParticipated}/{giveawaysTotal}";;
                    }
                    else if (planName.Contains("Quarterly"))
                    {
                        planName = Convert.ToString("3 Months");
                        Console.WriteLine(string.Concat(new string[]
                        {
                            "[SUCCESS] Redeemed Nitro Gift: ",
                            nitroCode,
                            " | Server: ",
                            Client.GetGuild(args.Message.GuildId.Value).Name,
                            " | Time: ",
                            DateTime.Now.ToLocalTime().ToString("dd/MM/yyyy HH:mm:ss"),
                            " | [",
                            planName,
                            "]"
                        }), Console.ForegroundColor = ConsoleColor.Green);
                        successes++;
                        balance      += 29.97;
                        Console.Title =
                            $"AutoNitro - By iLinked | Account: {username} | Hits: {successes}/{attempts}/{messages} | Balance: ${balance} | Drops/Giveaways Participated: {giveawaysParticipated}/{giveawaysTotal}";;
                    }
                    else
                    {
                        planName = Convert.ToString("$10 Nitro");
                        Console.WriteLine(string.Concat(new string[]
                        {
                            "[SUCCESS] Redeemed Nitro Gift: ",
                            nitroCode,
                            " | Server: ",
                            Client.GetGuild(args.Message.GuildId.Value).Name,
                            " | Time: ",
                            DateTime.Now.ToLocalTime().ToString("dd/MM/yyyy HH:mm:ss"),
                            " | [",
                            planName,
                            "]"
                        }), Console.ForegroundColor = ConsoleColor.Green);
                        successes++;
                        balance      += 9.99;
                        Console.Title =
                            $"AutoNitro - By iLinked | Account: {username} | Hits: {successes}/{attempts}/{messages} | Balance: ${balance} | Drops/Giveaways Participated: {giveawaysParticipated}/{giveawaysTotal}";;
                    }
                }
                catch (DiscordHttpException ex)
                {
                    switch (ex.Code)
                    {
                    case DiscordError.NitroGiftRedeemed:
                        Console.WriteLine("[ERROR] Nitro gift already redeemed: " + nitroCode);
                        break;

                    case DiscordError.UnknownGiftCode:
                        Console.WriteLine("[ERROR] Invalid Nitro gift: " + nitroCode);
                        break;

                    default:
                        Console.WriteLine($"[ERROR] Unknown error: {ex.Code} | {ex.ErrorMessage}");
                        break;
                    }
                }

                attempts++;
                Console.Title =
                    $"AutoNitro - By iLinked | Account: {username} | Hits: {successes}/{attempts}/{messages} | Balance: ${balance} | Drops/Giveaways Participated: {giveawaysParticipated}/{giveawaysTotal}";
            }
        }