Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Discord;
- using System;
- using System.Text;
- using System.Threading.Tasks;
- namespace FishingBot
- {
- class Program
- {
- public static DiscordClient client;
- static void Main(string[] args)
- {
- Console.Title = "Fishing Bot";
- var login = GetLogin();
- Console.Clear();
- Console.WriteLine("Connecting to server...");
- client = new DiscordClient();
- client.Ready += Client_Ready;
- client.Connect(login.Item1, login.Item2);
- for (;;) { Console.ReadKey(); }
- }
- private static void Client_Ready(object sender, EventArgs e)
- {
- Console.Clear();
- Console.WriteLine("Bot connected to server!");
- Fish();
- }
- private async static void Fish()
- {
- var msg = await client.GetChannel(254644234156638208).SendMessage("t!fish");
- await Task.Delay(1000).ContinueWith((o) => msg.Delete());
- await Task.Delay(30000).ContinueWith(((o) => Fish()));
- }
- public static Tuple<string, string> GetLogin()
- {
- Console.Write("Email: ");
- var username = Console.ReadLine();
- Console.Write("Password: ");
- var password = GetPassword();
- return new Tuple<string, string>(username, password.ToString());
- }
- public static string GetPassword()
- {
- var pwd = new StringBuilder();
- while (true)
- {
- ConsoleKeyInfo i = Console.ReadKey(true);
- if (i.Key == ConsoleKey.Enter)
- {
- break;
- }
- else if (i.Key == ConsoleKey.Backspace)
- {
- if (pwd.Length > 0)
- {
- pwd.Remove(pwd.Length - 1, 1);
- Console.Write("\b \b");
- }
- }
- else
- {
- pwd.Append(i.KeyChar);
- Console.Write("*");
- }
- }
- return pwd.ToString();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement