From 96d9d45ec2297c2abe8c9cd038990ec346582d3e Mon Sep 17 00:00:00 2001 From: Alexander Maassen Date: Fri, 13 Jan 2023 13:19:01 +0100 Subject: [PATCH 1/5] Fix callable typehints #1033 --- src/Discord/CommandClient/Command.php | 10 +++++----- src/Discord/DiscordCommandClient.php | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Discord/CommandClient/Command.php b/src/Discord/CommandClient/Command.php index 2457a025a..f17c41f88 100644 --- a/src/Discord/CommandClient/Command.php +++ b/src/Discord/CommandClient/Command.php @@ -86,7 +86,7 @@ class Command */ protected $client; /** - * @var Callable + * @var callable */ protected $callable; @@ -95,7 +95,7 @@ class Command * * @param DiscordCommandClient $client The Discord Command Client. * @param string $command The command trigger. - * @param \Callable $callable The callable function. + * @param callable $callable The callable function. * @param string $description The short description of the command. * @param string $longDescription The long description of the command. * @param string $usage The usage of the command. @@ -146,9 +146,9 @@ public function getCommand(string $command, bool $aliases = true): ?Command /** * Registers a new command. * - * @param string $command The command name. - * @param \Callable|string $callable The function called when the command is executed. - * @param array $options An array of options. + * @param string $command The command name. + * @param callable|string $callable The function called when the command is executed. + * @param array $options An array of options. * * @return Command The command instance. * @throws \Exception diff --git a/src/Discord/DiscordCommandClient.php b/src/Discord/DiscordCommandClient.php index febed25cb..fccafea74 100644 --- a/src/Discord/DiscordCommandClient.php +++ b/src/Discord/DiscordCommandClient.php @@ -223,9 +223,9 @@ protected function checkForPrefix(string $content): ?string /** * Registers a new command. * - * @param string $command The command name. - * @param \Callable|string $callable The function called when the command is executed. - * @param array $options An array of options. + * @param string $command The command name. + * @param callable|string $callable The function called when the command is executed. + * @param array $options An array of options. * * @return Command The command instance. * @throws \Exception @@ -317,9 +317,9 @@ public function getCommand(string $command, bool $aliases = true): ?Command /** * Builds a command and returns it. * - * @param string $command The command name. - * @param \Callable|string $callable The function called when the command is executed. - * @param array $options An array of options. + * @param string $command The command name. + * @param callable|string $callable The function called when the command is executed. + * @param array $options An array of options. * * @return Command[]|array[] The command instance and options. */ From e659478488aa3b966f2fbd5710bc7965dca86ca8 Mon Sep 17 00:00:00 2001 From: Alexander Maassen Date: Fri, 13 Jan 2023 13:22:31 +0100 Subject: [PATCH 2/5] Update Embed.php #1036 --- src/Discord/Parts/Embed/Embed.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Discord/Parts/Embed/Embed.php b/src/Discord/Parts/Embed/Embed.php index a061b5d67..f6da5fcbb 100644 --- a/src/Discord/Parts/Embed/Embed.php +++ b/src/Discord/Parts/Embed/Embed.php @@ -326,15 +326,15 @@ public function addFieldValues(string $name, string $value, bool $inline = false /** * Set the author of this embed. * - * @param string $name Maximum length is 256 characters. - * @param string $iconurl The URL to the icon. - * @param string $url The URL to the author. + * @param string $name Maximum length is 256 characters. + * @param string|null $iconurl The URL to the icon. + * @param string|null $url The URL to the author. * * @throws \LengthException * * @return self */ - public function setAuthor(string $name, string $iconurl = '', string $url = ''): self + public function setAuthor(string $name, ?string $iconurl = null, ?string $url = null): self { if (poly_strlen($name) === 0) { $this->author = null; @@ -356,14 +356,14 @@ public function setAuthor(string $name, string $iconurl = '', string $url = ''): /** * Set the footer of this embed. * - * @param string $text Maximum length is 2048 characters. - * @param string $iconurl The URL to the icon. + * @param string $text Maximum length is 2048 characters. + * @param string|null $iconurl The URL to the icon. * * @throws \LengthException * * @return self */ - public function setFooter(string $text, string $iconurl = ''): self + public function setFooter(string $text, ?string $iconurl = null): self { if (poly_strlen($text) === 0) { $this->footer = null; From 82843da4346878a432171f8d82e345389f7cc49b Mon Sep 17 00:00:00 2001 From: Alexander Maassen Date: Fri, 13 Jan 2023 13:37:14 +0100 Subject: [PATCH 3/5] Version update --- src/Discord/Discord.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Discord/Discord.php b/src/Discord/Discord.php index 7a92c238d..c5c8219c0 100644 --- a/src/Discord/Discord.php +++ b/src/Discord/Discord.php @@ -86,7 +86,7 @@ class Discord * * @var string Version. */ - public const VERSION = 'v7.3.3'; + public const VERSION = 'v7.3.4'; /** * The logger. From a25ab0aad7ef1c22e59ef6e63e9be48a6c489cd2 Mon Sep 17 00:00:00 2001 From: Alexander Maassen Date: Fri, 13 Jan 2023 14:52:33 +0100 Subject: [PATCH 4/5] Update composer.json --- composer.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/composer.json b/composer.json index 8ba9df2b1..1486dfc76 100644 --- a/composer.json +++ b/composer.json @@ -8,6 +8,12 @@ "email": "david.cole1340@gmail.com" } ], + "support": { + "issues": "https://github.com/discord-php/DiscordPHP/issues", + "wiki": "https://github.com/discord-php/DiscordPHP/wiki", + "docs": "https://discord-php.github.io/DiscordPHP/", + "chat": "https://discord.gg/dphp" + }, "require": { "php": "^7.4|^8.0", "nesbot/carbon": "^2.38", From e9b18c184c692699f216083337218e78f485f3f9 Mon Sep 17 00:00:00 2001 From: Alexander Maassen Date: Fri, 13 Jan 2023 15:03:37 +0100 Subject: [PATCH 5/5] Update Interaction.php #1038 --- src/Discord/Parts/Interactions/Interaction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Discord/Parts/Interactions/Interaction.php b/src/Discord/Parts/Interactions/Interaction.php index 18d664229..f556fbedc 100644 --- a/src/Discord/Parts/Interactions/Interaction.php +++ b/src/Discord/Parts/Interactions/Interaction.php @@ -260,7 +260,7 @@ public function acknowledgeWithResponse(bool $ephemeral = false): ExtendedPromis */ public function updateMessage(MessageBuilder $builder): ExtendedPromiseInterface { - if ($this->type != InteractionType::MESSAGE_COMPONENT) { + if (! in_array($this->type, [InteractionType::MESSAGE_COMPONENT, InteractionType::MODAL_SUBMIT])) { return reject(new \LogicException('You can only update messages that occur due to a message component interaction.')); }