> For the complete documentation index, see [llms.txt](https://guide.touchguild.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.touchguild.com/managing-messages/tips.md).

# 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:

```javascript
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

Learn more: [Check out how this concept works to optimize your time interacting with parent messages/responses.](/managing-messages/original-message-concept-and-how-it-works.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://guide.touchguild.com/managing-messages/tips.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
