# Original Message concept & how it works

## Types of Original Messages

In fact, there are two types of original messages, the "original trigger" and the "original response".&#x20;

### What does that mean?

#### Original Trigger Message

The original trigger is the message sent, that will trigger a response from your application, it is mostly the one the user sends to interact with your app.

#### Original Response Message

The original response is the first response to a trigger message, it is the original response to a user interacting with your app, making it trigger that "original response".

## What can I do with that?

It is a powerful feature that enables you to get and interact both the trigger message and the original response, or sometimes one of them, or both aren't available.

For example, you're making an interaction that uses multiple messages, you can get with the latest message sent the original response, and get, edit or delete it accordingly.

But you can also get the trigger message if you have the original response.

This ease of access enables you to get components that you wouldn't be able to get, to optimize your program and also, to gain a considerable amount of time while making it easier to read.

### Methods

#### Here are the methods you can use that uses this concept:

* getOriginal -> Get the response (prioritized) or the trigger. \
  (you can still choose specifically which one to get)
* getOriginals -> Get both, trigger and response.
* editOriginal -> Edit the original message (only original response can be edited)
* deleteOriginal -> Delete the original message (response prioritized, can be changed)

### Properties & Getters

#### Here are the properties that makes this concept what it is:

* isOriginal -> Getter that returns either "trigger", "response" or the boolean state "false".
* originals.responseID -> ID of the original response.
* originals.triggerID -> ID of the original trigger message.

### Behavior

#### The behavior is the following:

* User Message -> getOriginal() -> Error
* Original response -> getOriginal() -> User Message
* Response message -> getOriginal() -> Original Response

### Example

<pre class="language-javascript"><code class="lang-javascript"><strong>// Context: Message#content = "User Message"
</strong><strong>client.on('messageCreate', async message => {
</strong>  if ((await userMessage.member)?.app) return;
  const originalRes = await userMessage.createMessage({ content: "Original Response" });
  const responseMessage = await userMessage.createFollowup({ content: "Response Message" });
  
  // Access Hierarchy:
  // #1 -- User Message
  // #2 --- Original Response
  // #2 ----- Response Message
  // The access is always the parent.
  
  // Behavior:
  console.log(await userMessage.getOriginal()) // Error (no parent original)
  console.log(await originalRes.getOriginal()); // User Message
  console.log(await responseMessage.getOriginal()); // Original Response
  
  // You can also use other methods that are using Original
  // to perform various actions on the original such as editing it, or deleting it
})
</code></pre>


---

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

```
GET https://guide.touchguild.com/managing-messages/original-message-concept-and-how-it-works.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
