I try to get a message by id in discord.js, but returned MessageManager is a circular dependency and I cannot access any of it’s properties.
console.log(channel.messages)
Shows:
<ref *2> MessageManager {
channel: <ref *1> TextChannel {
type: 'GUILD_TEXT',
guild: Guild { ... }
And
channel.messages.fetch(msg_ID)
.then(msg => {
console.log(msg)
})
Shows this, but repeated 50 times:
'msg_ID' => <ref *50> Message {
channelId: 'channel_ID',
guildId: 'guild_ID',
id: 'msg_ID',
createdTimestamp: 1652473636758,
type: 'DEFAULT',
and a bunch of other fields (obviously I changed IDs to 'msg_ID'
, 'channel_ID'
and 'guild_ID'
, normally it returns proper numbers)