Skip to content

Commit

Permalink
Merge pull request #9 from SayakMukhopadhyay/wip
Browse files Browse the repository at this point in the history
 Fixed commands not accepted when the bot is given a nickname
  • Loading branch information
SayakMukhopadhyay authored Nov 10, 2017
2 parents 3cb2687 + f9b6bb3 commit d460863
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bgsbot",
"version": "1.1.2",
"version": "1.1.3",
"license": "Apache-2.0",
"scripts": {
"start": "gulp scripts && cross-env PORT=4002 pm2 start process.json --env production",
Expand Down
2 changes: 1 addition & 1 deletion src/modules/discord/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class DiscordClient {
return false;
}
}).length > 0) {
let messageString = message.content.replace(this.client.user.toString(), "").replace(/\s+/g, ' ').trim();
let messageString = message.content.replace(new RegExp(`<@!?${this.client.user.id}>`), "").replace(/\s+/g, ' ').trim();
let messageArray = messageString.split(" ");
let command = messageArray[0].toLowerCase();
let commandArguments: string = "";
Expand Down

0 comments on commit d460863

Please sign in to comment.