respond
function in meocord/common Since 4.1.0
respond(interaction: Interaction): ResponseStateThe response state of an interaction, through which its replies, edits, follow-ups and errors go.
Use it for every answer a handler, a guard, an interceptor, a filter or a collector's callback gives an interaction. There is one per interaction, created on first use.
Parameters
| Name | Type | Description |
|---|---|---|
interaction | Interaction | A command, component or modal submission. |
Returns
ResponseStateThe interaction's response state.
Examples
constructor(private readonly profiles: ProfileService) {}
@Command('profile', CommandType.SLASH)
async profile(interaction: ChatInputCommandInteraction) {
await respond(interaction).acknowledge()
const card = await this.profiles.render(interaction.user.id)
await respond(interaction).send({ embeds: [card] })
}