[Telegram] Notifications

[Telegram] Notifications 2.0.0 RC 4

No permission to download
Got it up and running after searching and reading around!!
Good :thumbsup:

Is there any chance I can translate notifications sent by the bot into my own language?
Notifications should use your forum language. If on your own language notification is translated, then for Telegram you already have translation too.
If you experience issues with this mechanism, you can post here details?

Even the auth message from Telegram was in English...
Authentication message stored in phrases. You can find phrase (named as smodders_tgcore.direct_message) and translate manually.
 
Notifications should use your forum language. If on your own language notification is translated, then for Telegram you already have translation too.
If you experience issues with this mechanism, you can post here details?
Yep, I added Italian to my forum, plus I'm editing a child language to translate missing items and change some of the phrases to my needs. I'll have a deeper look into it then let you know :)
Authentication message stored in phrases. You can find phrase (named as smodders_tgcore.direct_message) and translate manually.
Thanks mate, found it. (y)
Last night I did search part of the text from the message but without success.
 
Looks like when you change update mode to longpoll, addon doesn't remove webhook.
@Kruzya I'm getting this as well.

I'm trying to figure out where to put my hand to translate those English parts so I disassociated my Telegram account.
Keep getting this error time by time since then



Code:
    TelegramBot\Api\HttpException: Conflict: can't use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first src/addons/SModders/TelegramCore/vendor/telegram-bot/api/src/BotApi.php:281

    Generato da: Account sconosciuto 22 Marzo 2020 alle 21:19

Analisi dello stack

#0 src/addons/SModders/TelegramCore/vendor/telegram-bot/api/src/BotApi.php(258): TelegramBot\Api\BotApi::curlValidate(Resource id #72, '{"ok":false,"er...')
#1 src/addons/SModders/TelegramCore/vendor/telegram-bot/api/src/BotApi.php(227): TelegramBot\Api\BotApi->executeCurl(Array)
#2 src/addons/SModders/TelegramCore/vendor/telegram-bot/api/src/BotApi.php(474): TelegramBot\Api\BotApi->call('getUpdates', Array)
#3 [internal function]: TelegramBot\Api\BotApi->getUpdates(389450140, 55, 1)
#4 src/addons/SModders/TelegramCore/vendor/telegram-bot/api/src/Client.php(405): call_user_func_array(Array, Array)
#5 src/addons/SModders/TelegramCore/Cron/LongPoll.php(39): TelegramBot\Api\Client->__call('getUpdates', Array)
#6 [internal function]: SModders\TelegramCore\Cron\LongPoll::process(Object(XF\Entity\CronEntry))
#7 src/XF/Job/Cron.php(34): call_user_func(Array, Object(XF\Entity\CronEntry))
#8 src/XF/Job/Manager.php(253): XF\Job\Cron->run(G)
#9 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#10 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#11 job.php(42): XF\Job\Manager->runQueue(false, 8)
#12 {main}

Stato richiesta

array(4) {
  ["url"] => string(18) "/community/job.php"
  ["referrer"] => string(59) "https://www.chefspuntozero.com/community/admin.php?add-ons/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

And I got this one down here just after disassociating my account:
👇👇👇👇👇

Code:
    TelegramBot\Api\HttpException: Operation timed out after 5000 milliseconds with 0 bytes received src/addons/SModders/TelegramCore/vendor/telegram-bot/api/src/BotApi.php:260

    Generato da: Account sconosciuto 22 Marzo 2020 alle 19:34

Analisi dello stack

#0 src/addons/SModders/TelegramCore/vendor/telegram-bot/api/src/BotApi.php(227): TelegramBot\Api\BotApi->executeCurl(Array)
#1 src/addons/SModders/TelegramCore/vendor/telegram-bot/api/src/BotApi.php(474): TelegramBot\Api\BotApi->call('getUpdates', Array)
#2 [internal function]: TelegramBot\Api\BotApi->getUpdates(389450139, 55, 1)
#3 src/addons/SModders/TelegramCore/vendor/telegram-bot/api/src/Client.php(405): call_user_func_array(Array, Array)
#4 src/addons/SModders/TelegramCore/Cron/LongPoll.php(39): TelegramBot\Api\Client->__call('getUpdates', Array)
#5 [internal function]: SModders\TelegramCore\Cron\LongPoll::process(Object(XF\Entity\CronEntry))
#6 src/XF/Job/Cron.php(34): call_user_func(Array, Object(XF\Entity\CronEntry))
#7 src/XF/Job/Manager.php(253): XF\Job\Cron->run(G)
#8 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#9 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#10 job.php(42): XF\Job\Manager->runQueue(false, 8)
#11 {main}

Stato richiesta

array(4) {
  ["url"] => string(18) "/community/job.php"
  ["referrer"] => string(56) "https://www.chefspuntozero.com/community/account/ignored"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}


1584911722713.webp

Let me know which part of the ACP settings you need to see and I'll post it.

Cheers!
 
This one?
👇
1584911979121.png

I set the Cron Job (don't know the difference actually...) and it worked until the disassociation :unsure:

Should I set Webhook then?
 
don't know the difference actually...
When you use cron method, the bot may respond after 1-2 minutes after sending the command. This is mechanism doesn't recommended, and should be used only if webhooks doesn't available.
When you use webhooks, the bot responds immediately (if your web-server is available for Telegram).

No update
XenForo show you error message about requiring [Telegram] Core with version 2.0.4. Are you sure your forum running on 2.0.4?
 
When you use cron method, the bot may respond after 1-2 minutes after sending the command. This is mechanism doesn't recommended, and should be used only if webhooks doesn't available.
When you use webhooks, the bot responds immediately (if your web-server is available for Telegram).


XenForo show you error message about requiring [Telegram] Core with version 2.0.4. Are you sure your forum running on 2.0.4?
Ok
 
When you use webhooks, the bot responds immediately (if your web-server is available for Telegram)
Infact I was testing it to review if I translated the strings correctly and it's blasting FAST!!! 😲

Good job man! 👍

(btw did you see the "Core" thread?)
 
@Kruzya Could you please set notification ON to all members including the new registered one as default?

I had requested this earlier Feb and i hope you could consider to implement it this month.
 
Kruzya updated [Telegram] Notifications with a new update entry:

Updated to 2.0.0 RC 3

  • Changed the logic of saving active alerts. Now the addon saves to the column disabled notification types, as it was originally intended, thanks to which, all newly registered users will have all notifications enabled by default.
Issue with special characters (what described here) in the process of solving, just keep calm and wait. Thanks for the patience 🙏

Read the rest of this update entry...
 
After upgrading we are getting an increased amount of errors...
Code:
[LIST]
[*]TypeError: Argument 2 passed to XF\Mvc\Entity\Manager::findOne() must be of the type array, int given, called in /home/domain/src/addons/SModders/TelegramNotifications/Job/UpgradeUserOptOut.php on line 42
[*]
[*]src/XF/Mvc/Entity/Manager.php:160
[*]Generated by: Unknown account
[*]
[*]May 10, 2020 at 2:00 AM
[/LIST]
Stack trace
#0 src/addons/SModders/TelegramNotifications/Job/UpgradeUserOptOut.php(42): XF\Mvc\Entity\Manager->findOne('XF:UserOption', 2)
#1 src/XF/Job/AbstractRebuildJob.php(47): SModders\TelegramNotifications\Job\UpgradeUserOptOut->rebuildById(2)
#2 src/XF/Job/Manager.php(253): XF\Job\AbstractRebuildJob->run(G)
#3 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#4 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#5 job.php(42): XF\Job\Manager->runQueue(false, 8)
#6 {main}
Request state
array(4) {
["url"] => string(8) "/job.php"
["referrer"] => string(33) "https://domain.com/admin.php"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
 
@Kruzya I think you should check again your latest version. I noticed two things after upgrade :-

1) The notification options on account profile sometimes disabled even i had enabled it few times.

2) When all notification option has selected, why in the database does not showing the record. It's empty.

Snap1.webp
 
I'm loving this plug-in! It's a total game-changer and a great workaround for iOS push notifications.

The only caveat I've noticed is that I don't seem to receive notifications from threads inside private sub-forums. Is there a way to fix this?
 
Seems to be buggy. I tried to send a test Alert and got this error:

  1. XF::handlePhpError()
  2. DOMDocument->loadHTML() in src/addons/SModders/TelegramNotifications/Service/HtmlPurifier.php at line 124
  3. SModders\TelegramNotifications\Service\HtmlPurifier->stripAttributes() in src/addons/SModders/TelegramNotifications/Service/HtmlPurifier.php at line 79
  4. SModders\TelegramNotifications\Service\HtmlPurifier->purify() in src/addons/SModders/TelegramNotifications/Listener.php at line 54
  5. SModders\TelegramNotifications\Listener::SModders\TelegramNotifications\{closure}()
  6. call_user_func_array() in src/addons/SModders/TelegramCore/SubContainer/Telegram.php at line 238
  7. SModders\TelegramCore\SubContainer\Telegram->SModders\TelegramCore\SubContainer\{closure}()
  8. call_user_func_array() in src/addons/SModders/TelegramCore/SubContainer/Telegram.php at line 265
  9. SModders\TelegramCore\SubContainer\Telegram->SModders\TelegramCore\SubContainer\{closure}() in src/XF.php at line 479
  10. XF::asVisitor() in src/addons/SModders/TelegramCore/SubContainer/Telegram.php at line 277
  11. SModders\TelegramCore\SubContainer\Telegram->asVisitor() in src/addons/SModders/TelegramNotifications/Listener.php at line 57
  12. SModders\TelegramNotifications\Listener::entity_post_save()
  13. call_user_func_array() in src/XF/Extension.php at line 50
  14. XF\Extension->fire() in src/XF.php at line 718
  15. XF::fire() in src/XF/Mvc/Entity/Entity.php at line 1225
  16. XF\Mvc\Entity\Entity->save() in src/XF/Repository/UserAlert.php at line 141
  17. XF\Repository\UserAlert->insertAlert() in src/XF/Repository/UserAlert.php at line 111
  18. XF\Repository\UserAlert->alert() in src/XF/Job/UserAlert.php at line 48
  19. XF\Job\UserAlert->executeAction() in src/XF/Job/AbstractUserCriteriaJob.php at line 59
  20. XF\Job\AbstractUserCriteriaJob->run() in src/XF/Admin/Controller/User.php at line 913
  21. XF\Admin\Controller\User->actionAlertSend() in src/XF/Mvc/Dispatcher.php at line 350
  22. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 261
  23. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
  24. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
  25. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2190
  26. XF\App->run() in src/XF.php at line 391
  27. XF::runApp() in admin.php at line 13
 
Top Bottom