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

Commit 00a7833

Browse files
authored
Update discord/interactions (#12)
* Update discord/interactions * Ephemeral interaction responses
1 parent a538d25 commit 00a7833

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"symfony/options-resolver": "^5.2",
1616
"monolog/monolog": "^2.2",
1717
"guzzlehttp/guzzle": "^7.2",
18-
"discord/interactions": "1.0.7",
18+
"discord/interactions": "^1.0.8",
1919
"discord-php/http": "^8"
2020
},
2121
"autoload": {

src/Discord/Parts/Interaction.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,12 @@ public function acknowledge(?bool $source = true)
125125
* @param bool $tts Whether the message should be text-to-speech.
126126
* @param array[]|Embed[]|null $embeds An array of up to 10 embeds. Can also be an array of DiscordPHP embeds.
127127
* @param array|null $allowed_mentions Allowed mentions object. See Discord developer docs.
128+
* @param int|null $flags Set to 64 to make your response ephemeral
128129
*
129130
* Source is unused
130131
* @see https://discord.com/developers/docs/change-log#changes-to-slash-command-response-types-and-flags
131132
*/
132-
public function reply(string $content, bool $tts = false, array $embeds = [], ?array $allowed_mentions = null, bool $source = false)
133+
public function reply(string $content, bool $tts = false, array $embeds = [], ?array $allowed_mentions = null, ?bool $source = false, ?int $flags = null)
133134
{
134135
$embeds = array_map(function ($e) {
135136
if ($e instanceof Embed) {
@@ -144,6 +145,7 @@ public function reply(string $content, bool $tts = false, array $embeds = [], ?a
144145
'tts' => $tts,
145146
'embeds' => $embeds,
146147
'allowed_mentions' => $allowed_mentions,
148+
'flags' => $flags,
147149
];
148150

149151
($this->resolve)([
@@ -162,10 +164,11 @@ public function reply(string $content, bool $tts = false, array $embeds = [], ?a
162164
* @param bool $tts
163165
* @param array|null $embeds
164166
* @param array|null $allowed_mentions
167+
* @param int|null $flags
165168
*/
166-
public function replyWithSource(string $content, bool $tts = false, ?array $embeds = null, ?array $allowed_mentions = null)
169+
public function replyWithSource(string $content, bool $tts = false, ?array $embeds = null, ?array $allowed_mentions = null, ?int $flags = null)
167170
{
168-
$this->reply($content, $tts, $embeds, $allowed_mentions, true);
171+
$this->reply($content, $tts, $embeds, $allowed_mentions, true, $flags);
169172
}
170173

171174
/**

0 commit comments

Comments
 (0)