private async Task Client_JoinedGuild(SocketGuild arg) { Support.Log($"Joined server {arg.Name}"); return; }
private async Task LoginAsync() { Support.Log($"Logging in as: {this._Credentials.ClientID}..."); await this._Client.LoginAsync(TokenType.Bot, this._Credentials.Token).ConfigureAwait(false); await this._Client.StartAsync().ConfigureAwait(false); await this._Client.SetStatusAsync(UserStatus.Invisible); Support.Log("Successfully logged in!"); this._Client.JoinedGuild += Client_JoinedGuild; this._Client.LeftGuild += Client_LeftGuild; this._Client.ReactionAdded += _SocketClient_ReactionAdded; this._Client.ReactionRemoved += _SocketClient_ReactionRemoved; }
public BotCredentials() { try { JObject credentials = Support.readJsonFile("credentials.json"); this.Token = credentials["token"].ToString(); this.ClientID = credentials["client_id"].ToString(); this.Owners = credentials["owner_ids"].ToObject <ulong[]>(); this.ReactionRoleChannel = Convert.ToUInt64(credentials["reaction_role_channel_id"]); } catch (Exception exc) { Support.Log($"Error in BotCredentials\n{exc.Message}"); } }
private Task Client_LeftGuild(SocketGuild arg) { Support.Log($"Left server {arg.Name}"); return(null); }