Пример #1
0
 /// <summary>
 /// Login to Discord using the given email and password.
 /// Only able to recieve messages from channels previously invited to.
 /// </summary>
 /// <param name="email">Email of the account to log into</param>
 /// <param name="pass">Password to the account to log into</param>
 public void Connect(string email, string pass)
 {
     _client.LoginInformation.email[0] = email;
     _client.LoginInformation.password[0] = pass;
     _client.Connected += (sender, e) =>
     {
         _connected = true;
         if (BotConnected != null)
         {
             BotConnected(this, EventArgs.Empty);
         }
         _botUser = _client.Me.user;
     };
     _client.SendLoginRequest();
     _clienThread = new Thread(_client.ConnectAndReadMessages);
     _clienThread.Start();
 }
Пример #2
0
 private bool AuthorizeComm(string args, DiscordMessage from)
 {
     if (args == "password" && _admin == null)
     {
         _admin = from.author.user;
         SendMessage(
             "Successfully set " + _admin.username +
             " as my local admin. Password invalidated", from.channel);
     }
     else
     {
         SendMessage("Invalid login credentials. Please copy code from my console.", from.channel);
     }
     return true;
 }
Пример #3
0
 public DiscordMember()
 {
     user = new DiscordUser();
 }