示例#1
0
        private async Task AddCommands()
        {
            customModule = await commands.CreateModuleAsync("", module =>
            {
                foreach (string entry in songList.Keys)
                {
                    module.AddCommand(entry, SendAuto, cmd =>
                    {
                        cmd.RunMode = RunMode.Async;
                    });
                }

                module.AddCommand("add", AddSong, cmd =>
                {
                    cmd.AddParameter <string>("command", para =>
                    {
                        para.IsOptional = false;
                    });
                });
                module.Name = "Custom Module";
            });

            Console.WriteLine("DONE LOADING CUSTOM COMMANDS");
        }