[3.2][BETA] Telegram Notifications

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Ideas Centre
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
lassik
Registered User
Posts: 15
Joined: Thu Jul 27, 2017 11:16 am

Re: [3.2][BETA] Telegram Notifications

Post by lassik » Fri Aug 04, 2017 12:43 pm

potku wrote:
Thu Aug 03, 2017 10:50 am
I should be at a point where that ID is the only thing missing. Is it the one with a negative sign in front of it (I read that for groups it's like that)?
Exactly :) Group IDs all seem to be negative numbers whereas individual user IDs (for one-to-one chat) are positive numbers.
potku wrote:
Thu Aug 03, 2017 10:50 am
the bot is not delivering messages to the group.
It sounds like you got the right chat ID for your group. And since you were able to see the ACP Telegram IDs panel and type in the chat ID, you must have unzipped the extension into the right folder and got it enabled.

Unfortunately the ext doesn't have any logging right now so it's hard to say what the problem is :(

One thing is that if PHP's cURL support is not enabled, it will not send any messages (since the whole thing is basically coded using cURL). But I can't find a way to check that from the phpBB UI.

You could also try using the Chat ID of your personal Telegram account instead of a group chat. That way the bot will try to send private messages to you instead of sending them to the group. Personal chat IDs are positive numbers, here's one way to find out yours: https://stackoverflow.com/a/32777943

It would be good to add better diagnostics/logging to the extension anyway, but unfortunately I can't personally devote a lot of time to developing this ext, so updates will take some time.

EDIT: One more thing - Telegram bot auth tokens look like this: a bunch of decimal digits, then a colon (a ":" mark), then a random-looking mix of small and capital letters as well as digits. Did you remember to include both the part before the colon and the part after?

lassik
Registered User
Posts: 15
Joined: Thu Jul 27, 2017 11:16 am

Re: [3.2][BETA] Telegram Notifications

Post by lassik » Tue Aug 15, 2017 9:47 am

Just released a new version 0.2.0. The download link in the first post now points to this version.

This version adds a 'Last error' display to the extension's ACP panel. Each time someone has posted, the extension records the outcome of sending the Telegram notification here. Normally it says 'Success'. If there was an error, the error message ought to be shown here.

@potku Since the ext didn't work for you, can you try installing this version and see what error message you get?

I'm still not parsing detailed error messages from the Telegram API but we can add that too if needed.

lassik
Registered User
Posts: 15
Joined: Thu Jul 27, 2017 11:16 am

Re: [3.2][BETA] Telegram Notifications

Post by lassik » Tue Aug 15, 2017 11:01 am

Just released a new version 0.3.0. The download link in the first post now points to this version.

Felt inspired so added the code right away to parse more detailed error messages from the Telegram API. Now they're pretty much as detailed as they can be.

Gubkin
Registered User
Posts: 7
Joined: Sun Sep 24, 2017 7:15 am
Location: RU
Name: Alexander
Contact:

Re: [3.2][BETA] Telegram Notifications

Post by Gubkin » Sun Sep 24, 2017 7:21 am

I can't remove data in ACP after turn off extension


have the error

Code: Select all

Fatal error: Uncaught phpbb\module\exception\module_exception: CANNOT_REMOVE_MODULE in /home/oilchoice/oilchoice.ru/docs/phpbb/module/module_manager.php:448 Stack trace: #0 /home/oilchoice/oilchoice.ru/docs/phpbb/db/migration/tool/module.php(371): phpbb\module\module_manager->delete_module(465, 'acp') #1 [internal function]: phpbb\db\migration\tool\module->remove('acp', 32, 'ACP_TELEGRAM_NO...') #2 /home/oilchoice/oilchoice.ru/docs/phpbb/db/migration/tool/module.php(405): call_user_func_array(Array, Array) #3 [internal function]: phpbb\db\migration\tool\module->reverse('add', 'acp', 'ACP_CAT_DOT_MOD...', 'ACP_TELEGRAM_NO...') #4 /home/oilchoice/oilchoice.ru/docs/phpbb/db/migrator.php(711): call_user_func_array(Array, Array) #5 /home/oilchoice/oilchoice.ru/docs/phpbb/db/migrator.php(658): phpbb\db\migrator->run_step(Array, NULL, false) #6 /home/oilchoice/oilchoice.ru/docs/phpbb/db/migrator.php(551): phpbb\db\migrator->process_data_step(Array, Array) #7 /home/oilchoice/oilchoice.ru/docs/phpbb/db/migrator.php(514): phpbb\db\ in /home/oilchoice/oilchoice.ru/docs/phpbb/module/module_manager.php on line 448
have this on ver 0.3.0 and new 0.4.0

Orcajavi
Registered User
Posts: 5
Joined: Sun Jan 29, 2017 10:37 am

Re: [3.2][BETA] Telegram Notifications

Post by Orcajavi » Sun Sep 24, 2017 9:12 am

Great extension.
It would be nice to be able to choose which forums can be blocked to not receive notifications from them.

$ina
Registered User
Posts: 1
Joined: Fri Oct 06, 2017 3:27 pm

Re: [3.2][BETA] Telegram Notifications

Post by $ina » Fri Oct 06, 2017 3:31 pm

how to send topic Issue with pictures ?
this is only posted topic_title
thanx

lassik
Registered User
Posts: 15
Joined: Thu Jul 27, 2017 11:16 am

Re: [3.2][BETA] Telegram Notifications

Post by lassik » Wed Oct 11, 2017 9:36 pm

Gubkin wrote:
Sun Sep 24, 2017 7:21 am
I can't remove data in ACP after turn off extension

have this on ver 0.3.0 and new 0.4.0
Sorry to hear that you are having problems with it. Unfortunately, there seems to be some problem with the ACP migration code in 0.4.0 (from GitHub). That's why I removed the link to 0.4.0 from this forum and the download link in the first post in this thread still points to the old 0.3.0.

The issue in 0.4.0 is that it changes an ACP module by first removing it, then re-adding a changed version of it. (The purpose is to add a new page to the ACP.) This seems to confuse phpBB, in particular if you upgrade from 0.3.0 to 0.4.0 without disabling the ext in between :-( If someone wants to take a look at the migration code and spot what's wrong, it's here: https://github.com/lassik/phpbb-ext-tel ... _0_4_0.php I'm a little out of my depth here.
Orcajavi wrote:
Sun Sep 24, 2017 9:12 am
Great extension.
Thanks, it's nice to see that somebody else is also finding it useful :-)
Orcajavi wrote:
Sun Sep 24, 2017 9:12 am
It would be nice to be able to choose which forums can be blocked to not receive notifications from them.
That would be quite a big change to the ACP panel. I don't personally have time to do it but if somebody is experienced with ext coding and wants to add this, feel free to take a stab at it :-)
$ina wrote:
Fri Oct 06, 2017 3:31 pm
how to send topic Issue with pictures ?
this is only posted topic_title
That's true, I started as simply as possible. Do you mean the small picture (icon) next to the topic? Again I don't have time to add this but if somebody wants try, feel free :)

More generally, if somebody wants to help improve/maintain the code, help is welcome :)

User avatar
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 23721
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: [3.2][BETA] Telegram Notifications

Post by Paul » Thu Oct 12, 2017 5:33 am

You probably should make it two separate migrations, and define the correct depends on values
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development

User avatar
ZaneMcK
Registered User
Posts: 7
Joined: Sat Nov 18, 2017 2:15 pm

Re: [3.2][BETA] Telegram Notifications

Post by ZaneMcK » Sat Nov 18, 2017 3:05 pm

This extension looks very interesting. Can I specifify (in my UCP, or maybe generally in the ACP for certain groups) which notifications should go to Telegram? I.e. only newly registered user activations, not for every subscribed topic.
It would be even better if I could set it to send reported posts to Telegram, is that possible with your extension?

demonlibra
Registered User
Posts: 3
Joined: Sat Dec 04, 2010 8:20 pm

Re: [3.2][BETA] Telegram Notifications

Post by demonlibra » Sat Nov 18, 2017 7:13 pm

it would be great if the notice contained part of the message text.

lassik
Registered User
Posts: 15
Joined: Thu Jul 27, 2017 11:16 am

Re: [3.2][BETA] Telegram Notifications

Post by lassik » Mon Nov 20, 2017 1:04 pm

Thanks for the interest.
demonlibra wrote:
Sat Nov 18, 2017 7:13 pm
it would be great if the notice contained part of the message text.
This should be easy to do. I'll try to add an ACP checkbox in the next version.
ZaneMcK wrote:
Sat Nov 18, 2017 3:05 pm
Can I specifify (in my UCP, or maybe generally in the ACP for certain groups) which notifications should go to Telegram? I.e. only newly registered user activations, not for every subscribed topic.
It should be easy to add some checkboxes to the ACP to select which notifications to send. I'll try to add it in the next version.

I don't know anything about UCP coding, probably won't have time to investigate this myself.
ZaneMcK wrote:
Sat Nov 18, 2017 3:05 pm
It would be even better if I could set it to send reported posts to Telegram, is that possible with your extension?
Do you mean that the Telegram notification should contain the message body in addition to the topic title (as demonlibra asked)? Or do you mean that there should be a button in phpBB next to each message so moderators could manually send a notification to Telegram about that message?

User avatar
ZaneMcK
Registered User
Posts: 7
Joined: Sat Nov 18, 2017 2:15 pm

Re: [3.2][BETA] Telegram Notifications

Post by ZaneMcK » Sat Nov 25, 2017 1:56 pm

lassik wrote:
Mon Nov 20, 2017 1:04 pm
ZaneMcK wrote:
Sat Nov 18, 2017 3:05 pm
It would be even better if I could set it to send reported posts to Telegram, is that possible with your extension?
Do you mean that the Telegram notification should contain the message body in addition to the topic title (as demonlibra asked)? Or do you mean that there should be a button in phpBB next to each message so moderators could manually send a notification to Telegram about that message?
Preferably it would contain the same information as the report has: Topic title (link), reporter, reason, and yes, message body.
But, if that's too complicated, a message with just a link to the report will suffice.

User avatar
donsenilo
Registered User
Posts: 239
Joined: Wed Oct 08, 2014 6:23 pm
Name: Markus
Contact:

Re: [3.2][BETA] Telegram Notifications

Post by donsenilo » Mon Nov 27, 2017 7:39 pm

Hi

yes, I'm very confused about the "function" of this ext.

What I think (and hope) is, that with this ext it's possible to automatically send postings (made in my forum) to a specific telegram-account.
I've created a channel in telegram (called "Paranormal.wien") and added a bot called "paranormalwienbot").
In ACP at "Telegram bot auth token" I've added a very long mixed string and in "Telegram chat ID" the "paranormalwienbot".
But I'm not sure, if this is correct.

Sorry if this is stupid :-(

Please help.

lassik
Registered User
Posts: 15
Joined: Thu Jul 27, 2017 11:16 am

Re: [3.2][BETA] Telegram Notifications

Post by lassik » Wed Nov 29, 2017 7:33 pm

donsenilo wrote:
Mon Nov 27, 2017 7:39 pm
What I think (and hope) is, that with this ext it's possible to automatically send postings (made in my forum) to a specific telegram-account.
ZaneMcK wrote:
Sat Nov 25, 2017 1:56 pm
lassik wrote:
Mon Nov 20, 2017 1:04 pm
ZaneMcK wrote:
Sat Nov 18, 2017 3:05 pm
It would be even better if I could set it to send reported posts to Telegram, is that possible with your extension?
Do you mean that the Telegram notification should contain the message body in addition to the topic title (as demonlibra asked)? Or do you mean that there should be a button in phpBB next to each message so moderators could manually send a notification to Telegram about that message?
Preferably it would contain the same information as the report has: Topic title (link), reporter, reason, and yes, message body.
But, if that's too complicated, a message with just a link to the report will suffice.
Ok, now I see what you mean. The ext does exactly what you are asking for. The forum will automatically send a link to every new post to a Telegram group. The current version only sends the title of the topic. In the next version I will try to add an option to send some of the text from the beginning of the post too.
donsenilo wrote:
Mon Nov 27, 2017 7:39 pm
I've created a channel in telegram (called "Paranormal.wien") and added a bot called "paranormalwienbot").
In ACP at "Telegram bot auth token" I've added a very long mixed string and in "Telegram chat ID" the "paranormalwienbot".
You seem to have almost everything correct :) Only "Telegram chat ID" should be a negative number, for example -1234567, instead of the name of the chat. Please see https://stackoverflow.com/a/32572159 for how to find the number. The next version will try to find the number for you automatically, but it will take some time to be released.

User avatar
donsenilo
Registered User
Posts: 239
Joined: Wed Oct 08, 2014 6:23 pm
Name: Markus
Contact:

Re: [3.2][BETA] Telegram Notifications

Post by donsenilo » Thu Nov 30, 2017 3:10 pm

Thanks lassik

I think now I've the correct chat ID. But in my case it's not a negative number.

UPDATE:
It works !!! :-)
But I get the topic title instead of the post title.

And btw.: Is it possible to forward only new postings ? Because at this time every (!) change is forwarded to telegram.

Post Reply

Return to “Extensions in Development”

Who is online

Users browsing this forum: SalazarAG, ZaneMcK, zorni and 25 guests