The tipbot for discord
Go to file
ProfessorDey bef28e3e02
Optimise Help Msg & Wrong Channel Warning
This one involves a fair amount of reworking of the way functions operate, all checks for being in private or bot sandbox have been removed from functions and that functionality is now applied through privateOrSandboxOnly(), passing the message, channel warning, function to be called and then an array of arguments, sans message, as that's automatically attached at the head as all primary functions require the message anyway. while this makes each case entry a bit longer, it does reduce code reuse and potential for old code being left in, since each function had to previously be updated individually if something happened with the way these tests were carried out.

I've yet to find a way to allow us to set the export description and the help message in one fell swoop, so for now I've manually set the description. The help message itself is now broken down into pairs of subcommand and description, the subcommand will be indented once, while the description will be indented twice.

The way the help function now works is to allow everything to be set at the start, without needing to hunt all the way down to find the duplicate help message. Now everything can be replaced in the main function, though this will require a bit of computation with each request presently, as I don't know if or how the exported functions can access constants defined outside them. This can be optimised later if need be and at the very least shouldn't slow things down very much with the few entries that there are.

Unfortunately changing the way that the help message works does involve parameterising the help message itself for any function that requires it, but this also provides a helpful indicator of what functions might fail and fall back on the help function.
2018-02-01 10:33:18 +00:00
bot Optimise Help Msg & Wrong Channel Warning 2018-02-01 10:33:18 +00:00
config Tipbot is here! 2017-10-25 21:12:38 +02:00
.babelrc Tipbot is here! 2017-10-25 21:12:38 +02:00
.gitignore Tipbot is here! 2017-10-25 21:12:38 +02:00
LICENSE Create LICENSE 2018-01-25 17:05:02 +01:00
package-lock.json removed ! from IDs 2017-12-25 01:49:45 +01:00
package.json removed ! from IDs 2017-12-25 01:49:45 +01:00
README.md Tipbot is here! 2017-10-25 21:12:38 +02:00
yarn.lock removed trigger on message edits 2017-11-23 01:41:23 +01:00

Bot for LBRY's Discord

(This README will be updated along with bot updates) Features:

  • Tipbot for LBC. Responds to !tip.
  • Dynamic plugin loading with permission support.

Requirements

  • node > 8.0.0
  • npm > 0.12.x

Installation

Create a bot and get the bot's API Token: https://discordapp.com/developers/applications/me

Edit and rename default.json.example in /config, then run:

npm install
node bot.js