import { ApplicationCommandOptionType } from 'discord-api-types/v9' ; import { ApplicationCommandData , CommandInteraction , MessageEmbed , PermissionString , } from 'discord.js' ; import { Command , CommandDeferType } from '.' ; import { EventData } from '../models/internal-models' ; import { Lang } from '../services' ; import { MessageUtils } from '../utils' ; export class LinkCommand implements Command { public metadata : ApplicationCommandData = { name : Lang . getCom ( 'commands.link' ) , description : Lang . getRef ( 'commandDescs.link' , Lang . Default ) , options : [ { name : Lang . getCom ( 'arguments.link' ) , description : 'Link to display.' , required : true , type : ApplicationCommandOptionType . String . valueOf ( ) , choices : [ { name : 'docs' , value : 'docs' , } , { name : 'donate' , value : 'donate' , } , { name : 'invite' , value : 'invite' , } , { name : 'support' , value : 'support' , } , { name : 'vote' , value : 'vote' , } , ] , } , ] , } ; public deferType = CommandDeferType . PUBLIC ; public requireDev = false ; public requireGuild = false ; public requireClientPerms : PermissionString [ ] = [ ] ; public requireUserPerms : PermissionString [ ] = [ ] ; public async execute ( intr , data ) { let link = intr . options . getString ( 'link' ) ; let embed ; switch ( link ) { case 'docs' : { embed = Lang . getEmbed ( 'displayEmbeds.linkDocs' , data . lang ( ) ) ; break ; } case 'donate' : { embed = Lang . getEmbed ( 'displayEmbeds.linkDonate' , data . lang ( ) ) ; break ; } case 'invite' : { embed = Lang . getEmbed ( 'displayEmbeds.linkInvite' , data . lang ( ) ) ; break ; } case 'support' : { embed = Lang . getEmbed ( 'displayEmbeds.linkSupport' , data . lang ( ) ) ; break ; } case 'vote' : { embed = Lang . getEmbed ( 'displayEmbeds.linkVote' , data . lang ( ) ) ; break ; } default : { return ; } } await MessageUtils . sendIntr ( intr , embed ) ; } }