Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» Add guild_id support to the command attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x committed Jul 18, 2024
1 parent 6c6b6fc commit 58a9dfe
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/Discord/Builders/CommandAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@
* @property int $type The type of the command, defaults 1 if not set.
* @property string $name 1-32 character name of the command.
* @property ?string[]|null $name_localizations Localization dictionary for the name field. Values follow the same restrictions as name.
* @property string $description 1-100 character description for CHAT_INPUT commands, empty string for USER and MESSAGE commands.
* @property ?string $description 1-100 character description for CHAT_INPUT commands, empty string for USER and MESSAGE commands.
* @property ?string[]|null $description_localizations Localization dictionary for the description field. Values follow the same restrictions as description.
* @property \Discord\Helpers\Collection|Option[]|null $options The parameters for the command, max 25. Only for Slash command (CHAT_INPUT).
* @property ?string $default_member_permissions Set of permissions represented as a bit set.
* @property bool|null $dm_permission Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible.
* @property ?bool $default_permission Whether the command is enabled by default when the app is added to a guild. SOON DEPRECATED.
* @property ?int $guild_id The optional guild ID this command is for. If not set, the command is global.
* @property bool|null $nsfw Indicates whether the command is age-restricted, defaults to `false`.
*/
trait CommandAttributes
Expand Down Expand Up @@ -208,6 +209,20 @@ public function setDmPermission(bool $permission): self
return $this;
}

/**
* Sets the guild ID of the command.
*
* @param int $guildId Guild ID of the command.
*
* @return $this
*/
public function setGuildId(int $guildId): self
{
$this->guild_id = $guildId;

return $this;
}

/**
* Sets the age restriction of the command.
*
Expand Down

0 comments on commit 58a9dfe

Please sign in to comment.