![tea.xyz Spam Plagues npm and RubyGems Package Registries](https://cdn.sanity.io/images/cgdhsj6q/production/a74d1072ff2bb5cb96a404be58a649931ced2ba5-1024x1024.webp?w=800&fit=max&auto=format)
Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@danreeves/helper-bot
Advanced tools
A framework around [Discord.js](https://discord.js.org) for implementing simple bot behaviour in bite-sized chunks.
Readme
A framework around Discord.js for implementing simple bot behaviour in bite-sized chunks.
Check out index.js
to see how it works ✨. It's really quite simple, so it might be better to read example.js
and the provided middlewares to see how to use it.
const HelperBot = require('@danreeves/helper-bot')
const bot = new HelperBot(process.env.DISCORD_BOT_TOKEN)
bot.use(new Middleware())
bot.start()
new HelperBot(DISCORD_BOT_TOKEN: string)
The constructor takes the Discord bot token as an argument and returns an instance.
.use
.use(middleware: HelperBotMiddleware)
Add a new middleware to the HelperBot instance. See the Middleware API
.start
.start()
Logs the bot into Discord and begins listening for events.
A HelperBot middleware is an object that can implement any of the following methods:
userJoin
userJoin(guildMember, state, kill)
Called when a member joins a server.
See Discord.js docs
message
message(message, state, kill)
Called when a message is recieved.
See Discord.js docs
reactionAdd
reactionAdd(reaction, user, state, kill)
Called when a reaction is added to a message.
See Discord.js docs
reactionRemove
reactionRemove(reaction, user, state, kill)
Called when a reaction is removed from a message.
See Discord.js docs
voiceStateUpdate
voiceStateUpdate(oldUser, newUser)
Called whenever a user changes voice state - e.g. joins/leaves a channel, mutes/unmutes.
See Discord.js docs
The last two arguments to a middleware method are always state
and kill
.
state
is a mutable object that is passed to every middleware in the chain. This lets you pass state down to preceding middleware.
kill
is a function that when called will end the middleware chain and prevent preceding middleware from being triggered.
FAQs
A framework around [Discord.js](https://discord.js.org) for implementing simple bot behaviour in bite-sized chunks.
The npm package @danreeves/helper-bot receives a total of 1 weekly downloads. As such, @danreeves/helper-bot popularity was classified as not popular.
We found that @danreeves/helper-bot demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.