Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Discord auto channel create fails and crashes the app #469

Open
glensc opened this issue Oct 6, 2020 · 3 comments
Open

Discord auto channel create fails and crashes the app #469

glensc opened this issue Oct 6, 2020 · 3 comments

Comments

@glensc
Copy link
Contributor

glensc commented Oct 6, 2020

TL;DR: the problem summary is in this post:


Original bug report:

Somewhat related to #465

  1. I followed the docs and used config generator
  2. At some point there was link in logs pointing to oauth2 and app exiting
miscord_1  | 2020-10-06T14:47:08.940654900Z   START   14:47:08  ›  Launching Miscord v5.0.4
miscord_1  | 2020-10-06T14:47:08.941066800Z   START   14:47:08 login ›  Logging in...
miscord_1  | 2020-10-06T14:47:08.942629200Z   INFO    14:47:08 login › logLevel 'info'
miscord_1  | 2020-10-06T14:47:08.943364100Z   START   14:47:08 discord › login ›  Logging in to Discord...
miscord_1  | 2020-10-06T14:47:09.684757200Z  SUCCESS  14:47:09 discord › login ›  Logged in to Discord
miscord_1  | 2020-10-06T14:47:09.694614300Z   ERROR   14:47:09 errorHandler ›  Error: No guilds added!
miscord_1  | 2020-10-06T14:47:09.694715500Z   ERROR   14:47:09 errorHandler ›  You can add a bot to your guild here:
miscord_1  | 2020-10-06T14:47:09.694740700Z   ERROR   14:47:09 errorHandler ›  https://discordapp.com/api/oauth2/authorize?client_id=*omitted*&permissions=537390096&scope=bot
miscord_1  | 2020-10-06T14:47:09.694769500Z   ERROR   14:47:09 errorHandler ›  It's not an error... unless you added the bot to your guild already.
miscord_1  | 2020-10-06T14:47:09.694796600Z   ERROR   14:47:09 errorHandler ›      at /usr/local/lib/node_modules/miscord/dist/discord/login.js:33:19
miscord_1  | 2020-10-06T14:47:09.694823700Z   ERROR   14:47:09 errorHandler ›      at processTicksAndRejections (internal/process/task_queues.js:97:5)
miscord_1  | 2020-10-06T14:47:09.724703900Z   INFO    14:47:09  ›  Worker process 12 died (1, null).
miscord_1  | 2020-10-06T14:47:09.724749800Z   FATAL   14:47:09  ›  Logging in failed, exiting.
  1. I followed the link and role and bot was created without issues
  2. continued to add FB and discord apps
  3. sync from discord to messenger works okay
  4. sync from messenger to discord ends up with permission error
miscord_1  | 2020-10-06T16:12:30.075250200Z   INFO    16:12:30 messenger › listener ›  Got a Messenger message
miscord_1  | 2020-10-06T16:12:30.209263900Z (node:35) DeprecationWarning: Guild#createChannel: Create channels with an options object instead of separate parameters
miscord_1  | 2020-10-06T16:12:30.707264900Z This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
miscord_1  | 2020-10-06T16:12:30.707798200Z DiscordAPIError: Missing Permissions
miscord_1  | 2020-10-06T16:12:30.708005100Z     at /usr/local/lib/node_modules/miscord/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:85:15
miscord_1  | 2020-10-06T16:12:30.708409700Z     at /usr/local/lib/node_modules/miscord/node_modules/snekfetch/src/index.js:215:21
miscord_1  | 2020-10-06T16:12:30.708556900Z     at processTicksAndRejections (internal/process/task_queues.js:97:5)
miscord_1  | 2020-10-06T16:12:30.728467200Z   ERROR   16:12:30 errorHandler ›  DiscordAPIError: Missing Permissions
miscord_1  | 2020-10-06T16:12:30.728676800Z   ERROR   16:12:30 errorHandler ›      at /usr/local/lib/node_modules/miscord/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:85:15
miscord_1  | 2020-10-06T16:12:30.728723600Z   ERROR   16:12:30 errorHandler ›      at /usr/local/lib/node_modules/miscord/node_modules/snekfetch/src/index.js:215:21
miscord_1  | 2020-10-06T16:12:30.728768000Z   ERROR   16:12:30 errorHandler ›      at processTicksAndRejections (internal/process/task_queues.js:97:5) {
miscord_1  | 2020-10-06T16:12:30.728809100Z   ERROR   16:12:30 errorHandler ›    name: 'DiscordAPIError',
miscord_1  | 2020-10-06T16:12:30.728833700Z   ERROR   16:12:30 errorHandler ›    message: 'Missing Permissions',
miscord_1  | 2020-10-06T16:12:30.728869100Z   ERROR   16:12:30 errorHandler ›    path: '/api/v7/channels/*omitted*/permissions/*omitted*',
miscord_1  | 2020-10-06T16:12:30.728910400Z   ERROR   16:12:30 errorHandler ›    code: 50013,
miscord_1  | 2020-10-06T16:12:30.728942000Z   ERROR   16:12:30 errorHandler ›    method: 'PUT'
miscord_1  | 2020-10-06T16:12:30.728991500Z   ERROR   16:12:30 errorHandler ›  }
miscord_1  | 2020-10-06T16:12:31.017753600Z   INFO    16:12:31  ›  Worker process 35 died (2, null).

When I look at role created in my server, it seems to have all usable permissions for writing to a chat:

image

@glensc
Copy link
Contributor Author

glensc commented Oct 6, 2020

I've also enabled the option to create discord channels for matching FB chats, and it creates new chat for each FB message it receives, with exactly the same title

image

@glensc
Copy link
Contributor Author

glensc commented Oct 6, 2020

I think the problem is with this message:

miscord_1 | 2020-10-06T16:12:30.209263900Z (node:35) DeprecationWarning: Guild#createChannel: Create channels with an options object instead of separate parameters

Creating a channel ends up with an application crash and it never manages that for to add message to discord server.

@glensc
Copy link
Contributor Author

glensc commented Oct 6, 2020

In other words, disabling "createChannels", sync to discord works, just with only pre-defined channels.

@glensc glensc changed the title Write to Discord ends up with an permission error Discord auto channel create fails and crashes the app Oct 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant