@@ -1255,6 +1255,39 @@ protected function ready()
1255
1255
}
1256
1256
}
1257
1257
1258
+ /**
1259
+ * Updates the client's voice state in a guild.
1260
+ *
1261
+ * @param Guild|string $guild_id ID of the guild.
1262
+ * @param Channel|string|null $channel_id ID of the voice channel to join, or null to disconnect.
1263
+ * @param bool $self_mute Whether the client is muted.
1264
+ * @param bool $self_deaf Whether the client is deafened.
1265
+ *
1266
+ * @since 10.19.0
1267
+ */
1268
+ public function updateVoiceState ($ guild_id , $ channel_id = null , bool $ self_mute = false , bool $ self_deaf = false ): void
1269
+ {
1270
+ if (! is_string ($ guild_id )) {
1271
+ $ guild_id = $ guild_id ->id ;
1272
+ }
1273
+
1274
+ if (isset ($ channel_id ) && ! is_string ($ channel_id )) {
1275
+ $ channel_id = $ channel_id ->id ;
1276
+ }
1277
+
1278
+ $ payload = Payload::new (
1279
+ Op::OP_UPDATE_VOICE_STATE ,
1280
+ [
1281
+ 'guild_id ' => $ guild_id ,
1282
+ 'channel_id ' => $ channel_id ,
1283
+ 'self_mute ' => $ self_mute ,
1284
+ 'self_deaf ' => $ self_deaf ,
1285
+ ]
1286
+ );
1287
+
1288
+ $ this ->send ($ payload );
1289
+ }
1290
+
1258
1291
/**
1259
1292
* Updates the clients presence.
1260
1293
*
@@ -1287,7 +1320,7 @@ public function updatePresence(?Activity $activity = null, bool $idle = false, s
1287
1320
}
1288
1321
1289
1322
$ payload = Payload::new (
1290
- Op::OP_PRESENCE_UPDATE ,
1323
+ Op::OP_UPDATE_PRESENCE ,
1291
1324
[
1292
1325
'since ' => $ idle ,
1293
1326
'activities ' => [$ activity ],
0 commit comments