Skip to content
Discussion options

You must be logged in to vote

So if anyone followed me till here actually you would need to fetch the messages by force
Example

app.get("/info", async function (req, res) {
  const { user_id } = req.query;
  if (!user_id) return res.status(400).json({ error: "Missing user_id" });
  if (!client) return res.status(400).json({ error: "Client not initialized" });
  const channel = client.channels.cache.get(process.env.BOT_COMMANDS_ID);
  if (!channel) return res.status(400).json({ error: "Channel not found" });

  channel
    .awaitMessages({
      max: 1,
    })
    .then(async (collected) => {
      const d = await channel.messages.fetch(collected.first().id, { force: true });
      res.status(200).json(d);
    });

  c…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@TejasLamba2006
Comment options

@TheDevYellowy
Comment options

@TejasLamba2006
Comment options

@TheDevYellowy
Comment options

@TejasLamba2006
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by TejasLamba2006
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants