Discord-user-bots
Discord-user-bots copied to clipboard
Missing properties on channels
currently, {channel.name} and for {channel.id} for forum posts are undefined. i guess if someone would be good enough to add support for them i would be greatful
code :
client.on.message_create = function (message) {
const guild = client.info.guilds.filter((guild) => guild.id == message.guild_id)[0];
const channel = guild.channels.filter((channel) => channel.id == message.channel_id)[0];
if (guild.name == "instaling fresh bot")
console.log(`[${guild.name}] [#${channel.id}] ${message.author.username}: ${message.content}`);
};
input :

expected output :
[instaling fresh bot] [(thread id) #1102685991933853746] rudy3: ur such a nerd 🤓
actual output :
console.log(`[${guild.name}] [#${channel.id}] ${message.author.username}: ${message.content}`);
TypeError: Cannot read properties of undefined (reading 'id')
at client.on.message_create (C:\Users\mmax3\Downloads\NanaEmojiDecipher\main.js:16:49)
at WebSocket.<anonymous> (C:\Users\mmax3\Downloads\NanaEmojiDecipher\node_modules\discord-user-
bots\src\client\client.js:374:37)
Update : Using message.channel_id seems to do the trick,
Discord is very inconsistent with their own API. DUB does not have any structures defined for Discord, so all data that is passed by DUB is raw body data from Discord.