Skip to content
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
15 changes: 13 additions & 2 deletions src/Discord/Parts/Channel/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
* @property bool|null $nsfw Whether the channel is NSFW.
* @property ?string|null $last_message_id The unique identifier of the last message sent in the channel (or thread for forum channels) (may not point to an existing or valid message or thread).
* @property int|null $bitrate The bitrate of the channel. Only for voice channels.
* @property int|null $user_limit The user limit of the channel.
* @property int|null $user_limit The user limit of the channel. Max 99 for voice channels and 10000 for stage channels (0 refers to no limit).
* @property int|null $rate_limit_per_user Amount of seconds a user has to wait before sending a new message (slow mode).
* @property Collection|User[] $recipients A collection of all the recipients in the channel. Only for DM or group channels.
* @property-read User|null $recipient The first recipient of the channel. Only for DM or group channels.
Expand Down Expand Up @@ -1299,7 +1299,16 @@ public function allowInvite()
*/
public function isTextBased()
{
return in_array($this->type, [self::TYPE_GUILD_TEXT, self::TYPE_DM, self::TYPE_GUILD_VOICE, self::TYPE_GROUP_DM, self::TYPE_PUBLIC_THREAD, self::TYPE_PRIVATE_THREAD, self::TYPE_GUILD_ANNOUNCEMENT]);
return in_array($this->type, [
self::TYPE_GUILD_TEXT,
self::TYPE_DM,
self::TYPE_GUILD_VOICE,
self::TYPE_GROUP_DM,
self::TYPE_PUBLIC_THREAD,
self::TYPE_PRIVATE_THREAD,
self::TYPE_GUILD_ANNOUNCEMENT,
self::TYPE_GUILD_STAGE_VOICE
]);
}

/**
Expand Down Expand Up @@ -1419,7 +1428,9 @@ public function getUpdatableAttributes(): array
$attr['parent_id'] = $this->parent_id;
$attr['default_auto_archive_duration'] = $this->default_auto_archive_duration;
} elseif ($this->type == self::TYPE_GUILD_STAGE_VOICE) {
$attr['nsfw'] = $this->nsfw;
$attr['rate_limit_per_user'] = $this->rate_limit_per_user;
$attr['user_limit'] = $this->user_limit;
$attr['parent_id'] = $this->parent_id;
$attr['bitrate'] = $this->bitrate;
$attr['rtc_region'] = $this->rtc_region;
Expand Down
4 changes: 4 additions & 0 deletions src/Discord/Parts/Channel/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ class Message extends Part
public const TYPE_AUTO_MODERATION_ACTION = 24;
public const TYPE_ROLE_SUBSCRIPTION_PURCHASE = 25;
public const TYPE_INTERACTION_PREMIUM_UPSELL = 26;
public const TYPE_STAGE_START = 27;
public const TYPE_STAGE_END = 28;
public const TYPE_STAGE_SPEAKER = 29;
public const TYPE_STAGE_TOPIC = 31;
public const TYPE_GUILD_APPLICATION_PREMIUM_SUBSCRIPTION = 32;

/** @deprecated 7.1.0 Use `Message::TYPE_USER_JOIN` */
Expand Down
34 changes: 12 additions & 22 deletions src/Discord/Parts/Permissions/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ abstract class Permission extends Part
* @var array
*/
public const STAGE_PERMISSIONS = [
'stream' => 9,
'connect' => 20,
'mute_members' => 22,
'deafen_members' => 23,
'move_members' => 24,
'request_to_speak' => 32,
'manage_events' => 33,
Expand All @@ -54,25 +54,15 @@ abstract class Permission extends Part
* @var array
*/
public const VOICE_PERMISSIONS = [
'add_reactions' => 6,
'priority_speaker' => 8,
'stream' => 9,
'send_messages' => 11,
'send_tts_messages' => 12,
'manage_messages' => 13,
'embed_links' => 14,
'attach_files' => 15,
'read_message_history' => 16,
'use_external_emojis' => 18,
'connect' => 20,
'speak' => 21,
'mute_members' => 22,
'deafen_members' => 23,
'move_members' => 24,
'use_vad' => 25,
'manage_webhooks' => 29,
'manage_events' => 33,
'use_external_stickers' => 37,
'use_embedded_activities' => 39,
];

Expand All @@ -83,20 +73,9 @@ abstract class Permission extends Part
* @var array
*/
public const TEXT_PERMISSIONS = [
'add_reactions' => 6,
'send_messages' => 11,
'send_tts_messages' => 12,
'manage_messages' => 13,
'embed_links' => 14,
'attach_files' => 15,
'read_message_history' => 16,
'use_external_emojis' => 18,
'manage_webhooks' => 29,
'use_application_commands' => 31,
'manage_threads' => 34,
'create_public_threads' => 35,
'create_private_threads' => 36,
'use_external_stickers' => 37,
'send_messages_in_threads' => 38,
];

Expand Down Expand Up @@ -129,9 +108,20 @@ abstract class Permission extends Part
public const ALL_PERMISSIONS = [
'create_instant_invite' => 0,
'manage_channels' => 4,
'add_reactions' => 6,
'view_channel' => 10,
'send_messages' => 11,
'send_tts_messages' => 12,
'manage_messages' => 13,
'embed_links' => 14,
'attach_files' => 15,
'read_message_history' => 16,
'mention_everyone' => 17,
'use_external_emojis' => 18,
'manage_roles' => 28,
'manage_webhooks' => 29,
'use_application_commands' => 31,
'use_external_stickers' => 37,
];

/**
Expand Down