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

Can't restart bot without delete everything #166

Closed N3OG closed 10 months ago

N3OG commented 10 months ago

Describe the bug After first install, it crashes after 4-5 hours. Now i cant start with node . I have to remove the settings file from storage - rm storage/settings sometimes i must delete everything. rm -r storage/* Now i can start with node . again, but must deploy all informations again.

Expected behavior Just start the bot :)

Logs Infos from logs.txt

{"level":30,"time":1699342944739,"pid":743,"hostname":"WhatsAppToDiscord","version":"v0.10.18","msg":"Starting"}
{"level":30,"time":1699342944744,"pid":743,"hostname":"WhatsAppToDiscord","version":"v0.10.18","msg":"Update checked."}
{"level":30,"time":1699342944744,"pid":743,"hostname":"WhatsAppToDiscord","version":"v0.10.18","msg":"Conversion completed."}
{"level":30,"time":1699342944750,"pid":743,"hostname":"WhatsAppToDiscord","version":"v0.10.18","msg":"Loaded settings."}
{"level":30,"time":1699342944750,"pid":743,"hostname":"WhatsAppToDiscord","version":"v0.10.18","msg":"Changed auto save interval."}
{"level":30,"time":1699342944752,"pid":743,"hostname":"WhatsAppToDiscord","version":"v0.10.18","msg":"Loaded contacts."}
{"level":30,"time":1699342944754,"pid":743,"hostname":"WhatsAppToDiscord","version":"v0.10.18","msg":"Loaded chats."}
{"level":30,"time":1699342944755,"pid":743,"hostname":"WhatsAppToDiscord","version":"v0.10.18","msg":"Loaded last messages."}
{"level":30,"time":1699342945573,"pid":743,"hostname":"WhatsAppToDiscord","version":"v0.10.18","msg":"Discord client started."}
{"level":50,"time":1699342946137,"pid":743,"hostname":"WhatsAppToDiscord","version":"v0.10.18","err":{"type":"DiscordAPIError","message":"Missing Access","stack":"DiscordAPIError: Missing Access at RequestHandler.execute (/WhatsAppToDiscord/node_modules/discord.js/src/rest/RequestHandler.js:350:13) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async RequestHandler.push (/WhatsAppToDiscord/node_modules/discord.js/src/rest/RequestHandler.js:51:14) at async GuildChannelManager.edit (/WhatsAppToDiscord/node_modules/discord.js/src/managers/GuildChannelManager.js:316:21) at async Object.repairChannels (/WhatsAppToDiscord/src/utils.js:362:5) at async /WhatsAppToDiscord/src/index.js:54:3","name":"DiscordAPIError","method":"patch","path":"/channels/[censored]","code":50001,"httpStatus":403,"requestData":{"json":{"name":"control-room","parent_id":"[censored]"},"files":[]}},"msg":"Missing Access"}
{"level":30,"time":1699342946138,"pid":743,"hostname":"WhatsAppToDiscord","version":"v0.10.18","msg":"Exiting!"}

Platform

FKLC commented 10 months ago

The error happens during the repairing channels stage and it seems like the bot doesn't have necessary permissions. Are you sure the bot has manage channels permission?

N3OG commented 10 months ago

Yeah, sry, my fault. I thougt the bot have the permissions after invite.