Giter VIP home page Giter VIP logo

oceanic-command-resolver's Introduction

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.3.0 >=1.7.0 <1.8.0
>=1.3.0 <1.4.0 >=1.8.0 <1.9.0
>=1.4.0 <1.5.0 >=1.9.0 <1.11.0

As of Mar 19, 2024

License

LICENSE

oceanic-command-resolver's People

Contributors

mtripg6666tdr avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.