zmoin / slapbot Goto Github PK
View Code? Open in Web Editor NEWa bot that slaps people on discord
a bot that slaps people on discord
Currently the bot will accept any string as input for it's slap subject.
Instead it should accept a user @ to get a users data then @ that passed in user in the response.
It appears you can get user mentions through a member on the message object passed into the event callback.
https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=mentions
The project repo currently doesn't have a licence for its code to signify what people may do with the code contents.
Below appears to be a guide on adding a licence
https://help.github.com/en/articles/adding-a-license-to-a-repository
Can find out more by googling software/code licencing. And open source licencing.
As an exploration of use of the whitelist/blacklist. Add more ids to them so that we can better moderate command use.
In addition to the existing blacklist and whitelist, add a third list of key pairs so we can denote permission levels.
example being having Zarrin set as admin being able to use special secret new commands, whereas everyone else is considered a default user who can't use special secret new commands.
Using .slap with two mentions sometimes causes it to use one for both slappee and slapper.
Given that the .first() method uses an iterator behind the scenes, might be best to use something else.
The data structure being used has an .array() method, so it might be best to use that instead to get the array of mentions, and work from there.
I tested it locally, the array method is really messy, and not a viable solution.
Edit: Haven't tested it too thoroughly, but what you've done seems to be a good solution. So this can probably be marked as closed now.
node_modules should be ignored.
We are sorely lacking in commands. Maybe we should have a second?
The instructions are hard to read. Put them on new lines or bullet point them
It is possible to get the bot to leave a react on messages.
https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=react
Get the bot to react to command messages with a thumbs up or smiley face or something.
To further expand on the idea, I've included a package called chance.js you could use this to pick a random emoji.
https://chancejs.com/helpers/pickone.html
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.