Apply fixes from StyleCI

This commit is contained in:
Daniil Gentili 2017-08-05 15:43:25 +00:00 committed by StyleCI Bot
parent d95e46e292
commit 306125a931
2 changed files with 7 additions and 3 deletions

View File

@ -102,8 +102,10 @@ $calls = [];
$offset = $update['update_id'] + 1; // Just like in the bot API, the offset must be set to the last update_id
switch ($update['update']['_']) {
case 'updateNewMessage':
include('songs.php');
if ($update['update']['message']['out'] || $update['update']['message']['to_id']['_'] !== 'peerUser' || !isset($update['update']['message']['from_id'])) continue;
include 'songs.php';
if ($update['update']['message']['out'] || $update['update']['message']['to_id']['_'] !== 'peerUser' || !isset($update['update']['message']['from_id'])) {
continue;
}
try {
$MadelineProto->messages->sendMessage(['peer' => $update['update']['message']['from_id'], 'message' => 'Call me!']);
} catch (\danog\MadelineProto\RPCErrorException $e) {

View File

@ -8,4 +8,6 @@ $songs = [
// 'Swingrowers - Butterfly' => 'inputc.raw',
// 'Postmodern Jukebox - Thrift Shop' => 'inputd.raw',
];
for ($x = 0; $x < count($songs); $x++) { shuffle($songs); }
for ($x = 0; $x < count($songs); $x++) {
shuffle($songs);
}