Пример #1
0
        static void Main()
        {
            UpdateTitle();

            OpenFileDialog dialog = new OpenFileDialog()
            {
                Filter           = "Text file |*.txt",
                Title            = "Choose a file to load tokens from",
                InitialDirectory = new FileInfo(Application.ExecutablePath).DirectoryName
            };

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                Raidbot.TokenPath = dialog.FileName;
                Raidbot.LoadClients(File.ReadAllLines(dialog.FileName));
            }

            while (true)
            {
                CommandHandler.ShowActions();
                Console.WriteLine();
                Console.Write("Action: ");
                CommandHandler.HandleCommand(int.Parse(Console.ReadLine()));
            }
        }
Пример #2
0
        public static void HandleCommand(int type)
        {
            switch (type)
            {
            case 1:
                Console.Write("Invite: ");
                string invite = Console.ReadLine().Replace("https://discord.gg/", "");
                Console.Clear();
                Raidbot.MassJoin(invite);
                Console.Clear();
                break;

            case 2:
                Console.Write("Server ID: ");
                long guildId = long.Parse(Console.ReadLine());
                Console.Clear();
                Raidbot.MassLeave(guildId);
                Console.Clear();
                break;

            case 3:
                Console.Write("Channel ID: ");
                long channelId = long.Parse(Console.ReadLine());
                Console.Write("Message: ");
                string msg = Console.ReadLine();
                Console.Write("Add ascii? (Y/N): ");
                bool addAscii = Console.ReadLine().ToLower() == "y";
                Console.Clear();
                Raidbot.Flood(channelId, msg, addAscii);
                Console.Clear();
                break;

            case 4:
                Console.Write("User: "******"Unknown action");
                break;
            }
        }