<?php
//ini_set('error_reporting',8191);
//ini_set('display_errors',1);
//echo "hi";
try {
include "../../classes/MessageProcessor.php";
include "../../classes/PostBaker.php";
include '../../classes/MiniCurl.php';
$debug=FALSE;
// $BOT_USER= '@chatmatbot';
$BOT_USER= '@tamasbabot';
$BOT_Default_Db_prefix= 'chatmat';
$BOT_TOKEN= '379870251:AAGs1q27Ql7FsJr67if7JgAWs02jV76uS7E';
$uriParts = explode("?",$_SERVER[REQUEST_URI]);
$actual_link = "https://$_SERVER[HTTP_HOST]".$uriParts[0];
$WEBHOOK_URL= $actual_link;
$SIGN ="پوشش خبری شهر های آلمان ".PHP_EOL."@TranslateService";
$SIGN ="پوشش خبری شهر های آلمان ".PHP_EOL."@mooglebot";
$tamasbabot = new MessageProcessor($BOT_USER,$BOT_TOKEN,$WEBHOOK_URL, $SIGN, 44903244);
if (isset($_GET ['do']) && $_GET ['do'] == 'setWebhook') {
echo "setting webhook...to \n ".$WEBHOOK_URL;
// if run from console, set or delete webhook
$tamasbabot->setWebhook();
exit ();
}
$content = file_get_contents ( "php://input" );
$update = json_decode ( $content, true );
// $testMessage = var_export ( $update, true );
// file_put_contents ( "testmessagetype.html", $testMessage, FILE_APPEND | LOCK_EX );
// exit();
if ($_SERVER ['SERVER_NAME'] == "localhost" || $debug) {
echo "debugging...".PHP_EOL;
// $update = array ( 'update_id' => 802512343, 'message' => array ( 'message_id' => 865, 'from' => array ( 'id' => 44903244445, 'first_name' => 'Saeed', 'username' => 'sinzed', ), 'chat' => array ( 'id' => 44903244, 'first_name' => 'Saeed', 'username' => 'sinzed', 'type' => 'private', ), 'date' => 1480911910, 'forward_from' => array ( 'id' => 44903244, 'first_name' => 'Saeed', 'username' => 'sinzed', ), 'forward_date' => 1480910459, 'video' => array ( 'duration' => 5, 'width' => 400, 'height' => 400, 'thumb' => array ( 'file_id' => 'AAQCABN4EIINAARY0M8fcMg54QLBAAIC', 'file_size' => 2464, 'width' => 90, 'height' => 90, ), 'file_id' => 'BAADAgAD6wUAAkwrrQJiWLK_HahlFQI', 'file_size' => 271180, ), ), );
$update1 = array (
'update_id' => 310853147,
'message' => array (
'message_id' => 10,
'from' => array (
'id' => 44903244,
'first_name' => 'Saeed',
'username' => 'sinzed'
),
'chat' => array (
'id' => 44903244,
'first_name' => 'Saeed',
'username' => 'sinzed',
'type' => 'private'
),
'date' => 1481901731,
'text' => 'w�rden'
)
);
$update = array (
'update_id' => 310853411,
'callback_query' =>
array (
'id' => '192857965748151190',
'from' =>
array (
'id' => 44903244,
'first_name' => 'Saeed',
'username' => 'sinzed',
),
'message' =>
array (
'message_id' => 759,
'from' =>
array (
'id' => 287525955,
'first_name' => 'ربات خبر های آلمان',
'username' => 'khabaralman_bot',
),
'chat' =>
array (
'id' => 44903244,
'first_name' => 'Saeed',
'username' => 'sinzed',
'type' => 'private',
),
'date' => 1482078484,
'text' => 'Nachricht0 Nach Skandal um Ex-Chefin - Bremer Unternehmen rettet Nordsee-Pflege Nordsee-Pflege-Chefin Gülsen Sariergin (37) wurde zu fünf Jahren Gefängnis verurteiltAufatmen für 180 Mitarbeiter und rund 600 Kunden: Die „Nordsee-Pflege" und sämtliche Arbeits- und Pflegeplätze sind so gut wie gerettet! Foto: Sandra Beckefeldt Sun, 18 Dec 2016 13:59:52 +0100',
'entities' =>
array (
0 =>
array (
'type' => 'bold',
'offset' => 11,
'length' => 68,
),
1 =>
array (
'type' => 'text_link',
'offset' => 79,
'length' => 1,
'url' => 'http://bilder.bild.de/fotos/nordsee-pflege-chefin-guelsen-sariergin-37-wurde-zu-fuenf-jahren-gefaengnis-verurteilt-200191517-49375400/Bild/2.bild.jpg',
),
2 =>
array (
'type' => 'pre',
'offset' => 325,
'length' => 33,
),
),
),
'chat_instance' => '6071330103816430450',
'data' => 'ww',
),
);
$update = $update1;
}
// echo "ssss";
// if (! $update) {
// exit ();
// }
if(isset($_GET["do"]) && isset($_GET["ip"])&& isset($_GET["email"])){
$tamasbabot->sendMessage("spaming-> ip : ".$_GET["ip"]." email :".$_GET["email"], 44903244);
}
// $testMessage = var_export ( $update, true );
// file_put_contents ( "testquery.html", $testMessage, FILE_APPEND | LOCK_EX );
if (isset ( $update ["update_id"] )) {
// print_r($update);
$tamasbabot->process ( $update );
}
} catch ( Exception $e ) {
echo 'Exception abgefangen: ', $e->getMessage (), "\n";
}
?>