/simulatejoin outputs error
Closed this issue · 4 comments
Ki-er commented
Simulates a join using the guildmember event but gets
Guildid is not defined
G0maa commented
You mean /simulatejoin
?
Also how to reproduce error, it worked in docker environment.
Ki-er commented
/usr/clarence/src/src/events/guildMemberAdd.js:7
const data = await guildSchema.findById(guildmember.guild.id);
^
TypeError: Cannot read properties of undefined (reading 'id')
at Client.<anonymous> (/usr/clarence/src/src/events/guildMemberAdd.js:7:60)
at Client.emit (node:events:513:28)
at Object.run (/usr/clarence/src/src/slashCommands/debugging/simjoin.js:20:10)
at Client.<anonymous> (/usr/clarence/src/src/events/interactionCreate.js:24:7)
at Client.emit (node:events:513:28)
at InteractionCreateAction.handle (/usr/clarence/src/node_modules/discord.js/src/client/actions/InteractionCreate.js:83:12)
at Object.module.exports [as INTERACTION_CREATE] (/usr/clarence/src/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (/usr/clarence/src/node_modules/discord.js/src/client/websocket/WebSocketManager.js:346:31)
at WebSocketShard.onPacket (/usr/clarence/src/node_modules/discord.js/src/client/websocket/WebSocketShard.js:482:22)
When running in a docker container, I get the above error
G0maa commented
Me too, in addition to this:
/usr/clarence/src/src/events/ready.js:8
const { memberCount } = client.guilds.cache.get('744586833135927366');
^
TypeError: Cannot destructure property 'memberCount' of 'client.guilds.cache.get(...)' as it is undefined.
at Timeout._onTimeout (/usr/clarence/src/src/events/ready.js:8:11)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
While I'm not sure if they're related to /simulatejoin
, I'll try investigating the issue.
Also, we really need documentation for this repo (development & production wise) 😬