🎒
TouchGuild Guide
Get back Home
  • TouchGuild's Docs
  • Introduction
  • Privacy Policy
  • 📝Installation & Preparation
  • âš’ī¸Setting up an application
  • 🤖Creating your application
  • Intents
  • Application Commands
    • Registering
    • Command Interactions
    • Components
  • đŸ“ŦManaging messages
    • â„šī¸Tips
    • Original Message concept & how it works
    • Creating embeds
  • Permissions & Roles
  • 😰Reactions
  • Data & Analytics
  • Managing members
    • đŸ’¯Award experience to server members
    • đŸĻĩBan, unban & kick server members
Powered by GitBook
On this page
  • Introducing, lastMessage.
  • editLast & deleteLast
  • Original Messages

Was this helpful?

  1. Managing messages

Tips

Introducing, lastMessage.

Last Message is a group of methods that you can use, they've been built to boost your productivity, and are helping you to do simple actions without storing the last message, in other words, without writing 10 lines of codes for such simple things.

editLast & deleteLast

Allows you to edit/delete the last message sent with the message component itself:

client.on('messageCreate', async (message) => {
   const member = await message.member;
   if (member.app) return;
   await message.createMessage({content: "this is a message"}); // this is msg1
   await message.editLast({content: "msg1 is edited."});
   await message.createFollowup({content: "this is a message"}); // this is msg2
   await message.editLast({content: "msg2 is edited."});
   // The last message you sent is edited, allowing you to use the
   // the same message component instead of using a stored one.
   
   // this deletes msg2, which is in fact, the last message.
   await message.deleteLast();
})

Original Messages

PreviousManaging messagesNextOriginal Message concept & how it works

Last updated 9 months ago

Was this helpful?

Learn more:

đŸ“Ŧ
â„šī¸
Check out how this concept works to optimize your time interacting with parent messages/responses.