commands are case sensitive #17

Open
opened 2019-09-06 16:36:39 +02:00 by tzarebczan · 1 comment
tzarebczan commented 2019-09-06 16:36:39 +02:00 (Migrated from github.com)
see https://twitter.com/GhostsAncestral/status/1169974922703069185
GlobalGamer2015 commented 2021-09-11 06:03:33 +02:00 (Migrated from github.com)

Not sure if this has been fixed @tzarebczan but the following code should fix the case sensitive issue in index.js.

function checkTweet(tweet, msg) { switch (msg[1].toLowerCase()) { case "help": doHelp(tweet, msg); break; case "balance": doBalance(tweet, msg); break; case "deposit": doDeposit(tweet, msg); break; case "withdraw": doWithdraw(tweet, msg); break; case "tip": doTip(tweet, msg); break; case "terms": doTerms(tweet, msg); break; case "lbryian": logger.info("Got a command with the old format, handling it..."); checkTweet(tweet, msg.splice(1)); break; } }

Added .toLowerCase() to switch (msg[1]) {

Not sure if this has been fixed @tzarebczan but the following code should fix the case sensitive issue in [index.js](https://github.com/lbryio/twitter-tipbot/blob/master/index.js). `function checkTweet(tweet, msg) { switch (msg[1].toLowerCase()) { case "help": doHelp(tweet, msg); break; case "balance": doBalance(tweet, msg); break; case "deposit": doDeposit(tweet, msg); break; case "withdraw": doWithdraw(tweet, msg); break; case "tip": doTip(tweet, msg); break; case "terms": doTerms(tweet, msg); break; case "lbryian": logger.info("Got a command with the old format, handling it..."); checkTweet(tweet, msg.splice(1)); break; } }` Added `.toLowerCase()` to `switch (msg[1]) {`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/twitter-tipbot#17
No description provided.