Skip to content
This repository was archived by the owner on Feb 18, 2023. It is now read-only.

Commit 5b7a099

Browse files
committed
add getter for response and follow up
1 parent c2f8d12 commit 5b7a099

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/Discord/Parts/Interaction.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,18 @@ public function replyWithSource(string $content, bool $tts = false, ?array $embe
153153
$this->reply($content, $tts, $embeds, $allowed_mentions, $flags);
154154
}
155155

156+
/**
157+
* Retrieves the original interaction response.
158+
*
159+
* @see https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response
160+
*
161+
* @return ExtendedPromiseInterface
162+
*/
163+
public function getOriginalResponse(): ExtendedPromiseInterface
164+
{
165+
return $this->http->get(\Discord\Http\Endpoint::bind(\Discord\Http\Endpoint::ORIGINAL_INTERACTION_RESPONSE, $this->application_id, $this->token));
166+
}
167+
156168
/**
157169
* Updates the original response to the interaction.
158170
* Must have already used `Interaction::reply()`.
@@ -270,6 +282,20 @@ public function updateFollowUpMessage($message_id, $content = null, array $embed
270282
return $this->http->patch(\Discord\Http\Endpoint::bind(\Discord\Http\Endpoint::INTERACTION_FOLLOW_UP, $this->application_id, $this->token, $message_id), $message);
271283
}
272284

285+
/**
286+
* Retrieves a non ephemeral follow up message.
287+
*
288+
* @see https://discord.com/developers/docs/interactions/receiving-and-responding#get-followup-message
289+
*
290+
* @param string $message_id Message to get.
291+
*
292+
* @return ExtendedPromiseInterface
293+
*/
294+
public function getFollowUpMessage(string $message_id): ExtendedPromiseInterface
295+
{
296+
return $this->http->get(\Discord\Http\Endpoint::bind(\Discord\Http\Endpoint::INTERACTION_FOLLOW_UP, $this->application_id, $this->token, $message_id));
297+
}
298+
273299
/**
274300
* Deletes a follow up message.
275301
*

0 commit comments

Comments
 (0)