Please describe the problem you are having in as much detail as possible:
If disccord.js is receiving a channel change of a group dm it crashes.
Include a reproducible code sample here, if possible:
Further details:
Here is the traceback:
/home/sorunome/repos/mx-puppet-discord/node_modules/discord.js/src/client/actions/ChannelUpdate.js:42
const newChannel = new channelClass(channel.guild, data);
^
TypeError: channelClass is not a constructor
at ChannelUpdateAction.handle (/home/sorunome/repos/mx-puppet-discord/node_modules/discord.js/src/client/actions/ChannelUpdate.js:42:28)
at ChannelUpdateHandler.handle (/home/sorunome/repos/mx-puppet-discord/node_modules/discord.js/src/client/websocket/packets/handlers/ChannelUpdate.js:7:34)
at WebSocketPacketManager.handle (/home/sorunome/repos/mx-puppet-discord/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:105:65)
at WebSocketConnection.onPacket (/home/sorunome/repos/mx-puppet-discord/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (/home/sorunome/repos/mx-puppet-discord/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
at WebSocket.onMessage (/home/sorunome/repos/mx-puppet-discord/node_modules/ws/lib/event-target.js:120:16)
at WebSocket.emit (events.js:305:20)
at Receiver.receiverOnMessage (/home/sorunome/repos/mx-puppet-discord/node_modules/ws/lib/websocket.js:789:20)
at Receiver.emit (events.js:305:20)
at Receiver.dataMessage (/home/sorunome/repos/mx-puppet-discord/node_modules/ws/lib/receiver.js:422:14)
at Receiver.getData (/home/sorunome/repos/mx-puppet-discord/node_modules/ws/lib/receiver.js:352:17)
at Receiver.startLoop (/home/sorunome/repos/mx-puppet-discord/node_modules/ws/lib/receiver.js:138:22)
at Receiver._write (/home/sorunome/repos/mx-puppet-discord/node_modules/ws/lib/receiver.js:74:10)
at doWrite (_stream_writable.js:464:12)
at writeOrBuffer (_stream_writable.js:446:5)
at Receiver.Writable.write (_stream_writable.js:326:11)
at TLSSocket.socketOnData (/home/sorunome/repos/mx-puppet-discord/node_modules/ws/lib/websocket.js:864:35)
at TLSSocket.emit (events.js:305:20)
at addChunk (_stream_readable.js:341:12)
at readableAddChunk (_stream_readable.js:316:11)
at TLSSocket.Readable.push (_stream_readable.js:250:10)
at TLSWrap.onStreamRead (internal/stream_base_commons.js:186:23)
As you pointed out this bug is caused by a change in a group DM channel.
Bots do not have access to group DM channels.
Please stop logging in with a user token, discord does not allow this as per Terms of Service and previous statements, discord.js will not cater to any bugs or new feature requests concerning selfbots for this reason.
Discords stance on automated user accounts ("self-bots"):
"Discord's API provides a separate type of user account dedicated to automation, called a bot account. Bot accounts can be created through the applications page, and are authenticated using a token (rather than a username and password). Unlike the normal OAuth2 flow, bot accounts have full access to all API routes without using bearer tokens, and can connect to the Real Time Gateway.
__Automating normal user accounts (generally called "self-bots") outside of the OAuth2/bot API is forbidden, and can result in an account termination if found.__"
- Jaytron (Discord Trust&Safety)
source: https://support.discordapp.com/hc/en-us/articles/115002192352-Automated-user-accounts-self-bots-
Actually, discord kinda does support that for bots
Unless discord changed the behavior of this feature set (meant for game bridge) very gravely the bot does never enter the DM channel in this procedure, it merely joins people to it using their access token / removes them from it.
Thus the bot should never be inside one of these channels, will never get an update for it and never encounter this issue.
If i'm mistaken feel free to correct me, of course, I did however have multiple lengthy conversations about this feature set with various people from the discord API, to which the outcome is what i explained above.
Most helpful comment
As you pointed out this bug is caused by a change in a group DM channel.
Bots do not have access to group DM channels.
Please stop logging in with a user token, discord does not allow this as per Terms of Service and previous statements, discord.js will not cater to any bugs or new feature requests concerning selfbots for this reason.
Discords stance on automated user accounts ("self-bots"):
"Discord's API provides a separate type of user account dedicated to automation, called a bot account. Bot accounts can be created through the applications page, and are authenticated using a token (rather than a username and password). Unlike the normal OAuth2 flow, bot accounts have full access to all API routes without using bearer tokens, and can connect to the Real Time Gateway.
__Automating normal user accounts (generally called "self-bots") outside of the OAuth2/bot API is forbidden, and can result in an account termination if found.__"
- Jaytron (Discord Trust&Safety)
source: https://support.discordapp.com/hc/en-us/articles/115002192352-Automated-user-accounts-self-bots-