internal new static SocketInteraction Create(DiscordSocketClient client, Model model, ISocketMessageChannel channel) { var entity = new SocketMessageCommand(client, model, channel); entity.Update(model); return(entity); }
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 });