Home > Enterprise >  How do i get all console logs to a discord text/embed message?
How do i get all console logs to a discord text/embed message?

Time:09-22

How do i get all console logs to a discord text/embed message ? I tried reading node.js documentations for console but couldn't find or understand information in general

CodePudding user response:

are you trying to get all messages of a particular channel? you can do this like this code

const channel = client.channels.cache.get("Your channel ID");
channel.messages.fetch({ limit: 100 }).then(messages => {
  console.log(`Fetched ${messages.size} messages Successfully`);
  messages.forEach(message => 
     console.log(message.content))
})

you can only fetch maximum 100 message at a time

  • Related