mskri / monbot Goto Github PK
View Code? Open in Web Editor NEWA library with simple API for creating your own discord bots.
Home Page: https://www.npmjs.com/package/monbot
License: MIT License
A library with simple API for creating your own discord bots.
Home Page: https://www.npmjs.com/package/monbot
License: MIT License
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
string
could be automatically converted to more complex RegExp to match a single word.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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.