Skip to content

Commit

Permalink
✨ REQUEST_SOUNDBOARD_SOUNDS op codes and requestSoundboardSounds func…
Browse files Browse the repository at this point in the history
…tion (#1260)
  • Loading branch information
valzargaming authored Sep 30, 2024
1 parent 5ca37f2 commit ef92bc7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Discord/Discord.php
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,23 @@ protected function connectWs(): void
});
}

/**
* Requests soundboard sounds for the specified guilds.
*
* @param array $guildIds Array of guild IDs.
*/
public function requestSoundboardSounds(array $guildIds): void
{
$payload = [
'op' => Op::REQUEST_SOUNDBOARD_SOUNDS,
'd' => [
'guild_ids' => $guildIds
],
];

$this->send($payload);
}

/**
* Sends a packet to the Discord gateway.
*
Expand Down
3 changes: 3 additions & 0 deletions src/Discord/WebSockets/Op.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ class Op
/** A client has disconnected from the voice channel. */
public const VOICE_CLIENT_DISCONNECT = 13;

/** Request soundboard sounds. */
public const REQUEST_SOUNDBOARD_SOUNDS = 31;

/**
* Gateway Close Event Codes.
*
Expand Down

0 comments on commit ef92bc7

Please sign in to comment.