コード例 #1
0
        public override async Task Enable()
        {
            this.dClient.GuildAvailable += this.OnGuildAvailable;
            this.dClient.SocketOpened   += this.OnSocketOpened;
            this.dClient.SocketClosed   += this.OnSocketClosed;
            this.dClient.SocketErrored  += this.OnSocketErrored;
            this.dClient.Ready          += this.OnReady;

            this.cNext.CommandErrored  += this.OnCommandErroredAsync;
            this.cNext.CommandExecuted += this.OnCommandExecuted;

            this.slash.SlashCommandExecuted += this.OnSlashCommandExecuted;
            this.slash.SlashCommandErrored  += this.OnSlashCommandErrored;
            this.slash.ContextMenuErrored   += this.OnContextMenuErrored;

            this.cNext.RegisterCommands <GeneralCommands>();
            this.slash.RegisterCommands <GeneralSlashCommands>(Guilds.SBG);
            this.cNext.RegisterCommands <OwnerCommands>();

            await this.dClient.InitializeAsync();

            VariableManager.ApplyVariableScopes(this.dClient);
            await this.dClient.ConnectAsync();
        }