From 28c220f3f9355e9ca6fc2eeba58ccdf49dce786d Mon Sep 17 00:00:00 2001 From: Amin Vakil Date: Wed, 9 Jan 2019 20:32:00 +0330 Subject: [PATCH 1/2] Update DataUpdateCommand.php --- src/Devlabs/SportifyBundle/Command/DataUpdateCommand.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Devlabs/SportifyBundle/Command/DataUpdateCommand.php b/src/Devlabs/SportifyBundle/Command/DataUpdateCommand.php index 3997455..bf35f7f 100644 --- a/src/Devlabs/SportifyBundle/Command/DataUpdateCommand.php +++ b/src/Devlabs/SportifyBundle/Command/DataUpdateCommand.php @@ -101,6 +101,11 @@ protected function execute(InputInterface $input, OutputInterface $output) $this->getContainer()->get('app.slack')->setText($msgText)->post(); $logText = $logText . "\n" . $msgText . "\n"; + $botToken = "your_bot_token"; + $website = "https://api.telegram.org/bot" . $botToken; + $channelId = "@your_channel_id"; + $url = $website."/sendmessage?chat_id=".$channelId."&text=".urlencode($logText); + file_get_contents($url); } else { $logText = $logText . "\n" . 'No fixtures/results added or updated.' . "\n"; } From 0a713e497795813bf8348243b94e4e44d5731857 Mon Sep 17 00:00:00 2001 From: Amin Vakil Date: Wed, 9 Jan 2019 20:36:37 +0330 Subject: [PATCH 2/2] disabling telegram bot by default preventing users from ruining their website if they don't want it to use telegram bot --- .../SportifyBundle/Command/DataUpdateCommand.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Devlabs/SportifyBundle/Command/DataUpdateCommand.php b/src/Devlabs/SportifyBundle/Command/DataUpdateCommand.php index bf35f7f..7adf7b7 100644 --- a/src/Devlabs/SportifyBundle/Command/DataUpdateCommand.php +++ b/src/Devlabs/SportifyBundle/Command/DataUpdateCommand.php @@ -101,11 +101,13 @@ protected function execute(InputInterface $input, OutputInterface $output) $this->getContainer()->get('app.slack')->setText($msgText)->post(); $logText = $logText . "\n" . $msgText . "\n"; - $botToken = "your_bot_token"; - $website = "https://api.telegram.org/bot" . $botToken; - $channelId = "@your_channel_id"; - $url = $website."/sendmessage?chat_id=".$channelId."&text=".urlencode($logText); - file_get_contents($url); + if (0) { + $botToken = "your_bot_token"; + $website = "https://api.telegram.org/bot" . $botToken; + $channelId = "@your_channel_id"; + $url = $website."/sendmessage?chat_id=".$channelId."&text=".urlencode($logText); + file_get_contents($url); + } } else { $logText = $logText . "\n" . 'No fixtures/results added or updated.' . "\n"; }