morganlutz / robin-bot Goto Github PK
View Code? Open in Web Editor NEWA bot to prank your coworkers.
A bot to prank your coworkers.
Instead, show a message such as "No one's on your prank list".
Add an event listener for when a user leaves/joins and update the member list cache by calling BotKitHelper.getMembers(true)
. No need to do anything with the output of the function.
https://github.com/morganlutz/robin-bot/blob/master/utils.js#L42
This should say module.exports
https://github.com/morganlutz/robin-bot/blob/master/botKitHelper.js#L29
Here you can store a reference to RobinBot.prankedUsers[member.name]
within the member
object. That way you can easily access the prank data for that member. To do this you'll need to check if the member is in the prank list, and then you can do something like member.prankData = RobinBot.prankedUsers[member.name]
. Under that return true
and outside the if return false
.
Change Extension and Utils to constants in utils.js. Their values should never change.
This command will list the currently pranked users and who pranked them.
Example output:
Pranked by morgan: raggles, bob
Pranked by raggles: fox
https://github.com/morganlutz/robin-bot/blob/master/app.js#L16
This line should be RobinBot.tokens = {};
https://github.com/morganlutz/robin-bot/blob/master/app.js#L100
Consider using a switch statement and checking for pranked
instead of splitMsg[1]
just once.
e.g.:
if (pranked) {
switch(splitMsg[0]) {
case 'PRANK':
…stuff…
break;
}
…more cases…
default:
…"Holy Try again, that I don't know what to do with the command splitMsg[0]…"
} else {
…"Holy Try again, send an empty message…"
}
Perhaps by passing "all" to the "forgive" command, it'll delete all of the pranked users pranked by the sending user.
When attempting to prank a member that isn't in the channel, you receive a success message, but the user isn't really pranked and won't appear in the pranked
command.
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.