Procházet zdrojové kódy

Fix not listening to messages if another user was mentioned

ghorsington před 5 roky
rodič
revize
4503032c85
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  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();