Browse Source

Fix not listening to messages if another user was mentioned

ghorsington 5 years ago
parent
commit
4503032c85
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/main.ts

+ 2 - 2
src/main.ts

@@ -54,9 +54,9 @@ client.on("message", async m => {
     if (await trigger(msgActions, m, content))
         return;
 
-    if (m.mentions.users.size > 0 && m.mentions.users.first().id == client.user.id) {
+    if (m.mentions.users.size > 0 && m.mentions.users.has(client.user.id)) {
 
-        if (content.startsWith(`@${client.user.username}`)) {
+        if (m.content.trim().startsWith(client.user.toString())) {
             content = content.substring(`@${client.user.username}`.length).trim();
 
             let lowerCaseContent = content.toLowerCase();