Ejemplo n.º 1
0
        private async Task Client_JoinedGuild(SocketGuild arg)
        {
            Support.Log($"Joined server {arg.Name}");


            return;
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        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}");
            }
        }
Ejemplo n.º 4
0
        private Task Client_LeftGuild(SocketGuild arg)
        {
            Support.Log($"Left server {arg.Name}");

            return(null);
        }