mirror of
https://github.com/danog/MadelineProto.git
synced 2025-01-22 14:51:17 +01:00
Some features
This commit is contained in:
parent
296dcb8147
commit
b0aff44321
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
songs.php
|
||||
_site
|
||||
|
||||
# JetBrains IDE
|
||||
|
@ -102,6 +102,14 @@ $calls = [];
|
||||
\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
|
||||
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':
|
||||
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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user