-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added phrase return to @gaming_bot #1
base: master
Are you sure you want to change the base?
Conversation
untested
@@ -122,11 +122,20 @@ const deregisterHandler = async (client, msg) => { | |||
} | |||
}; | |||
|
|||
const chatHandler = (client, text) => { | |||
fs.readFile(../chatbot/phraselist.txt, function(err, data){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File path is not in a string. This will break
@@ -122,11 +122,20 @@ const deregisterHandler = async (client, msg) => { | |||
} | |||
}; | |||
|
|||
const chatHandler = (client, text) => { | |||
fs.readFile(../chatbot/phraselist.txt, function(err, data){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IF I EVER SEE ANOTHER ANONYMOUS FUNCTION THAT ISN'T AN ARROW FUNCTION YOU ARE BANNED
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const handlerMap = { | ||
".help": helpHandler, | ||
".register": registerHandler, | ||
".deregister": deregisterHandler, | ||
".recognized-command": crawlRequestHandler, | ||
"@gaming_bot": chatHandler, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I'd prefer all commands that the gamingbot recognizes to begin with the same special character, for continuity.
@@ -122,11 +122,20 @@ const deregisterHandler = async (client, msg) => { | |||
} | |||
}; | |||
|
|||
const chatHandler = (client, text) => { | |||
fs.readFile(../chatbot/phraselist.txt, function(err, data){ | |||
var lines = data.split('\n'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are lots of issues with using the keyword var
. Use let
for variables you will reassign (in the manner of let lines; lines = somethingNew;
. Use const
for variables you do not plan to reassign.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mass murder of gamers | ||
execute a gamer save a life | ||
make gaming a felony | ||
An amateur programmer that will steal your code and call it his own |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between phraselist
and phraselist.txt
? Only one is probably needed?
untested