forked from danyspin97/GiveawaysBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetUpdates.php
executable file
·32 lines (27 loc) · 1008 Bytes
/
getUpdates.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
require_once './vendor/autoload.php';
require_once './src/giveaway/giveawaybot.php';
require_once './src/giveaway/languages.php';
require_once './src/giveaway/data.php';
/*
* Main script of the Bot using long polling
* Each request sent ny a telegram client will be parsed here and
* the respective function will be called
*/
use \WiseDragonStd\HadesWrapper;
// Set error reporting to skip PHP_NOTICE: http://php.net/manual/en/function.error-reporting.php
error_reporting(E_ALL & ~E_NOTICE);
$bot = new GiveawaysBot($token);
$bot->setLocalization($localization);
$bot->setDatabase(new \WiseDragonStd\HadesWrapper\Database($driver, $dbname, $user, $password, $bot));
try {
$redis = new \Redis();
$redis->connect('127.0.0.1', 6385);
} catch (RedisException $e) {
echo $e->getMessage();
}
$bot->redis = $redis;
//$bot->redis->setOption(Redis::OPT_PREFIX, 'Giveaway:');
$bot->inline_keyboard = new \WiseDragonStd\HadesWrapper\InlineKeyboard($bot);
$bot->getUpdatesLocal();
$bot = null;