See #15 for more information.
Note: this package is mainly for my own use, but it might be useful if you use as needed
By using this package, both ComamndInteraction
and Message
will be resolved as unified CommandMessage
and you can code with CommandMessage
with no considering the way the command passed.
Therefore you can support Message-based-command and Interaction-based-command at once, without any verbose codes.
- Quick example to handle commands
- Create embed by using EmbedBuilder
- Create message components by using MessageComponentBuilder
Represence the message or interaction that includes command.
-
createFromMessage(message: Message<TextChannel>, prefixLength?: number)
Resolves message to CommandMessage.- Return:
CommandMesasge
- Return:
-
createFromInteraction(interaction: CommandInteraction<TextableChannel>)
Resolves message to CommandMessage.- Return:
CommandMesasge
- Return:
-
reply(options: MessageOptions)
Reply to the user.- Return:
ResponseMessage
- Return:
Represence the message that is the reply to the CommandMessage.
edit(options: MessageContent)
Edit the response message.- Return: Promise<
ResponseMessage
>
- Return: Promise<
... and so on...
You can see the full api document here.