Skip to content
GitHub

respond

function in meocord/common Since 4.1.0

respond(interaction: Interaction): ResponseState

The 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

NameTypeDescription
interactionInteraction

A command, component or modal submission.

Returns

ResponseState

The interaction's response state.

Examples

TypeScript
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] })
}