Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge V7.3.x dev to v7 #1173

Merged
merged 5 commits into from
Aug 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions src/Discord/CommandClient/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Command
*/
protected $client;
/**
* @var Callable
* @var callable
*/
protected $callable;

Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Discord/Discord.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Discord
*
* @var string Version.
*/
public const VERSION = 'v7.3.3';
public const VERSION = 'v7.3.4';

/**
* The logger.
Expand Down
12 changes: 6 additions & 6 deletions src/Discord/DiscordCommandClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
*/
Expand Down
14 changes: 7 additions & 7 deletions src/Discord/Parts/Embed/Embed.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Discord/Parts/Interactions/Interaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.'));
}

Expand Down