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

Lukas W.

Well-known member
@Betclever: Unlikely. I am currently developing for my own project, that will run on XF 2.0 and mostly publish the byproducts of it. I doubt I will come back to modding for XF 1.5.

Please do not leave us without this wonderful complement for those who do not go to xF2, there are many webs that we do not spend (at least for now) because we have many ad oms and we would love to have this, what if your last add on for xF 1.5 is this? XD thank you for your time.
 
Please do not leave us without this wonderful complement for those who do not go to xF2, there are many webs that we do not spend (at least for now) because we have many ad oms and we would love to have this, what if your last add on for xF 1.5 is this? XD thank you for your time.

Sorry, I have no plans on using XF1.5 anymore, and also no plans for doing any more add-ons for it.
 
Tried to install on my demo board, after I've installed NSF, but

Code:
An exception occurred: [Error] Call to undefined method KL\TelegramBot\Setup::database() in src/addons/KL/TelegramBot/Setup.php on line 20

KL\TelegramBot\Setup->installStep1() in src/XF/AddOn/StepRunnerInstallTrait.php at line 60
KL\TelegramBot\Setup->installStepRunner() in src/XF/AddOn/StepRunnerInstallTrait.php at line 27
KL\TelegramBot\Setup->install() in src/XF/Admin/Controller/AddOn.php at line 379
XF\Admin\Controller\AddOn->actionInstall() in src/XF/Mvc/Dispatcher.php at line 249
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1845
XF\App->run() in src/XF.php at line 328
XF::runApp() in admin.php at line 13
 
katsulynx updated [KL] Telegram Bot (for NSF) with a new update entry:

1.0.0 Beta 3

Changelog
Bugfixes & Changes
  • Fixed a bug in my brain that prevented me from uploading this update even though it has been ready for about three weeks.
  • Fixed a bug that would prevent new users from installing this add-on.
  • Fixed a bug that would prevent uninstallation of this add-on.
  • Fixed a 'bug' that would prevent the bot from sending any messages if users if they would enter...

Read the rest of this update entry...
 
hmm, something missing here

Code:
ErrorException: [E_NOTICE] Undefined index: telegram_user_id
src/addons/KL/TelegramBot/Service/Telegram.php:125
Generated by: whmcsguru Jan 13, 2018 at 1:16 PM

Code:
#0 src/addons/KL/TelegramBot/Service/Telegram.php(125): XF::handlePhpError(8, 'Undefined index...', '/home/whmcssup/...', 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(89): 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}

Code:
array(4) {
  ["url"] => string(34) "/account/notification-service/save"
  ["referrer"] => string(57) "https://forum.url/account/notification-service/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(2) {
    ["user"] => array(1) {
      ["kl_nsf_service_data"] => array(1) {
        ["service_id"] => string(8) "telegram"
      }
    }
    ["_xfToken"] => string(8) "********"
  }
}

I'm not discounting that I may have done something wrong here. Seems to have happened after I added the telegram username.
 
I have the same error logged...

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

And thanks for your add on and the work you put in it.
 
Last edited:
Hi,

why is there no notification for private messages?

And is it possible not to display the avatar?
1516190021098.webp

And i get the following error:
Code:
ErrorException: [E_NOTICE] Undefined index: telegram_user_id src/addons/KL/TelegramBot/Service/Telegram.php:125
Generated by: ZarJohn Jan 17, 2018 at 1:08 PM
Stack trace
#0 src/addons/KL/TelegramBot/Service/Telegram.php(125): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/var/www/vhosts...', 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(34) "/account/notification-service/save"
  ["referrer"] => string(51) "https://anzahcraft.de/account/notification-service/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(2) {
    ["user"] => array(1) {
      ["kl_nsf_service_data"] => array(1) {
        ["service_id"] => string(8) "telegram"
      }
    }
    ["_xfToken"] => string(8) "********"
  }
}
 
Last edited:
why is there no notification for private messages?

Cause the NSF triggers on alerts only and there are no alerts for private conversations.

And is it possible not to display the avatar?
View attachment 166811

Interestingly, this is not happening on my board. I might be able to strip out image tags.

And i get the following error:
hmm, something missing here
I'm not discounting that I may have done something wrong here. Seems to have happened after I added the telegram username.
I have the same error logged...
That one's currently popping up when a user activates their telegram subscription, though I haven't yet figured out why. From what I can tell, stuff works anyway, so I'll try to sort this out in the future, but it's nothing to worry about for now.
 
Hi,

why is there no notification for private messages?

And is it possible not to display the avatar?
View attachment 166811

And i get the following error:
Code:
ErrorException: [E_NOTICE] Undefined index: telegram_user_id src/addons/KL/TelegramBot/Service/Telegram.php:125
Generated by: ZarJohn Jan 17, 2018 at 1:08 PM
Stack trace
#0 src/addons/KL/TelegramBot/Service/Telegram.php(125): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/var/www/vhosts...', 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(34) "/account/notification-service/save"
  ["referrer"] => string(51) "https://anzahcraft.de/account/notification-service/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(2) {
    ["user"] => array(1) {
      ["kl_nsf_service_data"] => array(1) {
        ["service_id"] => string(8) "telegram"
      }
    }
    ["_xfToken"] => string(8) "********"
  }
}
I really got the same error too. Is there any update @katsulynx ?
 
That one's currently popping up when a user activates their telegram subscription, though I haven't yet figured out why. From what I can tell, stuff works anyway, so I'll try to sort this out in the future, but it's nothing to worry about for now.

In my case, the error is popping up and it's not working. Maybe this helps a bit more...

If I go to my Your Account - Notification Service settings and enter the Telegram User ID, I get the mentioned error in the admin panel. Further I get no messages via Telegram. If visiting, my Notification Service settings again, there is still my User ID shown, when going to Notification Service and I chose Telegram again and press "Select" the User ID field is empty.

Thanks for your great work and if I can be of any further assistance for fiddling out this problem, I am glad to help.
 
I've literally posted a statement to that a few hours ago.
But if a User use any Reaction, I don't get push notification.
Not in the forum or telegram.

and @ThemeHouse has adapted the addon to make it work at all.
That was the original error:
Code:
Error: Call to a member function getProperty() on null src/addons/ThemeHouse/Reactions/XF/Template/Templater.php:218
Generated by: Der Graf Jan 17, 2018 at 10:55 AM
Stack trace
#0 src/addons/ThemeHouse/Reactions/XF/Template/Templater.php(71): ThemeHouse\Reactions\XF\Template\Templater->getReactionStyleProperties()
#1 [internal function]: ThemeHouse\Reactions\XF\Template\Templater->fnReaction(Object(KL\UserImprovements\Template\Templater), false, Array, 'alert')
#2 src/XF/Template/Templater.php(861): call_user_func_array(Array, Array)
#3 internal_data/code_cache/templates/l3/s0/public/alert_post_react.php(9): XF\Template\Templater->fn('reaction', Array, false)
#4 src/XF/Template/Templater.php(1230): XF\Template\Templater->{closure}(Object(KL\UserImprovements\Template\Templater), Array)
#5 src/XF/Alert/AbstractHandler.php(67): XF\Template\Templater->renderTemplate('alert_post_reac...', Array)
#6 src/addons/KL/NotificationServiceFramework/Entity/UserAlert.php(22): XF\Alert\AbstractHandler->render(Object(KL\NotificationServiceFramework\Entity\UserAlert))
#7 src/XF/Mvc/Entity/Entity.php(1137): KL\NotificationServiceFramework\Entity\UserAlert->_postSave()
#8 src/XF/Repository/UserAlert.php(105): XF\Mvc\Entity\Entity->save()
#9 src/XF/Repository/UserAlert.php(71): XF\Repository\UserAlert->insertAlert(1, 596, 'Der Graf', 'post', 8963, 'react', Array)
#10 src/addons/ThemeHouse/Reactions/React/AbstractHandler.php(377): XF\Repository\UserAlert->alertFromUser(Object(KL\UserImprovements\Entity\User), Object(KL\UserImprovements\Entity\User), 'post', 8963, 'react', Array)
#11 src/addons/ThemeHouse/Reactions/Repository/ReactedContent.php(105): ThemeHouse\Reactions\React\AbstractHandler->sendReactAlert(Object(ThemeHouse\Reactions\Entity\ReactedContent), Object(ThemeHouse\Reactions\XF\Entity\Post))
#12 src/addons/ThemeHouse/Reactions/ControllerPlugin/React.php(22): ThemeHouse\Reactions\Repository\ReactedContent->insertReact(Object(ThemeHouse\Reactions\XF\Entity\Post), Object(ThemeHouse\Reactions\Entity\ReactedContent))
#13 src/addons/ThemeHouse/Reactions/Pub/Controller/React.php(27): ThemeHouse\Reactions\ControllerPlugin\React->actionToggleReact(Object(ThemeHouse\Reactions\XF\Entity\Post), Object(ThemeHouse\Reactions\Entity\ReactedContent), 'insert')
#14 src/XF/Mvc/Dispatcher.php(249): ThemeHouse\Reactions\Pub\Controller\React->actionReact(Object(XF\Mvc\ParameterBag))
#15 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('ThemeHouse\Reac...', 'React', 'json', Object(XF\Mvc\ParameterBag), 'reactions', Object(ThemeHouse\Reactions\Pub\Controller\React), NULL)
#16 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#17 src/XF/App.php(1880): XF\Mvc\Dispatcher->run()
#18 src/XF.php(328): XF\App->run()
#19 index.php(13): XF::runApp('XF\Pub\App')
#20 {main}
Request state
array(4) {
["url"] => string(29) "/reactions/react/post/8963/17"
["referrer"] => string(79) "https://anzahcraft.de/threads/neue-benachrichtigungsmoeglichkeit-telegram.2154/"
["_GET"] => array(0) {
}
["_POST"] => array(4) {
["_xfRequestUri"] => string(58) "/threads/neue-benachrichtigungsmoeglichkeit-telegram.2154/"
["_xfWithData"] => string(1) "1"
["_xfToken"] => string(8) "********"
["_xfResponseType"] => string(4) "json"
}
}
 
Top Bottom