Skip to content

Commit 862e0a1

Browse files
committed
remove unused, unreachable, duplicated code
1 parent 94352a6 commit 862e0a1

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

src/Discord/Discord.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,8 +1160,6 @@ public function updatePresence(Activity $activity = null, bool $idle = false, st
11601160

11611161
if (! in_array($activity['type'], [Activity::TYPE_GAME, Activity::TYPE_STREAMING, Activity::TYPE_LISTENING, Activity::TYPE_WATCHING, Activity::TYPE_CUSTOM, Activity::TYPE_COMPETING])) {
11621162
throw new \UnexpectedValueException("The given activity type ({$activity['type']}) is invalid.");
1163-
1164-
return;
11651163
}
11661164
}
11671165

@@ -1203,13 +1201,15 @@ public function getVoiceClient(string $guild_id): ?VoiceClient
12031201
* @param bool $mute Whether you should be mute when you join the channel.
12041202
* @param bool $deaf Whether you should be deaf when you join the channel.
12051203
* @param LoggerInterface|null $logger Voice client logger. If null, uses same logger as Discord client.
1206-
* @param bool $check Whether to check for system requirements.
12071204
*
12081205
* @throws \RuntimeException
12091206
*
1207+
* @since 10.0.0 Removed argument $check that has no effect (it is always checked)
1208+
* @since 4.0.0
1209+
*
12101210
* @return PromiseInterface
12111211
*/
1212-
public function joinVoiceChannel(Channel $channel, $mute = false, $deaf = true, ?LoggerInterface $logger = null, bool $check = true): ExtendedPromiseInterface
1212+
public function joinVoiceChannel(Channel $channel, $mute = false, $deaf = true, ?LoggerInterface $logger = null): ExtendedPromiseInterface
12131213
{
12141214
$deferred = new Deferred();
12151215

@@ -1241,7 +1241,7 @@ public function joinVoiceChannel(Channel $channel, $mute = false, $deaf = true,
12411241
$this->removeListener(Event::VOICE_STATE_UPDATE, $voiceStateUpdate);
12421242
};
12431243

1244-
$voiceServerUpdate = function ($vs, $discord) use ($channel, &$data, &$voiceServerUpdate, $deferred, $logger, $check) {
1244+
$voiceServerUpdate = function ($vs, $discord) use ($channel, &$data, &$voiceServerUpdate, $deferred, $logger) {
12451245
if ($vs->guild_id != $channel->guild_id) {
12461246
return; // This voice server update isn't for our guild.
12471247
}
@@ -1274,7 +1274,7 @@ public function joinVoiceChannel(Channel $channel, $mute = false, $deaf = true,
12741274
unset($this->voiceClients[$channel->guild_id]);
12751275
});
12761276

1277-
$vc->start($check);
1277+
$vc->start();
12781278

12791279
$this->voiceLoggers[$channel->guild_id] = $logger;
12801280
$this->removeListener(Event::VOICE_SERVER_UPDATE, $voiceServerUpdate);

src/Discord/Voice/VoiceClient.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,6 @@ public function __construct(WebSocket $websocket, LoopInterface $loop, Channel $
378378
/**
379379
* Starts the voice client.
380380
*
381-
* @param bool $check
382-
*
383381
* @return void|bool
384382
*/
385383
public function start()

src/Discord/functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
'lightsalmon' => 0xffa07a, 'crimson' => 0xdc143c, 'red' => 0xff0000, 'firebrick' => 0xb22222,
3838
'darkred' => 0x8b0000, 'pink' => 0xffc0cb, 'lightpink' => 0xffb6c1, 'hotpink' => 0xff69b4,
3939
'deeppink' => 0xff1493, 'mediumvioletred' => 0xc71585, 'palevioletred' => 0xdb7093,
40-
'lightsalmon' => 0xffa07a, 'coral' => 0xff7f50, 'tomato' => 0xff6347, 'orangered' => 0xff4500,
40+
'coral' => 0xff7f50, 'tomato' => 0xff6347, 'orangered' => 0xff4500,
4141
'darkorange' => 0xff8c00, 'orange' => 0xffa500, 'gold' => 0xffd700, 'yellow' => 0xffff00,
4242
'lightyellow' => 0xffffe0, 'lemonchiffon' => 0xfffacd, 'lightgoldenrodyellow' => 0xfafad2,
4343
'papayawhip' => 0xffefd5, 'moccasin' => 0xffe4b5, 'peachpuff' => 0xffdab9, 'palegoldenrod' => 0xeee8aa,
@@ -57,7 +57,7 @@
5757
'darkturquoise' => 0x00ced1, 'cadetblue' => 0x5f9ea0, 'steelblue' => 0x4682b4, 'lightsteelblue' => 0xb0c4de,
5858
'powderblue' => 0xb0e0e6, 'lightblue' => 0xadd8e6, 'skyblue' => 0x87ceeb, 'lightskyblue' => 0x87cefa,
5959
'deepskyblue' => 0x00bfff, 'dodgerblue' => 0x1e90ff, 'cornflowerblue' => 0x6495ed,
60-
'mediumslateblue' => 0x7b68ee, 'royalblue' => 0x4169e1, 'blue' => 0x0000ff, 'mediumblue' => 0x0000cd,
60+
'royalblue' => 0x4169e1, 'blue' => 0x0000ff, 'mediumblue' => 0x0000cd,
6161
'darkblue' => 0x00008b, 'navy' => 0x000080, 'midnightblue' => 0x191970, 'cornsilk' => 0xfff8dc,
6262
'blanchedalmond' => 0xffebcd, 'bisque' => 0xffe4c4, 'navajowhite' => 0xffdead, 'wheat' => 0xf5deb3,
6363
'burlywood' => 0xdeb887, 'tan' => 0xd2b48c, 'rosybrown' => 0xbc8f8f, 'sandybrown' => 0xf4a460,

0 commit comments

Comments
 (0)