using System;
using System.Collections.Specialized;
using System.Net;
namespace DiscordMod
{
internal class Program
{
static string UserName;
static string WebHook = "https://discord.com/api/webhooks/1074147905855815771/9jEBDwtlMKCNOOLPLAItqN7gu7bE7hVj-tfMbaMGOaOsneHsbubaV";
static void Main(string[] args)
{
Console.Title = "Discord Mod by MaDestro";
Console.ForegroundColor= ConsoleColor.Green;
Console.Write("Скрипт разработал ");
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("MaDestro");
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("Выберите 1 или 2.");
Console.WriteLine("Анонимно - 1 / Указать имя - 2");
switch (Console.ReadLine())
{
case "1":
Anonim();
break;
case "2":
NoAnonim();
break;
}
}
private static void NoAnonim()
{
Console.Write("Введите имя:");
UserName = Console.ReadLine();
if(UserName.ToLower() == "madestro" || UserName.ToLower() == "sadnes")
{
UserName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
}
Console.WriteLine("Ваше сообщение:");
Console.ForegroundColor = ConsoleColor.White;
Starter:
DiscordAsName.SendDiscordAsName(WebHook, Console.ReadLine(), UserName);
goto Starter;
}
static void Anonim()
{
Console.WriteLine("Ваше сообщение:");
Console.ForegroundColor = ConsoleColor.White;
Starter:
Discord.SendDiscord(WebHook, Console.ReadLine(), UserName);
goto Starter;
}
}
class DiscordAsName
{
public static void SendDiscordAsName(string url, string Text, string username)
{
Posts(url, new NameValueCollection { { "username", username }, { "content", Text } });
}
static byte[] Posts(string url, NameValueCollection name)
{
using (WebClient client = new WebClient())
{
return client.UploadValues(url, name);
}
}
}
class Discord
{
public static void SendDiscord(string url, string Text, string username)
{
Posts(url, new NameValueCollection {{ "content", Text } });
}
static byte[] Posts(string url, NameValueCollection name)
{
using (WebClient client = new WebClient())
{
return client.UploadValues(url, name);
}
}
}
}