Some features
This commit is contained in:
parent
296dcb8147
commit
b0aff44321
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
|
songs.php
|
||||||
_site
|
_site
|
||||||
|
|
||||||
# JetBrains IDE
|
# JetBrains IDE
|
||||||
|
@ -102,6 +102,14 @@ $calls = [];
|
|||||||
\danog\MadelineProto\Logger::log([$update]);
|
\danog\MadelineProto\Logger::log([$update]);
|
||||||
$offset = $update['update_id'] + 1; // Just like in the bot API, the offset must be set to the last update_id
|
$offset = $update['update_id'] + 1; // Just like in the bot API, the offset must be set to the last update_id
|
||||||
switch ($update['update']['_']) {
|
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;
|
||||||
|
try {
|
||||||
|
$MadelineProto->messages->sendMessage(['peer' => $update['update']['message']['from_id'], 'message' => 'Call me!']);
|
||||||
|
} catch (\danog\MadelineProto\RPCErrorException $e) {
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'updatePhoneCall':
|
case 'updatePhoneCall':
|
||||||
if (is_object($update['update']['phone_call']) && isset($update['update']['phone_call']->madeline) && $update['update']['phone_call']->getCallState() === \danog\MadelineProto\VoIP::CALL_STATE_INCOMING) {
|
if (is_object($update['update']['phone_call']) && isset($update['update']['phone_call']->madeline) && $update['update']['phone_call']->getCallState() === \danog\MadelineProto\VoIP::CALL_STATE_INCOMING) {
|
||||||
include('songs.php');
|
include('songs.php');
|
||||||
|
@ -8,4 +8,4 @@ $songs = [
|
|||||||
// 'Swingrowers - Butterfly' => 'inputc.raw',
|
// 'Swingrowers - Butterfly' => 'inputc.raw',
|
||||||
'Postmodern Jukebox - Thrift Shop' => 'inputd.raw',
|
'Postmodern Jukebox - Thrift Shop' => 'inputd.raw',
|
||||||
];
|
];
|
||||||
shuffle($songs);
|
for ($x = 0; $x < count($songs); $x++) { shuffle($songs); }
|
||||||
|
Loading…
Reference in New Issue
Block a user