Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Include the framework
- require './vendor/autoload.php';
- echo "online";
- $bot->redis=new Redis();
- $redis->connect('127.0.0.1');
- $bot = new PhpBotFramework\Bot("262833394:AAFzZ2zDHMqKoefEKRMXWtvkU76DDCzj0KU");
- $bot->getUpdatesLocal();
- if(!$redis->setNx('users', $_chat_id)){
- $home_closure = new PhpBotFramework\Commands\MessageCommand("start", function($bot, $message){
- $bot->inline_keyboard->addLevelButtons(
- [
- 'text' => $this->local[$bot->getLanguageRedisAsCache()]['Search_Button'],
- 'callback_data' => 'home_search'
- ],
- [
- 'text' => $this->local[$bot->language]['UserSeries_Button'],
- 'callbackdata' => 'home_series'
- ]
- );
- $bot->inline_keyboard->addLevelButtons(
- [
- 'text' => $this->local[$bot->language]['Calendar_Button'],
- 'callback_data' => 'home_calendar'
- ]
- );
- $bot->inline_keyboard->addLevelButtons(
- [
- 'text' => $bot->local[$bot->language]['Profilo'],
- 'callback_data' => 'home_profilo'],
- [
- 'text' => $bot->local[$bot->language]['Impo'],
- 'callback_data' => 'home_impo'
- ]
- );
- $bot->sendMessage("$bot->local['Start_Msg']", $bot->inline_keyboard->get());
- echo "user not new";
- }
- );
- }
- else {
- $home_closure = new PhpBotFramework\Commands\MessageCommand("start", function($bot, $message){
- $bot->sendMessage("buh");
- echo "new user in";
- });}
- $bot->addCommand($home_closure);
- $settings=function($bot, $message){
- $bot->inline_keyboard->addLevelButtons(
- ['text'=>$this->localization[$bot->language]['Lingua'],
- 'callback_data'=>'settings_languageSettings']);
- if ($Notifications=="TRUE") {
- $bot->inline_keyboard->addLevelButtons(
- ['text'=>$this->localization[$bot->language]['Notifiche_si'],
- 'callback_data'=>'change_notificationsStatus']
- );
- }
- elseif ($Notifications=="FALSE") {
- $bot->inline_keyboard->addLevelButtons(
- ['text'=>$this->localization[$bot->language]['Notifiche_no'],
- 'callback_data'=>'change_notificationsStatus']
- );
- }
- };
- /*
- if($this->eetData() == 'change_notificationsStatus' && $Notifications == 'TRUE'){
- $Notifications="FALSE";
- }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement