Beispiel #1
0
        internal static RestApplicationCommand Create(BaseDiscordClient client, Model model, RestApplicationCommandType type, ulong guildId = 0)
        {
            if (type == RestApplicationCommandType.GlobalCommand)
            {
                return(RestGlobalCommand.Create(client, model));
            }

            if (type == RestApplicationCommandType.GuildCommand)
            {
                return(RestGuildCommand.Create(client, model, guildId));
            }

            return(null);
        }
Beispiel #2
0
 internal static RestApplicationCommand Create(BaseDiscordClient client, Model model, RestApplicationCommandType type, ulong guildId = 0)
 {
     return(type switch
     {
         RestApplicationCommandType.GlobalCommand => RestGlobalCommand.Create(client, model),
         RestApplicationCommandType.GuildCommand => RestGuildCommand.Create(client, model, guildId),
         _ => null
     });