FKLC / WhatsAppToDiscord

WhatsAppToDiscord is a Discord bot that uses WhatsApp Web as a bridge between Discord and WhatsApp.
https://fklc.github.io/WhatsAppToDiscord/
MIT License
252 stars 74 forks source link

No Commands Work #102

Closed kiwuthegamer closed 2 years ago

kiwuthegamer commented 2 years ago

All commands result in the bot saying "Unknown command: Type help to see available commands" (Typing "help" also results in the same message)

calbinson commented 2 years ago

I have the same exact issue

lryjnks commented 2 years ago

yeah same here

FKLC commented 2 years ago

can any of you send their logs.txt?

lryjnks commented 2 years ago

I start the server, delete the logs so that there is not too much information inside. As soon as I send the commands I get in Discord only "Unknown command: Type help to see available commands".

The logs are empty.

OS: Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-47-generic x86_64)

lryjnks commented 2 years ago

It does not load the message content

Line 237-240 discord_manager.js

   },
  unknownCommand: async (message) => {
    controlChannel.send(`Unknown command: \`${message.content}\`\nType \`help\` to see available commands`);
  },  

discord

lryjnks commented 2 years ago

logs.txt

´´´ {"level":30,"time":1662699983357,"pid":239006,"hostname":"srvlnx01","msg":"Starting"} {"level":30,"time":1662699983358,"pid":239006,"hostname":"srvlnx01","msg":"Update checked."} {"level":30,"time":1662699983374,"pid":239006,"hostname":"srvlnx01","msg":"Initialized database."} {"level":30,"time":1662699983378,"pid":239006,"hostname":"srvlnx01","msg":"Loaded settings."} {"level":30,"time":1662699983380,"pid":239006,"hostname":"srvlnx01","msg":"Loaded contacts."} {"level":30,"time":1662699983382,"pid":239006,"hostname":"srvlnx01","msg":"Loaded chats."} {"level":30,"time":1662699984124,"pid":239006,"hostname":"srvlnx01","msg":"Discord client started."} {"level":30,"time":1662699984742,"pid":239006,"hostname":"srvlnx01","msg":"Repaired channels."} {"level":30,"time":1662699984854,"pid":239006,"hostname":"srvlnx01","msg":"WhatsApp client started."} {"level":30,"time":1662699984948,"pid":239006,"hostname":"srvlnx01","browser":["Baileys","Chrome","4.0.0"],"helloMsg":{"clientHello":{"ephemeral":"kc51ssu1mspfSY3uTTQiFmuROKkv2uQ4OXempxzulUA="}},"msg":"connected to WA Web"} {"level":30,"time":1662699985017,"pid":239006,"hostname":"srvlnx01","node":{"username":"491745484143","passive":true,"userAgent":{"platform":"WEB","appVersion":{"primary":2,"secondary":2230,"tertiary":15},"mcc":"000","mnc":"000","osVersion":"0.1","manufacturer":"","device":"Desktop","osBuildNumber":"0.1","releaseChannel":"RELEASE","localeLanguageIso6391":"en","localeCountryIso31661Alpha2":"US"},"webInfo":{"webSubPlatform":"WEB_BROWSER"},"connectType":"WIFI_UNKNOWN","connectReason":"USER_ACTIVATED","device":11},"msg":"logging in..."} {"level":30,"time":1662699985450,"pid":239006,"hostname":"srvlnx01","msg":"20 pre-keys found on server"} {"level":30,"time":1662699985489,"pid":239006,"hostname":"srvlnx01","msg":"opened connection to WA"} {"level":30,"time":1662699985643,"pid":239006,"hostname":"srvlnx01","msg":"handled 0 offline messages/notifications"}

´´´

Discord Commands:

image

eduardmolnar commented 2 years ago

I have the same issue, Ubuntu 22.04

KungFuCookie commented 2 years ago

Hey I know discord changed the way commands are handled recently because another bot integration also started to fail.

Can you try using /raw command

lryjnks commented 2 years ago

Hmm.. still not working

image

Heath123 commented 2 years ago

Fix: enable this setting in your bot settings in https://discord.com/developers/applications/ image

FKLC commented 2 years ago

Fix: enable this setting in your bot settings in https://discord.com/developers/applications/ image

This seems like the fix. Thanks for finding it out @Heath123. I also thought about it being about the intents, but looked only at the code. Thanks again. I will update the FAQ shortly, and closing the issue.