import { Command , CommandContext , SlashCommandContext , } from "../../base/Command" ; import { MessageEmbed , PermissionResolvable , Permissions } from "discord.js" ; import { formatDateLong , sendReply } from "../../utils/functions" ; export default class BotInfo implements Command { name = "botinfo" ; aliases = [ "info" , "about" ] ; category = "info" ; description = "Displays information about TundraBot." ; usage = "botinfo" ; enabled = true ; slashCommandEnabled = true ; guildOnly = false ; botPermissions : PermissionResolvable [ ] = [ Permissions . FLAGS . EMBED_LINKS ] ; memberPermissions = [ ] ; ownerOnly = false ; premiumOnly = false ; cooldown = 10000 ; slashDescription = "Displays information about TundraBot" ; commandOptions = [ ] ; async execute ( ctx , args ) { const bicon = ctx . client . user . displayAvatarURL ( ) ; const embedMsg = new MessageEmbed ( ) . setDescription ( "Bot Information" ) . setColor ( "#0b7ed6" ) . setThumbnail ( bicon ) . addField ( "Bot name" , ctx . client . user . username ) . addField ( "My owner" , `${ process . env . OWNERNAME }${ process . env . OWNERTAG }` ) . addField ( "Dashboard" , `[Check out my dashboard!](${ process . env . DASHBOARD_URL })` ) . addField ( "Invite link" , `[Invite me to your server!](${ process . env . BOT_INVITE_LINK })` ) . addField ( "Official Discord server" , `[Join my official Discord server!](${ process . env . SUPPORT_SERVER_INVITE_LINK })` ) . addField ( "Source code" , "https://github.com/joshuayuen99/TundraBot" ) . addField ( "Server count" , ctx . client . guilds . cache . size . toString ( ) ) . addField ( "Created at" , formatDateLong ( ctx . client . user . createdAt ) ) ; sendReply ( ctx . client , { embeds : [ embedMsg ] } , ctx . msg ) ; return ; } async slashCommandExecute ( ctx ) { const bicon = ctx . client . user . displayAvatarURL ( ) ; const embedMsg = new MessageEmbed ( ) . setDescription ( "Bot Information" ) . setColor ( "#0b7ed6" ) . setThumbnail ( bicon ) . addField ( "Bot name" , ctx . client . user . username ) . addField ( "My owner" , `${ process . env . OWNERNAME }${ process . env . OWNERTAG }` ) . addField ( "Dashboard" , `[Check out my dashboard!](${ process . env . DASHBOARD_URL })` ) . addField ( "Invite link" , `[Invite me to your server!](${ process . env . BOT_INVITE_LINK })` ) . addField ( "Official Discord server" , `[Join my official Discord server!](${ process . env . SUPPORT_SERVER_INVITE_LINK })` ) . addField ( "Source code" , "https://github.com/joshuayuen99/TundraBot" ) . addField ( "Server count" , ctx . client . guilds . cache . size . toString ( ) ) . addField ( "Created at" , formatDateLong ( ctx . client . user . createdAt ) ) ; ctx . commandInteraction . reply ( { embeds : [ embedMsg ] } ) ; return ; } }