Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Interaction

xlyr.on edited this page Jan 22, 2021 · 7 revisions

Interaction

constructor

new Slash.Interaction(client, interaction)
Parameter Type Description required
client Discord Client a discord client true
interaction Slash Interaction a slash interaction true

properties

.client - get discord client
type: object
.config - the bot settings
type: object
.responseType - the InteractionResponseType
type: number

methods

.author() - get command user
returns Promise <guildMember>
.guild() - get guild of command user
returns Promise <guild>
.channel() - get the channel the command was from
returns Promise <channel>
.bot() - gets the bot that handles this command
returns Promise <guildMember>
.sendMessage(content) - sends a message
returns Promise <message>
Parameter Type Description required
content string the string you want to send true
.sendEphemeral(content) - sends an ephemeral(user-visible only) message
returns Promise <message>
Parameter Type Description required
content string the string you want to send true
.sendEmbed(embed) - sends an embed
returns Promise <message>
Parameter Type Description required
embed Discord Embed the embed you want to send true

usage

commandTwo.js
module.exports = new Slash.Command({
  name: 'invisible',
  description: 'sends a hello world message visible to user only',
  permissions: ["SEND_MESSAGES"],
  execute(interaction) {
  
    interaction.sendEphemeral("Hello World")
    
  }
})