Answers for "message.author"

0

message.author

// Fetching a message by ID (Discord.js versions 9 through 11)
// note: you can line return right before a "dot" in JS, that is valid.
message.channel.fetchMessages({around: "352292052538753025", limit: 1})
  .then(messages => {
    const fetchedMsg = messages.first(); // messages is a collection!)
    // do something with it
    fetchedMsg.edit("This fetched message was edited");
  });

// THIS CHANGES IN DISCORD VERSION 12!!!!!
message.channel.messages.fetch({around: "352292052538753025", limit: 1})
  .then(messages => {
    messages.first().edit("This fetched message was edited");
  });
Posted by: Guest on February-07-2021
0

message.author

// Editing a message the bot sent
message.channel.send("Test").then(sentMessage => sentMessage.edit("Blah"));
// message now reads : "Blah"
Posted by: Guest on February-07-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language