internal new static SocketInteraction Create(DiscordSocketClient client, Model model, ISocketMessageChannel channel, SocketUser user)
        {
            var entity = new SocketSlashCommand(client, model, channel, user);

            entity.Update(model);
            return(entity);
        }
Beispiel #2
0
        internal static SocketInteraction Create(DiscordSocketClient client, Model model, ISocketMessageChannel channel)
        {
            if (model.Type == InteractionType.ApplicationCommand)
            {
                var dataModel = model.Data.IsSpecified
                    ? (DataModel)model.Data.Value
                    : null;

                if (dataModel == null)
                {
                    return(null);
                }

                return(dataModel.Type switch
                {
                    ApplicationCommandType.Slash => SocketSlashCommand.Create(client, model, channel),
                    ApplicationCommandType.Message => SocketMessageCommand.Create(client, model, channel),
                    ApplicationCommandType.User => SocketUserCommand.Create(client, model, channel),
                    _ => null
                });