|
24 | 24 | *
|
25 | 25 | * @since 7.1.0
|
26 | 26 | *
|
27 |
| - * @property int $type The type of the command, defaults 1 if not set. |
28 |
| - * @property string $name 1-32 character name of the command. |
29 |
| - * @property ?string[]|null $name_localizations Localization dictionary for the name field. Values follow the same restrictions as name. |
30 |
| - * @property ?string $description 1-100 character description for CHAT_INPUT commands, empty string for USER and MESSAGE commands. |
31 |
| - * @property ?string[]|null $description_localizations Localization dictionary for the description field. Values follow the same restrictions as description. |
32 |
| - * @property \Discord\Helpers\Collection|Option[]|null $options The parameters for the command, max 25. Only for Slash command (CHAT_INPUT). |
33 |
| - * @property ?string $default_member_permissions Set of permissions represented as a bit set. |
34 |
| - * @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. |
35 |
| - * @property ?bool $default_permission Whether the command is enabled by default when the app is added to a guild. SOON DEPRECATED. |
36 |
| - * @property ?int $guild_id The optional guild ID this command is for. If not set, the command is global. |
37 |
| - * @property bool|null $nsfw Indicates whether the command is age-restricted, defaults to `false`. |
| 27 | + * @property int $type The type of the command, defaults 1 if not set. |
| 28 | + * @property string $name 1-32 character name of the command. |
| 29 | + * @property ?string[]|null $name_localizations Localization dictionary for the name field. Values follow the same restrictions as name. |
| 30 | + * @property ?string $description 1-100 character description for CHAT_INPUT commands, empty string for USER and MESSAGE commands. |
| 31 | + * @property ?string[]|null $description_localizations Localization dictionary for the description field. Values follow the same restrictions as description. |
| 32 | + * @property \Discord\Helpers\CollectionInterface|Option[]|null $options The parameters for the command, max 25. Only for Slash command (CHAT_INPUT). |
| 33 | + * @property ?string $default_member_permissions Set of permissions represented as a bit set. |
| 34 | + * @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. |
| 35 | + * @property ?bool $default_permission Whether the command is enabled by default when the app is added to a guild. SOON DEPRECATED. |
| 36 | + * @property ?int $guild_id The optional guild ID this command is for. If not set, the command is global. |
| 37 | + * @property bool|null $nsfw Indicates whether the command is age-restricted, defaults to `false`. |
38 | 38 | */
|
39 | 39 | trait CommandAttributes
|
40 | 40 | {
|
@@ -279,8 +279,8 @@ public function removeOption(Option $option): self
|
279 | 279 | throw new \DomainException('Only CHAT_INPUT Command type can have option.');
|
280 | 280 | }
|
281 | 281 |
|
282 |
| - if (isset($this->options) && ($idx = array_search($option, $this->options)) !== false) { |
283 |
| - array_splice($this->options, $idx, 1); |
| 282 | + if (isset($this->options) && ($idx = $this->options->search($option)) !== false) { |
| 283 | + $this->options->splice($idx, 1); |
284 | 284 | }
|
285 | 285 |
|
286 | 286 | return $this;
|
|
0 commit comments