Advertisement
REDLIGHT

Nitro Sniper

Apr 29th, 2020
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.65 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Discord;
  7. using System.Threading;
  8. using Discord.WebSocket;
  9. using System.Net;
  10. using System.IO;
  11.  
  12. namespace _360_Epic_Discord_Sniper_by_Sheepy
  13. {
  14. class Program
  15. {
  16. private static DiscordSocketClient _client;
  17. private static string _token;
  18.  
  19. static void Main(string[] args)
  20. {
  21. string token = "";
  22. Console.Title = "360 Epic Discord Sniper by Sheepy";
  23. if ((Properties.Settings.Default.Token == "null")|| (Properties.Settings.Default.Token == ""))
  24. {
  25. Console.Write("Token: ");
  26. token = Console.ReadLine();
  27. Properties.Settings.Default.Token = _token;
  28. Properties.Settings.Default.Save();
  29.  
  30. }
  31. else
  32. {
  33. token = Properties.Settings.Default.Token;
  34. }
  35. _token = token;
  36.  
  37. Console.Clear();
  38.  
  39. _client = new DiscordSocketClient();
  40.  
  41. _client.MessageReceived += _client_MessageReceived;
  42.  
  43. _client.LoginAsync(TokenType.User, token);
  44. _client.Ready += ReadyAsync;
  45. _client.Log += _client_Log;
  46. _client.StartAsync();
  47.  
  48. Thread.Sleep(-1);
  49. }
  50.  
  51. private static Task _client_MessageReceived(SocketMessage arg)
  52. {
  53.  
  54. if (arg.Content.Contains("https://discord.gift/"))
  55. {
  56. string code = arg.Content.Split(new[] { @"https://discord.gift/" }, StringSplitOptions.None)[1].Split(' ')[0];
  57.  
  58. CookieContainer cookieContainer = new CookieContainer();
  59.  
  60.  
  61. try
  62. {
  63.  
  64. string payload = "";
  65.  
  66. var request2 = (HttpWebRequest)WebRequest.Create($"https://discordapp.com/api/v6/entitlements/gift-codes/{code}/redeem");
  67. request2.Accept = "application/json, text/javascript, */*; q=0.01";
  68.  
  69. var postData = payload;
  70. var data = Encoding.ASCII.GetBytes(postData);
  71. request2.Headers["authorization"] = _token;
  72. request2.Method = "POST";
  73. request2.ContentType = "application/json";
  74. request2.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36";
  75. request2.ContentLength = data.Length;
  76. using (var stream = request2.GetRequestStream())
  77. {
  78. stream.Write(data, 0, data.Length);
  79. }
  80. var response = (HttpWebResponse)request2.GetResponse();
  81. string responsestring = new StreamReader(response.GetResponseStream()).ReadToEnd();
  82.  
  83.  
  84. if ((int)response.StatusCode == 200)
  85. {
  86. Log($"Successfully redeemed code {code}", ConsoleColor.Green);
  87. }
  88. }
  89. catch (WebException e)
  90. {
  91. var errresp = (HttpWebResponse)e.Response;
  92. string respstring = new StreamReader(errresp.GetResponseStream()).ReadToEnd();
  93. if ((int)errresp.StatusCode == 404)
  94. {
  95. Log($"Failed to redeem code {code}", ConsoleColor.Red);
  96. }
  97. else if (((int)errresp.StatusCode == 400)|| ((int)errresp.StatusCode == 429))
  98. {
  99. Log($"Expired code {code}", ConsoleColor.Red);
  100. }
  101. }
  102. catch
  103. {
  104. }
  105. }
  106. return Task.CompletedTask;
  107. }
  108.  
  109. private static Task _client_Log(LogMessage arg)
  110. {
  111. Log(arg.Message, ConsoleColor.Red);
  112. return Task.CompletedTask;
  113. }
  114. private static void Log(string message, ConsoleColor consoleColor)
  115. {
  116. Console.Write("[");
  117. Console.ForegroundColor = consoleColor;
  118. Console.Write(DateTime.Now.ToString("h:mm:ss"));
  119. Console.ForegroundColor = ConsoleColor.White;
  120. Console.Write($"] {message}\n");
  121.  
  122. }
  123. private static Task ReadyAsync()
  124. {
  125. Console.Title = $"360 Epic Discord Sniper by Sheepy | {_client.CurrentUser.Username}#{_client.CurrentUser.Discriminator}";
  126.  
  127. return Task.CompletedTask;
  128. }
  129. }
  130. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement