GithubHelp home page GithubHelp logo

mskri / monbot Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 1.15 MB

A library with simple API for creating your own discord bots.

Home Page: https://www.npmjs.com/package/monbot

License: MIT License

JavaScript 6.43% TypeScript 93.57%
discord discord-bot discord-bot-api discord-js

monbot's People

Contributors

dependabot[bot] avatar

Watchers

 avatar

monbot's Issues

Improve the way a command trigger is defined

Thinking of ways to make defining trigger for command easier. If you want to have a trigger that is something like you usually see, e.g. a command prefixed with !, you can use /^!command\s/ as the RegExp. It will match to messages starting with !command (note the space).

However if you want to have the command to trigger when a certain word is present in the message the RegExp becomes a bit more complex. For example triggering command when word hello is matched requires something like /(^|\s+)hello(\s+|$)/. It is more complex because we need to check if the word "hello" is at the start of a message and if not then ensure that there is space before it. The sentence also has to end right after "hello" or have a space afterwards. Without checking the start/end of sentence and spaces around the word writing e.g. "hellopa" or "alehello" would trigger the command.

Couple ideas how to solve this

  • Create helpers that will construct complex RegExp for specific types of triggers, e.g. "single word".
  • Change the trigger to accept different types of triggers. E.g. string could be automatically converted to more complex RegExp to match a single word.

Figure better way to have logs

Currently using pino and pino-pretty for logging out messages. Is there need for them in published version? Should there be a debug config to turn them on/off?

Making pino optional or finding a way to remove it completely and allow user to plug-in whatever logger they want would be great.

Not sure what to do with logs yet.

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.