[KL] Telegram Bot (for NSF) [Deleted]

Yes I did. I will uninstall and reinstall the add-ons, start a new bot and see if this changes anything :)

BTW Is there a way to send test messages?
 
Reinstalled everything, still get the same error. After the installation, the error pops up the moment I go in the account -> notification settings and select Telegram.

Code:
erver error log

    ErrorException: [E_NOTICE] Undefined index: telegram_user_id src/addons/KL/TelegramBot/Service/Telegram.php:125

    Generated by: Aysberg 31 Jan 2018 at 15:19

Stack trace

#0 src/addons/KL/TelegramBot/Service/Telegram.php(125): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/var/www/crymo....', 125, Array)
#1 src/addons/KL/TelegramBot/Pub/Controller/Account.php(11): KL\TelegramBot\Service\Telegram->addPendingUser()
#2 src/addons/KL/NotificationServiceFramework/Pub/Controller/Account.php(81): KL\TelegramBot\Pub\Controller\Account->_postSave('telegram')
#3 src/XF/Mvc/Dispatcher.php(249): KL\NotificationServiceFramework\Pub\Controller\Account->actionSave(Object(XF\Mvc\ParameterBag))
#4 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('KL\\Notification...', 'Save', 'html', Object(XF\Mvc\ParameterBag), '', Object(KL\TelegramBot\Pub\Controller\Account), NULL)
#5 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#6 src/XF/App.php(1880): XF\Mvc\Dispatcher->run()
#7 src/XF.php(328): XF\App->run()
#8 index.php(13): XF::runApp('XF\\Pub\\App')
#9 {main}

Request state

array(4) {
  ["url"] => string(37) "/xf/account/notification-service/save"
  ["referrer"] => string(49) "https://crymo.re/xf/account/notification-service/"
  ["_GET"] => array(1) {
    ["/xf/account/notification-service/save"] => string(0) ""
  }
  ["_POST"] => array(2) {
    ["user"] => array(1) {
      ["kl_nsf_service_data"] => array(1) {
        ["service_id"] => string(8) "telegram"
      }
    }
    ["_xfToken"] => string(8) "********"
  }
}

Delete
 
I tried uninstall all and reinstall again.

But don't know why I could not receive any message from Telegram bot. I sent /start command on my Telegram client.

Some member register but all of them got the same error while register service:

  • ErrorException: [E_NOTICE] Undefined index: telegram_user_id
  • src/addons/KL/TelegramBot/Service/Telegram.php:125
  • Generated By: minhvdp
  • 1 Tháng hai 2018 lúc 00:29
Stack Trace
#0 src/addons/KL/TelegramBot/Service/Telegram.php(125): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/home/handheld....', 125, Array)
#1 src/addons/KL/TelegramBot/Pub/Controller/Account.php(11): KL\TelegramBot\Service\Telegram->addPendingUser()
#2 src/addons/KL/NotificationServiceFramework/Pub/Controller/Account.php(81): KL\TelegramBot\Pub\Controller\Account->_postSave('telegram')
#3 src/XF/Mvc/Dispatcher.php(249): KL\NotificationServiceFramework\Pub\Controller\Account->actionSave(Object(XF\Mvc\ParameterBag))
#4 src/XF/Mvc/Dispatcher.php(87): XF\Mvc\Dispatcher->dispatchClass('KL\\Notification...', 'Save', 'html', Object(XF\Mvc\ParameterBag), '', Object(KL\TelegramBot\Pub\Controller\Account), NULL)
#5 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#6 src/XF/App.php(1880): XF\Mvc\Dispatcher->run()
#7 src/XF.php(328): XF\App->run()
#8 index.php(13): XF::runApp('XF\\Pub\\App')
#9 {main}
Request State
array(4) {
["url"] => string(34) "/account/notification-service/save"
["referrer"] => string(57) "https://www.handheld.com.vn/account/notification-service/"
["_GET"] => array(1) {
["/account/notification-service/save"] => string(0) ""
}
["_POST"] => array(2) {
["user"] => array(1) {
["kl_nsf_service_data"] => array(1) {
["service_id"] => string(8) "telegram"
}
}
["_xfToken"] => string(8) "********"
}
}
 
I got this error too:

  • ErrorException: [E_NOTICE] Undefined index: telegram_user_id
  • src/addons/KL/TelegramBot/Service/Telegram.php:125
 
XF\Db\Exception: MySQL statement prepare error [1146]: Table 'a220216_ef39r_bd.xf_kl_nsf_service' doesn't exist in src/XF/Db/AbstractStatement.php at line 212
  1. XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 196
  2. XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 39
  3. XF\Db\Mysqli\Statement->prepare() in src/XF/Db/Mysqli/Statement.php at line 54
  4. XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 79
  5. XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 160
  6. XF\Db\AbstractAdapter->insert() in src/addons/KL/TelegramBot/Setup.php at line 24
  7. KL\TelegramBot\Setup->installStep1() in src/XF/AddOn/StepRunnerInstallTrait.php at line 60
  8. KL\TelegramBot\Setup->installStepRunner() in src/XF/AddOn/StepRunnerInstallTrait.php at line 27
  9. KL\TelegramBot\Setup->install() in src/XF/Admin/Controller/AddOn.php at line 378
  10. XF\Admin\Controller\AddOn->actionInstall() in src/XF/Mvc/Dispatcher.php at line 249
  11. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
  12. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
  13. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1889
  14. XF\App->run() in src/XF.php at line 328
  15. XF::runApp() in admin.php at line 13
 
Is it just me or is anyone else having no response from their bot or any bots for that matter aside from botfather?

edit: i've tried communicating with the bot via postman and I get a response when i use sendmessage and my chat id. Does anyone have any ideas why the bot won't respond in the telegram app which would also likely be the reason why I'm not receiving notifications through my forum?
 
Last edited:
@katsulynx,
PHP:
ErrorException: [E_NOTICE] Undefined property: stdClass::$username src/addons/KL/TelegramBot/Service/Telegram.php:87

#0 src/addons/KL/TelegramBot/Service/Telegram.php(87): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/var/www/...', 87, Array)
#1 src/addons/KL/TelegramBot/Service/Telegram.php(75): KL\TelegramBot\Service\Telegram->processMessages(Array)
#2 src/addons/KL/TelegramBot/Cron/Telegram.php(8): KL\TelegramBot\Service\Telegram->reveiceMessages()
#3 [internal function]: KL\TelegramBot\Cron\Telegram::processReceivedMessages(Object(XF\Entity\CronEntry))
#4 src/XF/Job/Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))
#5 src/XF/Job/Manager.php(241): XF\Job\Cron->run(7.9999990463257)
#6 src/XF/Job/Manager.php(187): XF\Job\Manager->runJobInternal(Array, 7.9999990463257)
#7 src/XF/Job/Manager.php(76): XF\Job\Manager->runJobEntry(Array, 7.9999990463257)
#8 job.php(15): XF\Job\Manager->runQueue(false, 8)
#9 {main}
 
I'm getting a ton of these messages (seems like you're already aware but hopefully it helps):
Code:
ErrorException: [E_NOTICE] Undefined property: stdClass::$text src/addons/KL/TelegramBot/Service/Telegram.php:86
Generated by: Unknown account Apr 14, 2018 at 09:51
Stack trace

#0 src/addons/KL/TelegramBot/Service/Telegram.php(86): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/var/www/vhosts...', 86, Array)
#1 src/addons/KL/TelegramBot/Service/Telegram.php(75): KL\TelegramBot\Service\Telegram->processMessages(Array)
#2 src/addons/KL/TelegramBot/Cron/Telegram.php(8): KL\TelegramBot\Service\Telegram->reveiceMessages()
#3 [internal function]: KL\TelegramBot\Cron\Telegram::processReceivedMessages(Object(XF\Entity\CronEntry))
#4 src/XF/Job/Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))
#5 src/XF/Job/Manager.php(241): XF\Job\Cron->run(7.9999988079071)
#6 src/XF/Job/Manager.php(187): XF\Job\Manager->runJobInternal(Array, 7.9999988079071)
#7 src/XF/Job/Manager.php(76): XF\Job\Manager->runJobEntry(Array, 7.9999988079071)
#8 job.php(15): XF\Job\Manager->runQueue(false, 8)
#9 {main}
Looks like I'll have to disable this system for now, although that's probably my fault for not testing it sufficiently before announcing it to members.
 
As of today I started getting errors in the backend.

Stack trace

Code:
#0 src/addons/KL/TelegramBot/Service/Telegram.php(87): XF::handlePhpError(8, 'Undefined prope...', '/home/flyra/pub...', 87, Array)
#1 src/addons/KL/TelegramBot/Service/Telegram.php(75): KL\TelegramBot\Service\Telegram->processMessages(Array)
#2 src/addons/KL/TelegramBot/Cron/Telegram.php(8): KL\TelegramBot\Service\Telegram->reveiceMessages()
#3 [internal function]: KL\TelegramBot\Cron\Telegram::processReceivedMessages(Object(XF\Entity\CronEntry))
#4 src/XF/Job/Cron.php(36): call_user_func(Array, Object(XF\Entity\CronEntry))
#5 src/XF/Job/Manager.php(241): XF\Job\Cron->run(7.94195413589)
#6 src/XF/Job/Manager.php(187): XF\Job\Manager->runJobInternal(Array, 7.94195413589)
#7 src/XF/Job/Manager.php(76): XF\Job\Manager->runJobEntry(Array, 7.94195413589)
#8 job.php(15): XF\Job\Manager->runQueue(false, 8)
#9 {main}

Request state

Code:
array(4) {
  ["url"] => string(8) "/job.php"
  ["referrer"] => string(59) "https://.........../threads/tarom-discutii.45/page-788"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
Top Bottom