/// <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(); }
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; }
public DiscordMember() { user = new DiscordUser(); }