Dispatch
Dispatch is the decorator that let you handle your interactions.
Example
const { ButtonStyles, Command, ComponentTypes, Dispatch, Maker } = require("erine");
class Interactions extends Maker {
@Command({ name: 'button', slash: false })
async button(ctx) {
await ctx.send({
content: 'original',
components: [{
type: ComponentTypes.ACTION_ROW,
components: [{
type: ComponentTypes.BUTTON,
label: 'Hi uwu',
customID: 'buttonResponse',
style: ButtonStyles.PRIMARY
}]
}]
})
}
@Dispatch
async buttonResponse(interaction) {
await interaction.editParent({ content: 'edited', components: [] })
}
}
module.exports = { data: Interactions };