示例#1
0
        private Task OnReady(DiscordClient sender, ReadyEventArgs e)
        {
            var commands = _commandManager.BuildCommands().ToList();

            _commandHandler.AddCommands(commands);

            // TODO: Implement better system
            var guildId = _environment.IsDevelopment()
                ? UrfRidersGuilds.Dev
                : UrfRidersGuilds.Main;

            var discordCommands = DiscordApplicationCommandHelper.FromSlashCommands(commands);

            _client.BulkOverwriteGuildApplicationCommandsAsync(guildId, discordCommands);

            return(Task.CompletedTask);
        }