-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
31 lines (19 loc) · 857 Bytes
/
index.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
<?php
require "vendor/autoload.php";
use SergiX44\Nutgram\Nutgram;
$telegramBotToken = getenv("telegram_token");
$telegramChatId = getenv("telegram_chat_id");
$bot = new Nutgram($telegramBotToken);
$chat = new \Chevli\TelegramBot\Telegram\Chat($bot, $telegramChatId);
$bot->onCommand('start', function(Nutgram $bot) {
$bot->sendMessage("You may ask me...");
});
$chores = new \Chevli\TelegramBot\Grocy\Telegram\Chores($chat);
$bot->onCommand('chores', [$chores, 'getChores']);
$reminders = new \Chevli\TelegramBot\Monica\Telegram\Reminders($chat);
$bot->onCommand('reminders', [$reminders, 'getReminders']);
$bot->onCommand('birthdays', [$reminders, 'getBirthdays']);
$reminders = new \Chevli\TelegramBot\Monica\Telegram\Contacts($chat);
$bot->onCommand('contacts', [$reminders, 'getContacts']);
$chat->sendMessage("I'm ready");
$bot->run();