@mtripg6666tdr/oceanic-command-resolver
TypeScript icon, indicating that this package has built-in type declarations

1.4.2 • Public • Published

Note: this package is mainly for my own use, but it might be useful if you use as needed

oceanic-command-resolver

npm

Making a bot for Discord sometimes makes us feel it is difficult now, after the birth of slash-commands and other components.
However, all interaction emitted by those will be finally a Message, so all messages, command-interactions and components-interactions can be seen as some kind of "command", sent by users. This package was born from and based on this theory.

This package will resolve all of ComamndInteraction, ComponentInteraction and Message as unified CommandMessage and you can code with CommandMessage with no considering the way the command was passed.
oceanic-command-resolver-graph

Therefore you can support Message-based-command, Component-based-command, and Interaction-based-command at once, without any redundant codes.

Examples

API

Represence the message or interaction that includes command.

  • createFromMessage(message: Message<TextChannel>, prefixLength?: number)
    Resolves message to CommandMessage.

  • createFromInteraction(interaction: CommandInteraction<TextableChannel>)
    Resolves message to CommandMessage.

  • reply(options: MessageOptions)
    Reply to the user.

Represence the message that is the reply to the CommandMessage.

  • edit(options: MessageContent)
    Edit the response message.

... and so on...

You can see the full api document here.

Versions

oceanic-command-resolver oceanic.js
>=1.0.0 <1.2.0 >=1.5.0 <1.7.0
^1.2.0 >=1.7.0 <1.8.0
^1.3.0 >=1.8.0 <1.9.0
^1.4.0 >=1.9.0 <1.12.0

As of Jun 16, 2024

License

LICENSE

Readme

Keywords

none

Package Sidebar

Install

npm i @mtripg6666tdr/oceanic-command-resolver

Weekly Downloads

49

Version

1.4.2

License

MIT

Unpacked Size

65.5 kB

Total Files

35

Last publish

Collaborators

  • mtripg6666tdr