thread.members._add is not a function

[UnhandledPromise] TypeError: thread.members._add is not a functionPromise {
<rejected> TypeError: thread.members._add is not a function
at /app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js:17:95
at Array.reduce (<anonymous>)
at ThreadMembersUpdateAction.handle (/app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js:16:27)
at module.exports [as THREAD_MEMBERS_UPDATE] (/app/node_modules/discord.js/src/client/websocket/handlers/THREAD_MEMBERS_UPDATE.js:4:38)
at WebSocketManager.handlePacket (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:355:31)
at WebSocketManager.<anonymous> (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:239:12)
at WebSocketManager.emit (/app/node_modules/@vladfrangu/async_event_emitter/dist/index.cjs:282:31)
at WebSocketShard.<anonymous> (/app/node_modules/@discordjs/ws/dist/index.js:1190:51)
at WebSocketShard.emit (/app/node_modules/@vladfrangu/async_event_emitter/dist/index.cjs:282:31)
at WebSocketShard.onMessage (/app/node_modules/@discordjs/ws/dist/index.js:1005:14) {
[stack]: [Getter/Setter: 'TypeError: thread.members._add is not a function\n' +
' at /app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js:17:95\n' +
' at Array.reduce (<anonymous>)\n' +
' at ThreadMembersUpdateAction.'... 838 more characters],
[message]: 'thread.members._add is not a function'
}
}
[UnhandledPromise] TypeError: thread.members._add is not a functionPromise {
<rejected> TypeError: thread.members._add is not a function
at /app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js:17:95
at Array.reduce (<anonymous>)
at ThreadMembersUpdateAction.handle (/app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js:16:27)
at module.exports [as THREAD_MEMBERS_UPDATE] (/app/node_modules/discord.js/src/client/websocket/handlers/THREAD_MEMBERS_UPDATE.js:4:38)
at WebSocketManager.handlePacket (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:355:31)
at WebSocketManager.<anonymous> (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:239:12)
at WebSocketManager.emit (/app/node_modules/@vladfrangu/async_event_emitter/dist/index.cjs:282:31)
at WebSocketShard.<anonymous> (/app/node_modules/@discordjs/ws/dist/index.js:1190:51)
at WebSocketShard.emit (/app/node_modules/@vladfrangu/async_event_emitter/dist/index.cjs:282:31)
at WebSocketShard.onMessage (/app/node_modules/@discordjs/ws/dist/index.js:1005:14) {
[stack]: [Getter/Setter: 'TypeError: thread.members._add is not a function\n' +
' at /app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js:17:95\n' +
' at Array.reduce (<anonymous>)\n' +
' at ThreadMembersUpdateAction.'... 838 more characters],
[message]: 'thread.members._add is not a function'
}
}
Currently on v14.15.3, nodejs v21.7.1 I don't actually do anything with threads or thread members so it seems specificaly related to the message handler from a thread, possibly mentioning the bot?
85 Replies
d.js toolkit
d.js toolkit7mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Jake
JakeOP7mo ago
not yet but i'm trying to see if i can figure out which server it's happening on
[UnhandledPromise] TypeError: Cannot read properties of undefined (reading 'get')Promise {
<rejected> TypeError: Cannot read properties of undefined (reading 'get')
at ThreadMembersUpdateAction.getPayload (/app/node_modules/discord.js/src/client/actions/Action.js:27:107)
at ThreadMembersUpdateAction.getThreadMember (/app/node_modules/discord.js/src/client/actions/Action.js:112:17)
at /app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js:22:35
at Array.reduce (<anonymous>)
at ThreadMembersUpdateAction.handle (/app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js:21:32)
at module.exports [as THREAD_MEMBERS_UPDATE] (/app/node_modules/discord.js/src/client/websocket/handlers/THREAD_MEMBERS_UPDATE.js:4:38)
at WebSocketManager.handlePacket (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:355:31)
at WebSocketManager.<anonymous> (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:239:12)
at WebSocketManager.emit (/app/node_modules/@vladfrangu/async_event_emitter/dist/index.cjs:282:31)
at WebSocketShard.<anonymous> (/app/node_modules/@discordjs/ws/dist/index.js:1190:51) {
[stack]: [Getter/Setter: "TypeError: Cannot read properties of undefined (reading 'get')\n" +
' at ThreadMembersUpdateAction.getPayload (/app/node_modules/discord.js/src/client/actions/Action.js:27:107)\n' +
' at ThreadMembersUpdate'... 890 more characters],
[message]: "Cannot read properties of undefined (reading 'get')"
}
[UnhandledPromise] TypeError: Cannot read properties of undefined (reading 'get')Promise {
<rejected> TypeError: Cannot read properties of undefined (reading 'get')
at ThreadMembersUpdateAction.getPayload (/app/node_modules/discord.js/src/client/actions/Action.js:27:107)
at ThreadMembersUpdateAction.getThreadMember (/app/node_modules/discord.js/src/client/actions/Action.js:112:17)
at /app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js:22:35
at Array.reduce (<anonymous>)
at ThreadMembersUpdateAction.handle (/app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js:21:32)
at module.exports [as THREAD_MEMBERS_UPDATE] (/app/node_modules/discord.js/src/client/websocket/handlers/THREAD_MEMBERS_UPDATE.js:4:38)
at WebSocketManager.handlePacket (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:355:31)
at WebSocketManager.<anonymous> (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:239:12)
at WebSocketManager.emit (/app/node_modules/@vladfrangu/async_event_emitter/dist/index.cjs:282:31)
at WebSocketShard.<anonymous> (/app/node_modules/@discordjs/ws/dist/index.js:1190:51) {
[stack]: [Getter/Setter: "TypeError: Cannot read properties of undefined (reading 'get')\n" +
' at ThreadMembersUpdateAction.getPayload (/app/node_modules/discord.js/src/client/actions/Action.js:27:107)\n' +
' at ThreadMembersUpdate'... 890 more characters],
[message]: "Cannot read properties of undefined (reading 'get')"
}
just got a different stack trace, still trying to identify where it's coming from it's very odd it just started happening today after i updated from 14.15.2 to 14.15.3 but i dont think that would be related. it's only happening on one shard so i think it must be only one server it's happening on nope just straight from npm/yarn
Jake
JakeOP7mo ago
No description
Jake
JakeOP7mo ago
i'm going to modify that file in prod to log thread and thread.members to see if i can figure out whats going on. like you said it might be some weird partial ok, i found the server 755765126140919881 so i can at least investigate it more
Jake
JakeOP7mo ago
ok that's weird...
No description
Jake
JakeOP7mo ago
that's a guild text channel it has no .name property
Jake
JakeOP7mo ago
too big to paste, here's the channel
Kinect3000
Kinect30007mo ago
Why is it using camel case? Is <#1248260941884162151> actually a text channel, or a thread?
Jake
JakeOP7mo ago
how can i verify that with code?
Jake
JakeOP7mo ago
No description
Jake
JakeOP7mo ago
let me see if i can get the full printout
Syjalo
Syjalo7mo ago
Looks like it's a thread, but why the type is 0
Jake
JakeOP7mo ago
it's consistent even after restarts
Syjalo
Syjalo7mo ago
What's type of 1094658972004397127?
Jake
JakeOP7mo ago
15
{
id: '1248260941884162151',
type: 11,
last_message_id: '1248282777128800266',
flags: 0,
guild_id: '755765126140919881',
name: '葛葉、本間向日葵(team B)-SF6律可杯-2024年6月6日~',
parent_id: '1094658972004397127',
rate_limit_per_user: 0,
bitrate: 64000,
user_limit: 0,
rtc_region: null,
owner_id: '714856105859350609',
thread_metadata: {
archived: false,
archive_timestamp: '2024-06-06T13:03:20.112000+00:00',
auto_archive_duration: 1440,
locked: false,
create_timestamp: '2024-06-06T13:03:20.112000+00:00'
},
message_count: 124,
member_count: 15,
total_message_sent: 126,
applied_tags: [ '1094659433520435250' ]
}
{
id: '1248260941884162151',
type: 11,
last_message_id: '1248282777128800266',
flags: 0,
guild_id: '755765126140919881',
name: '葛葉、本間向日葵(team B)-SF6律可杯-2024年6月6日~',
parent_id: '1094658972004397127',
rate_limit_per_user: 0,
bitrate: 64000,
user_limit: 0,
rtc_region: null,
owner_id: '714856105859350609',
thread_metadata: {
archived: false,
archive_timestamp: '2024-06-06T13:03:20.112000+00:00',
auto_archive_duration: 1440,
locked: false,
create_timestamp: '2024-06-06T13:03:20.112000+00:00'
},
message_count: 124,
member_count: 15,
total_message_sent: 126,
applied_tags: [ '1094659433520435250' ]
}
and i'm receiving like those thread member updates obviously for that channel, but i guess because it's type 0, it never got initialized as a thread channel well i'm wondering if the initial gateway is sending it as type 0, because even when i force fetch it, still returns 0
Kinect3000
Kinect30007mo ago
I don’t think force fetching it would fix the channel type Or ig if you do it via the manager
Syjalo
Syjalo7mo ago
It is ^
Jake
JakeOP7mo ago
dont think so 😄 it's literally just this one channel ok lads, even though i restarted multiple times, i just pushed out a new docker image with that raw log and now it's type 11 😕 so i think we blame discord and call it a wrap
Jake
JakeOP7mo ago
No description
Jake
JakeOP7mo ago
ok. it's back again but on a different channel/shard completely. i have no idea what's going on. i do but i havent seen anything like that before and no sir, i dont do anything like that
"dependencies": {
"@discordjs/util": "^1.1.0",
"@discordjs/voice": "0.17.0",
"@ensemblebr/dice": "^3.0.0",
"@huggingface/inference": "^2.7.0",
"cheerio": "1.0.0-rc.12",
"discord-api-types": "^0.37.87",
"discord.js": "14.15.3",
"emojilib": "^3.0.12",
"ffmpeg-static": "^5.2.0",
"moment-mini": "^2.29.4",
"mysql2": "^3.10.0",
"object-sizeof": "^2.6.4",
"prism-media": "^1.3.5",
"redis": "4.6.14",
"soundcloud.ts": "^0.5.3",
"spotify-uri": "4.1.0",
"typescript-eslint": "^7.12.0",
"ws": "^8.17.0",
"xml2js": "^0.6.2"
},
"optionalDependencies": {
"@discordjs/opus": "^0.9.0",
"bufferutil": "^4.0.8",
"sodium-native": "^4.1.1",
"zlib-sync": "^0.1.9"
},
"dependencies": {
"@discordjs/util": "^1.1.0",
"@discordjs/voice": "0.17.0",
"@ensemblebr/dice": "^3.0.0",
"@huggingface/inference": "^2.7.0",
"cheerio": "1.0.0-rc.12",
"discord-api-types": "^0.37.87",
"discord.js": "14.15.3",
"emojilib": "^3.0.12",
"ffmpeg-static": "^5.2.0",
"moment-mini": "^2.29.4",
"mysql2": "^3.10.0",
"object-sizeof": "^2.6.4",
"prism-media": "^1.3.5",
"redis": "4.6.14",
"soundcloud.ts": "^0.5.3",
"spotify-uri": "4.1.0",
"typescript-eslint": "^7.12.0",
"ws": "^8.17.0",
"xml2js": "^0.6.2"
},
"optionalDependencies": {
"@discordjs/opus": "^0.9.0",
"bufferutil": "^4.0.8",
"sodium-native": "^4.1.1",
"zlib-sync": "^0.1.9"
},
across all the channels in my cache, there are 363891 in total, so i find it very odd that it just started randomly happening today and it's only one particular channel, even "fixed" after and started randomly happening to a different one I'll reach out and see what they say! Thanks
Xabi
Xabi6mo ago
Also having this issue Only on launch
Jake
JakeOP6mo ago
Yeah it's still happening to me but I'm just ignoring it for now
Xabi
Xabi6mo ago
@A Floofy Fluffy Vladdy banned
Jake
JakeOP6mo ago
Discord api server post https://discord.com/channels/613425648685547541/1250430249171419248 I probably need to bump it Sorry for the delayed reply. So I added a try/catch in ThreadMembersUpdate.js to log which id was causing issues, then i updated the client to log the raw event below:
[7/15/2024, 6:02:29 PM] [CRITICAL] [UnhandledPromise] TypeError: manager._add is not a functionPromise {
<rejected> TypeError: manager._add is not a function
at ThreadMembersUpdateAction.getPayload (/app/node_modules/discord.js/src/client/actions/Action.js:27:73)
at ThreadMembersUpdateAction.getThreadMember (/app/node_modules/discord.js/src/client/actions/Action.js:112:17)
at /app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js:27:35
at Array.reduce (<anonymous>)
at ThreadMembersUpdateAction.handle (/app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js:26:32)
at module.exports [as THREAD_MEMBERS_UPDATE]
}
}
[7/15/2024, 6:02:29 PM] [CRITICAL] [UnhandledPromise] TypeError: manager._add is not a functionPromise {
<rejected> TypeError: manager._add is not a function
at ThreadMembersUpdateAction.getPayload (/app/node_modules/discord.js/src/client/actions/Action.js:27:73)
at ThreadMembersUpdateAction.getThreadMember (/app/node_modules/discord.js/src/client/actions/Action.js:112:17)
at /app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js:27:35
at Array.reduce (<anonymous>)
at ThreadMembersUpdateAction.handle (/app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js:26:32)
at module.exports [as THREAD_MEMBERS_UPDATE]
}
}
BROKEN THREAD CHANNEL ID: 1262397367458594816
Bad thread
{
type: 11,
total_message_sent: 39,
thread_metadata: {
locked: false,
create_timestamp: '2024-07-15T13:16:26.611000+00:00',
auto_archive_duration: 10080,
archived: false,
archive_timestamp: '2024-07-15T13:16:26.611000+00:00'
},
rate_limit_per_user: 0,
parent_id: '1039932728654704802',
owner_id: '993111286445510747',
name: 'cant open my application',
message_count: 39,
member_count: 4,
last_message_id: '1262473923094908992',
id: '1262397367458594816',
guild_id: '834650675224248362',
flags: 0,
applied_tags: [ '1039936605638643792', '1048316771427418253' ]
}
{
type: 11,
total_message_sent: 39,
thread_metadata: {
locked: false,
create_timestamp: '2024-07-15T13:16:26.611000+00:00',
auto_archive_duration: 10080,
archived: false,
archive_timestamp: '2024-07-15T13:16:26.611000+00:00'
},
rate_limit_per_user: 0,
parent_id: '1039932728654704802',
owner_id: '993111286445510747',
name: 'cant open my application',
message_count: 39,
member_count: 4,
last_message_id: '1262473923094908992',
id: '1262397367458594816',
guild_id: '834650675224248362',
flags: 0,
applied_tags: [ '1039936605638643792', '1048316771427418253' ]
}
just once, only on the thread raw.d.threads
Jake
JakeOP6mo ago
No description
Jake
JakeOP6mo ago
heres the whole thing from when i first logged the channel ID after it happened to updating the raw handler and restarting the bot:
No description
vladdy
vladdy6mo ago
That shouldn't happen, we only ever do type magic for text<->announcement
Jake
JakeOP6mo ago
{"type":0,"guild":"834650675224248362","guildId":"834650675224248362","permissionOverwrites":[],"messages":[],"threads":[],"nsfw":false,"flags":0,"id":"1262397367458594816","rawPosition":50,"parentId":null,"defaultThreadRateLimitPerUser":null,"lastMessageId":"1262485918464610355","createdTimestamp":1721049386611}
{"type":0,"guild":"834650675224248362","guildId":"834650675224248362","permissionOverwrites":[],"messages":[],"threads":[],"nsfw":false,"flags":0,"id":"1262397367458594816","rawPosition":50,"parentId":null,"defaultThreadRateLimitPerUser":null,"lastMessageId":"1262485918464610355","createdTimestamp":1721049386611}
:myDudes:
vladdy
vladdy6mo ago
Channel update is the only place we may alter types to my knowledge cc @PKASH cuz you also get this error
Jake
JakeOP6mo ago
@Xabi
PKASH
PKASH6mo ago
:monkaHmmm:
Jake
JakeOP6mo ago
sorry, i misunderstood the assignment. here is another channel it just happened to(had to paste as file):
TypeError: thread.members._add is not a function
at /app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js:18:95
at Array.reduce (<anonymous>)
at ThreadMembersUpdateAction.handle (/app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js:17:27)
at module.exports [as THREAD_MEMBERS_UPDATE] (/app/node_modules/discord.js/src/client/websocket/handlers/THREAD_MEMBERS_UPDATE.js:4:38)
at WebSocketManager.handlePacket (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:348:31)
at WebSocketManager.<anonymous> (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:232:12)
at WebSocketManager.emit (/app/node_modules/@vladfrangu/async_event_emitter/dist/index.cjs:282:31)
at WebSocketShard.<anonymous> (/app/node_modules/@discordjs/ws/dist/index.js:1190:51)
at WebSocketShard.emit (/app/node_modules/@vladfrangu/async_event_emitter/dist/index.cjs:282:31)
at WebSocketShard.onMessage (/app/node_modules/@discordjs/ws/dist/index.js:1005:14)

BROKEN THREAD CHANNEL ID: 1262734018772733992
TypeError: thread.members._add is not a function
at /app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js:18:95
at Array.reduce (<anonymous>)
at ThreadMembersUpdateAction.handle (/app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js:17:27)
at module.exports [as THREAD_MEMBERS_UPDATE] (/app/node_modules/discord.js/src/client/websocket/handlers/THREAD_MEMBERS_UPDATE.js:4:38)
at WebSocketManager.handlePacket (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:348:31)
at WebSocketManager.<anonymous> (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:232:12)
at WebSocketManager.emit (/app/node_modules/@vladfrangu/async_event_emitter/dist/index.cjs:282:31)
at WebSocketShard.<anonymous> (/app/node_modules/@discordjs/ws/dist/index.js:1190:51)
at WebSocketShard.emit (/app/node_modules/@vladfrangu/async_event_emitter/dist/index.cjs:282:31)
at WebSocketShard.onMessage (/app/node_modules/@discordjs/ws/dist/index.js:1005:14)

BROKEN THREAD CHANNEL ID: 1262734018772733992
Jake
JakeOP6mo ago
/app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js
try {
data.added_members?.reduce(
(_addedMembers, addedMember) => _addedMembers.set(addedMember.user_id, thread.members._add(addedMember)),
addedMembers,
);
} catch (ex) {
console.error(ex, "BROKEN THREAD CHANNEL ID: ", data.id);
}
try {
data.added_members?.reduce(
(_addedMembers, addedMember) => _addedMembers.set(addedMember.user_id, thread.members._add(addedMember)),
addedMembers,
);
} catch (ex) {
console.error(ex, "BROKEN THREAD CHANNEL ID: ", data.id);
}
client.js
mybot.once('ready', async () => {
console.log(mybot.channels.cache.get('1262734018772733992'));
mybot.once('ready', async () => {
console.log(mybot.channels.cache.get('1262734018772733992'));
the log for the channel update has not fired yet, but this is what i put:
if (data.id === '1262734018772733992') console.log("CHANNEL UPDATE LOG", channel, data)
if (data.id === '1262734018772733992') console.log("CHANNEL UPDATE LOG", channel, data)
sorry i had truncated it, i fixed it i chain the .on calls so was just trying to fix it lol i understand what you're saying, but i've been pretty forthcoming with everything i have. if you no longer want to help then that's fine it's not a blocking issue for me, i just thought i would report an issue that arose semi-recently. it seems a couple of other people are having this issue. not sure @PKASH @Xabi do you use partials?
Xabi
Xabi6mo ago
@NotDemonix
NotDemonix
NotDemonix6mo ago
A We got some partials, let me send the list Message, channel, user and guild member
Jake
JakeOP6mo ago
gotcha. i also have channel partial. i have ThreadMember as well but it seems more channel related than member related. wonder if it's a partial for whatever reason and defaulting to the wrong type and not updating after a channel update
NotDemonix
NotDemonix6mo ago
I can't really test removing the channel partial since it will probably miss some channelDelete events causing extra issues
vladdy
vladdy6mo ago
wait am I seeing it right that you got a broken thread id for a channel that was somehow stored as a text channel
Jake
JakeOP6mo ago
correct. i am receiving ThreadMembersUpdate events but the channel is stored as a TextChannel
vladdy
vladdy6mo ago
can you do a raw api request for me?
Jake
JakeOP6mo ago
but we know from doing the rest calls it's a type 11
vladdy
vladdy6mo ago
thats..what i was gonna ask for :KEKW: wtf
Jake
JakeOP6mo ago
https://discord.com/channels/222078108977594368/1248260322163294238/1248282260143079516 whats super weird is that it "changes". like if i restart the gateway, it'll be received as a type 11 but then a random other thread will start throwing that same error
vladdy
vladdy6mo ago
the only way this is possible is if somehow discord sends us this channel in guild_create or thread_list_sync as text is it not always the same id?
Jake
JakeOP6mo ago
nope. like that example i sent, that's a type 11 in my cache right now. but i have another ID that is "currently" happening i don't even really do much with threads with my bot. i only started using the Channel partial just because i listen for message events for specific automation and it was missing threads until i added channel partials
vladdy
vladdy6mo ago
and the current thread thats throwing the errors, if you have an eval cmd, can you log cache.get(id).partial?
Jake
JakeOP6mo ago
sure give me a sec, it's on a different shard
vladdy
vladdy6mo ago
broadcastEval go brrr
Jake
JakeOP6mo ago
i need to find the channel_id because it doesnt log it, just the unhandled rejection
vladdy
vladdy6mo ago
i thought your patch logged it
Jake
JakeOP6mo ago
separate process, not the same node_modules folder
vladdy
vladdy6mo ago
a h
Jake
JakeOP6mo ago
i'll post in here when it happens again. just have to wait unfortunately because i dont have a way to programmatically find which channels it happens to however i was curious about this line: https://github.com/discordjs/discord.js/blob/efa16a6095e012ff4d138b21d128df5f407fc93c/packages/discord.js/src/structures/BaseChannel.js#L80 i vaguely recall somewhere that you needed channel partial not only for DMs, but also for messages in threads that the bot was not actively a part of yet. is that true?
No description
vladdy
vladdy6mo ago
i can confirm the first part of your question, got no clue about the second part i'd have to dig into the code eventually and check
Jake
JakeOP6mo ago
gotcha. it says that all ThreadChannels just inherit from BaseChannel.partial, so i guess it will always return false https://discord.com/channels/222078108977594368/1148749662078119976/1148766030412382301 this is the logged patch that logs the ID in ThreadMembersUpdate.js
BROKEN THREAD 1262790110647156736
BROKEN THREAD 1262790110647156736
<ref *2> TextChannel {
type: 0,
guild: <ref *1> Guild {
id: '755765126140919881',
name: '彩虹研究社:rainbow:',
icon: 'b2ea11110ab979ddda535b7c4479efc9',
features: [
'AUTO_MODERATION',
'ROLE_ICONS',
'SEVEN_DAY_THREAD_ARCHIVE',
'ANIMATED_BANNER',
'NEWS',
'SOUNDBOARD',
'BANNER',
'ANIMATED_ICON',
'INVITE_SPLASH',
'CHANNEL_ICON_EMOJIS_GENERATED',
'THREE_DAY_THREAD_ARCHIVE',
'MEMBER_PROFILES',
'COMMUNITY',
'VANITY_URL',
'PRIVATE_THREADS'
],
(TRUNCATING SO I CAN PASTE IN DISCORD)
},
guildId: '755765126140919881',
permissionOverwrites: PermissionOverwriteManager { channel: [Circular *2] },
messages: GuildMessageManager { channel: [Circular *2] },
threads: GuildTextThreadManager { channel: [Circular *2] },
nsfw: false,
flags: ChannelFlagsBitField { bitfield: 0 },
id: '1262790110647156736',
parentId: null,
defaultThreadRateLimitPerUser: null,
memberCount: 7,
rawPosition: 4,
lastMessageId: '1262806103016607784'
}
<ref *2> TextChannel {
type: 0,
guild: <ref *1> Guild {
id: '755765126140919881',
name: '彩虹研究社:rainbow:',
icon: 'b2ea11110ab979ddda535b7c4479efc9',
features: [
'AUTO_MODERATION',
'ROLE_ICONS',
'SEVEN_DAY_THREAD_ARCHIVE',
'ANIMATED_BANNER',
'NEWS',
'SOUNDBOARD',
'BANNER',
'ANIMATED_ICON',
'INVITE_SPLASH',
'CHANNEL_ICON_EMOJIS_GENERATED',
'THREE_DAY_THREAD_ARCHIVE',
'MEMBER_PROFILES',
'COMMUNITY',
'VANITY_URL',
'PRIVATE_THREADS'
],
(TRUNCATING SO I CAN PASTE IN DISCORD)
},
guildId: '755765126140919881',
permissionOverwrites: PermissionOverwriteManager { channel: [Circular *2] },
messages: GuildMessageManager { channel: [Circular *2] },
threads: GuildTextThreadManager { channel: [Circular *2] },
nsfw: false,
flags: ChannelFlagsBitField { bitfield: 0 },
id: '1262790110647156736',
parentId: null,
defaultThreadRateLimitPerUser: null,
memberCount: 7,
rawPosition: 4,
lastMessageId: '1262806103016607784'
}
logging .partial returns false, but i think it's always going to be false according to the library
vladdy
vladdy6mo ago
whats real real weird is that its a text channel instance but has memberCount and tmk thats thread only
Jake
JakeOP6mo ago
ahhh that is super helpful actually!!
No description
vladdy
vladdy6mo ago
Oh my I'll need to double check I'm not high but that doesn't look right
Jake
JakeOP6mo ago
there are type 11 channels with memberCount too, so it's not all or nothing
Jake
JakeOP6mo ago
No description
vladdy
vladdy6mo ago
That's...concerning then Keep in mind the debug log is spammy as hell Might wanna filter out to only messages matching the header
PKASH
PKASH6mo ago
Yes (GuildMember, Reaction, Channel, Message)
Jake
JakeOP6mo ago
Sounds good. I'll pull it down and run it shortly. Thanks for looking into this!! ok getting a lot of logs lol
Jake
JakeOP6mo ago
4|Lopez | [7/16/2024, 3:17:58 PM] [TRACE] [DebugHandler] [THREAD-TEXT]: Received non-text channel type undefined
4|Lopez | [7/16/2024, 3:17:58 PM] [TRACE] [DebugHandler] {"id":"588120683402362883","channel_id":"588120683402362883","guild_id":"588120682806902786","recipients":[{}]}
4|Lopez | [7/16/2024, 3:17:58 PM] [TRACE] [DebugHandler] [THREAD-TEXT]: Received non-text channel type undefined
4|Lopez | [7/16/2024, 3:17:58 PM] [TRACE] [DebugHandler] {"id":"588120683402362883","channel_id":"588120683402362883","guild_id":"588120682806902786","recipients":[{}]}
4|Lopez | [7/16/2024, 3:18:46 PM] [TRACE] [DebugHandler] [THREAD-TEXT]: Received non-text channel type undefined
4|Lopez | [7/16/2024, 3:18:46 PM] [TRACE] [DebugHandler] {"id":"1260578253702430843","channel_id":"1260578253702430843","guild_id":"1001974418030993458","recipients":[{}]}
4|Lopez | [7/16/2024, 3:18:46 PM] [TRACE] [DebugHandler] [THREAD-TEXT]: Received non-text channel type undefined
4|Lopez | [7/16/2024, 3:18:46 PM] [TRACE] [DebugHandler] {"id":"1041750455904129054","channel_id":"1041750455904129054","guild_id":"1037316821650526269","recipients":[{}]}
4|Lopez | [7/16/2024, 3:18:47 PM] [TRACE] [DebugHandler] [THREAD-TEXT]: Received non-text channel type undefined
4|Lopez | [7/16/2024, 3:18:47 PM] [TRACE] [DebugHandler] {"id":"1113442013224898650","channel_id":"1113442013224898650","guild_id":"1037316821650526269","recipients":[{}]}
4|Lopez | [7/16/2024, 3:18:47 PM] [TRACE] [DebugHandler] [THREAD-TEXT]: Received non-text channel type undefined
4|Lopez | [7/16/2024, 3:18:47 PM] [TRACE] [DebugHandler] {"id":"1260578253702430843","channel_id":"1260578253702430843","guild_id":"1001974418030993458","recipients":[{}]}
4|Lopez | [7/16/2024, 3:18:46 PM] [TRACE] [DebugHandler] [THREAD-TEXT]: Received non-text channel type undefined
4|Lopez | [7/16/2024, 3:18:46 PM] [TRACE] [DebugHandler] {"id":"1260578253702430843","channel_id":"1260578253702430843","guild_id":"1001974418030993458","recipients":[{}]}
4|Lopez | [7/16/2024, 3:18:46 PM] [TRACE] [DebugHandler] [THREAD-TEXT]: Received non-text channel type undefined
4|Lopez | [7/16/2024, 3:18:46 PM] [TRACE] [DebugHandler] {"id":"1041750455904129054","channel_id":"1041750455904129054","guild_id":"1037316821650526269","recipients":[{}]}
4|Lopez | [7/16/2024, 3:18:47 PM] [TRACE] [DebugHandler] [THREAD-TEXT]: Received non-text channel type undefined
4|Lopez | [7/16/2024, 3:18:47 PM] [TRACE] [DebugHandler] {"id":"1113442013224898650","channel_id":"1113442013224898650","guild_id":"1037316821650526269","recipients":[{}]}
4|Lopez | [7/16/2024, 3:18:47 PM] [TRACE] [DebugHandler] [THREAD-TEXT]: Received non-text channel type undefined
4|Lopez | [7/16/2024, 3:18:47 PM] [TRACE] [DebugHandler] {"id":"1260578253702430843","channel_id":"1260578253702430843","guild_id":"1001974418030993458","recipients":[{}]}
it's still going but they all look more or less like the above
Jake
JakeOP6mo ago
No description
Jake
JakeOP6mo ago
here's the full with the console.trace i forgot to add i also saw one for type 7 which isn't documented too here's the type 7:
18119 [7/16/2024, 3:18:29 PM] [TRACE] [DebugHandler] [THREAD-TEXT]: Received non-text channel type 7
18120 [7/16/2024, 3:18:29 PM] [TRACE] [DebugHandler] {"type":7,"tts":false,"timestamp":"2024-07-16T19:18:29.009000+00:00","pinned":false,"mentions":[],"mention_roles":[],"mention_everyone":false,"member":{"roles":["1057620071872217138", "1125210600595787886"],"premium_since":null,"pending":false,"nick":null,"mute":false,"joined_at":"2024-07-16T19:18:10.192000+00:00","flags":10,"deaf":false,"communication_disabled_until":null,"banner":null,"avatar":null},"id":"909163248174137364", "flags":0,"embeds":[],"edited_timestamp":null,"content":"","components":[],"channel_id":"909163248174137364","author":{"username":"dirtyxo","public_flags":0,"id":"813591086571847680","global_name":"ℜ𝔞𝔪𝔷","discriminator":"0","clan":null, "avatar_decoration_data":null,"avatar":"bb8c96935479de5a01dda3bcb72cee5b"},"attachments":[],"guild_id":"559593478573654017","recipients":[{"username":"dirtyxo","public_flags":0,"id":"813591086571847680","global_name":"ℜ𝔞𝔪𝔷","discriminator":"0", "clan":null,"avatar_decoration_data":null,"avatar":"bb8c96935479de5a01dda3bcb72cee5b"}]}
18119 [7/16/2024, 3:18:29 PM] [TRACE] [DebugHandler] [THREAD-TEXT]: Received non-text channel type 7
18120 [7/16/2024, 3:18:29 PM] [TRACE] [DebugHandler] {"type":7,"tts":false,"timestamp":"2024-07-16T19:18:29.009000+00:00","pinned":false,"mentions":[],"mention_roles":[],"mention_everyone":false,"member":{"roles":["1057620071872217138", "1125210600595787886"],"premium_since":null,"pending":false,"nick":null,"mute":false,"joined_at":"2024-07-16T19:18:10.192000+00:00","flags":10,"deaf":false,"communication_disabled_until":null,"banner":null,"avatar":null},"id":"909163248174137364", "flags":0,"embeds":[],"edited_timestamp":null,"content":"","components":[],"channel_id":"909163248174137364","author":{"username":"dirtyxo","public_flags":0,"id":"813591086571847680","global_name":"ℜ𝔞𝔪𝔷","discriminator":"0","clan":null, "avatar_decoration_data":null,"avatar":"bb8c96935479de5a01dda3bcb72cee5b"},"attachments":[],"guild_id":"559593478573654017","recipients":[{"username":"dirtyxo","public_flags":0,"id":"813591086571847680","global_name":"ℜ𝔞𝔪𝔷","discriminator":"0", "clan":null,"avatar_decoration_data":null,"avatar":"bb8c96935479de5a01dda3bcb72cee5b"}]}
THAT LOOKS LIKE A USER NO? caps nvm wrap had me trippin let me see if i can pull it interestingly, when i do channels.cache.get().type, it's 0 so that would probably help explain the whole 0 thing it's a "new-members" channel in some gaming guild hmm... i dont see it in the logs. i checked my logs that i send to a db and my file system logs just to be sure
vladdy
vladdy6mo ago
:shrug: we just ignore types we dont support
Jake
JakeOP6mo ago
it's not like a pressing issue, the bot functions normally, just those unhandled rejections i receive yeah it is a gaming guild so that makes sense nothing on 19/20 unfortunately
vladdy
vladdy6mo ago
holy shit LFG channels still exist??
Jake
JakeOP6mo ago
flags: 10, so it's a media channel? so i guess the followup question is, why is it i can get the channel from the cache and it returns type 0? if they're supposed to be ignored
vladdy
vladdy6mo ago
partials maybe?
Jake
JakeOP6mo ago
everyone having the issue does have the channel partial would also explain the undefined type 19652 [7/16/2024, 3:30:59 PM] [TRACE] [DebugHandler] [THREAD-TEXT]: Received non-text channel type undefined 19653 [7/16/2024, 3:30:59 PM] [TRACE] [DebugHandler] {"id":"1147244500452905160","channel_id":"1147244500452905160","guild_id":"1147013203423928390","recipients":[{}]} calling cache get returns type 0 on this as well
vladdy
vladdy6mo ago
thats... wait that looks like a partial object from us
Jake
JakeOP6mo ago
Trace
at TextChannel._patch (/app/node_modules/discord.js/src/structures/TextChannel.js:15:15)
at ChannelManager._add (/app/node_modules/discord.js/src/managers/ChannelManager.js:42:27)
at MessageCreateAction.getPayload (/app/node_modules/discord.js/src/client/actions/Action.js:27:73)
at MessageCreateAction.getChannel (/app/node_modules/discord.js/src/client/actions/Action.js:44:12)
at MessageCreateAction.handle (/app/node_modules/discord.js/src/client/actions/MessageCreate.js:9:26)
at module.exports [as MESSAGE_CREATE] (/app/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:355:31)
at WebSocketManager.<anonymous> (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:239:12)
at WebSocketManager.emit (/app/node_modules/@vladfrangu/async_event_emitter/dist/index.cjs:282:31)
at WebSocketShard.<anonymous> (/app/node_modules/@discordjs/ws/dist/index.js:1190:51)
Trace
at TextChannel._patch (/app/node_modules/discord.js/src/structures/TextChannel.js:15:15)
at ChannelManager._add (/app/node_modules/discord.js/src/managers/ChannelManager.js:42:27)
at MessageCreateAction.getPayload (/app/node_modules/discord.js/src/client/actions/Action.js:27:73)
at MessageCreateAction.getChannel (/app/node_modules/discord.js/src/client/actions/Action.js:44:12)
at MessageCreateAction.handle (/app/node_modules/discord.js/src/client/actions/MessageCreate.js:9:26)
at module.exports [as MESSAGE_CREATE] (/app/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:355:31)
at WebSocketManager.<anonymous> (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:239:12)
at WebSocketManager.emit (/app/node_modules/@vladfrangu/async_event_emitter/dist/index.cjs:282:31)
at WebSocketShard.<anonymous> (/app/node_modules/@discordjs/ws/dist/index.js:1190:51)
ah it explains why this started failing semirecently, so it was 2-3 months ago that it was checked in this was a clutch catch will do thank you all for your help and patience!! and thank you @Jiralite for the quick logging change. i'm around to test any potential fixes if you need me to
vladdy
vladdy6mo ago
i could tell from the recipients: [{}] LMAO
Jake
JakeOP6mo ago
sent a bug bounty to your opencollective! cheers 🎉 @Jiralite do you want me to make an issue on github for tracking?
PKASH
PKASH6mo ago
Iv'e gotten several of these in the past few days not sure if it's related to this issue as well
Unhandled promise rejection: Cannot read properties of undefined (reading 'get') TypeError: Cannot read properties of undefined (reading 'get')
at ThreadMembersUpdateAction.getPayload (/home/app/node_modules/discord.js/src/client/actions/Action.js:27:107)
at ThreadMembersUpdateAction.getThreadMember (/home/app/node_modules/discord.js/src/client/actions/Action.js:112:17)
at /home/app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js:22:35
at Array.reduce (<anonymous>)
at ThreadMembersUpdateAction.handle (/home/app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js:21:32)
at module.exports [as THREAD_MEMBERS_UPDATE] (/home/app/node_modules/discord.js/src/client/websocket/handlers/THREAD_MEMBERS_UPDATE.js:4:38)
at WebSocketManager.handlePacket (/home/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:355:31)
at WebSocketManager.<anonymous> (/home/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:239:12)
at WebSocketManager.emit (/home/app/node_modules/@vladfrangu/async_event_emitter/dist/index.cjs:285:31)
at WebSocketShard.<anonymous> (/home/app/node_modules/@discordjs/ws/dist/index.js:1190:51)
Unhandled promise rejection: Cannot read properties of undefined (reading 'get') TypeError: Cannot read properties of undefined (reading 'get')
at ThreadMembersUpdateAction.getPayload (/home/app/node_modules/discord.js/src/client/actions/Action.js:27:107)
at ThreadMembersUpdateAction.getThreadMember (/home/app/node_modules/discord.js/src/client/actions/Action.js:112:17)
at /home/app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js:22:35
at Array.reduce (<anonymous>)
at ThreadMembersUpdateAction.handle (/home/app/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js:21:32)
at module.exports [as THREAD_MEMBERS_UPDATE] (/home/app/node_modules/discord.js/src/client/websocket/handlers/THREAD_MEMBERS_UPDATE.js:4:38)
at WebSocketManager.handlePacket (/home/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:355:31)
at WebSocketManager.<anonymous> (/home/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:239:12)
at WebSocketManager.emit (/home/app/node_modules/@vladfrangu/async_event_emitter/dist/index.cjs:285:31)
at WebSocketShard.<anonymous> (/home/app/node_modules/@discordjs/ws/dist/index.js:1190:51)
Jake
JakeOP6mo ago
same line as mine, just a different part. that's interesting though that it's different for you
NyR
NyR5mo ago
I'm not sure if my issue is also related to this, but i have been getting similar error myself too Like
TypeError: Cannot read properties of undefined (reading '_add')
at InteractionWebhook.send (/root/skyhelper/node_modules/discord.js/src/structures/Webhook.js:232:66)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.execute (file:///root/skyhelper/dist/src/commands/slash/info/daily-quests.js:17:19)
at async interactionHandler (file:///root/skyhelper/dist/src/events/interactionCreate.js:33:13)
TypeError: Cannot read properties of undefined (reading '_add')
at InteractionWebhook.send (/root/skyhelper/node_modules/discord.js/src/structures/Webhook.js:232:66)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.execute (file:///root/skyhelper/dist/src/commands/slash/info/daily-quests.js:17:19)
at async interactionHandler (file:///root/skyhelper/dist/src/events/interactionCreate.js:33:13)
Happens when using slash commands At first, I thought maybe it was because the command was used in an uncached channel (as an user app), but looking at the source here https://github.com/discordjs/discord.js/blob/main/packages%2Fdiscord.js%2Fsrc%2Fstructures%2FWebhook.js#L232, the optional chaining (?) should short circuit, also it's actually messages property that's undefined, which confuses me. Because from my understanding, the channel returned shoukd be a TextChannel since slash commands can only be used in those (right ?). So I have no idea what channel type it's getting there. I tried to reproduce this multiple times myself with no avail, it only happens sometimes rarely will do that
cobalt
cobalt5mo ago
Is it possible the command is being run in a group DM via user apps (maybe you registered it directly with the API instead of using d.js)? oh yeah you did say it's a user app
NyR
NyR5mo ago
Yes group dm was the issue, which we discussed on a different thread The issue is being tracked with the user app pr
cobalt
cobalt5mo ago
ah
Want results from more Discord servers?
Add your server