Skip to content

Commit

Permalink
Merge pull request #1173 from discord-php/v7.3.x-dev
Browse files Browse the repository at this point in the history
Merge V7.3.x dev to v7
SQKo authored Aug 26, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 4c22972 + e9b18c1 commit c66defc
Showing 5 changed files with 25 additions and 19 deletions.
6 changes: 6 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -8,6 +8,12 @@
"email": "[email protected]"
}
],
"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",
10 changes: 5 additions & 5 deletions src/Discord/CommandClient/Command.php
Original file line number Diff line number Diff line change
@@ -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
12 changes: 6 additions & 6 deletions src/Discord/DiscordCommandClient.php
Original file line number Diff line number Diff line change
@@ -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.
*/
14 changes: 7 additions & 7 deletions src/Discord/Parts/Embed/Embed.php
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion src/Discord/Parts/Interactions/Interaction.php
Original file line number Diff line number Diff line change
@@ -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.'));
}

0 comments on commit c66defc

Please sign in to comment.