Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

97
Views
DiscordJS MessageManager is a circular dependency

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)

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Apparently this is caused by passing msg_ID as a Number. Most discord.js methods require their input being casted to String as specified here.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!