コード例 #1
0
        public async Task RegisterCommandsAsync()
        {
            _client.MessageReceived += HandleCommandAsync;
            await _commands.AddModulesAsync(Assembly.GetEntryAssembly());

            //Load pre-existing custom commands if possible
            if (DataStorage.LoadCommandsFromFile())
            {
                foreach (CustomCommand cmd in DataStorage.customCommands)
                {
                    await CommandUtilities.CreatCommandAsync(cmd.commandName, cmd.commandContent, _commands);
                }
            }
        }