Added functions. Support for photos forward

This commit is contained in:
giuliof 2017-11-02 21:08:09 +01:00
parent 36337b3f37
commit 3c4ab2e0c9
3 changed files with 629 additions and 545 deletions

1153
main.php

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
*/
require_once('config.php');
require_once('shared.php');
require_once('functions.php');
if (DEBUG) botlog("\n\n\n".'[II] Scheduler starting at ' . date('Y-m-d H:i:s') . ' ====================' . "\n\n");

View File

@ -90,7 +90,7 @@
$disable_web_page_preview = false,
$reply_markup = null) {
$query = API_URL . API_TOKEN . "/forwardMessage?" .
$query = API_URL . API_TOKEN . "/editMessageText?" .
"chat_id=".urlencode($chat_id) .
"&message_id=" . urlencode($message_id).
"&text=" . urlencode($text);
@ -115,6 +115,23 @@
return $answer;
}
function sendPhoto ($chat_id, $photo,
$caption = null,
$reply_markup = null,
$disable_notification = false,
$reply_to_message_id = null ) {
$query = API_URL . API_TOKEN . "/sendPhoto?" .
"chat_id=".urlencode($chat_id) .
"&photo=" . urlencode($photo);
$query .= "&disable_notification=$disable_notification";
if ($reply_to_message_id != null) $query .= "&reply_to_message_id=$disable_web_page_preview";
if ($reply_markup != null) $query .= "&reply_markup=$reply_markup";
if ($caption != null) $query .= "&caption=$caption";
$answer = file_get_contents($query);
}
// Makes the calendar inline keyboard
function getCalendarTab ($month, $year) {