[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!
Scam Warning
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)
User avatar
eunaumtenhoid
Registered User
Posts: 738
Joined: Wed Jun 03, 2009 12:46 am
Location: ????

Re: [3.2][BETA] Telegram Notifications

Post by eunaumtenhoid » Mon Jan 15, 2018 4:35 am

nice work congratulations
My translations of the extensions for Brazilian Portuguese
https://github.com/phpBBTraducoes

jan_2017
Registered User
Posts: 122
Joined: Sun May 07, 2017 3:39 pm

Re: [3.2][BETA] Telegram Notifications

Post by jan_2017 » Sun Jan 21, 2018 11:35 pm

Hi

i love your ext!!!!!

THAT is what i looking for!

It easy to install.

download and enable telegram notifications extension like in first post

1.) Install App telegramm on your smartphone
2.) create own account like whatsapp
3.) than search for member "BotFather"
4.) follow instructions if click at /newbot
5.) at the end copy ALL in the line: "Use this token to access the HTTP API:"
6.) go to new created bot in telegram
7.) open settings (hold finger pressed on "Group name")
8.) select "add to group " => you want to put in / now bot is in your Group (check this)
9.) go to internet explorer and open "https://api.telegram.org/bot<copies_lin ... getUpdates" (copy the line from point 5.) without "<" and ">" in the adressline
10.) Now it appears a long text - search for "{"id":-654321233, "title": "YOUR GROUPNAME FROM TELEGRAMM"......"
11.) It is very important to copy all numbers with the symbol "-" , like that for example: -654321233
12.) go to your forum and open ACP
13.) go to extensions > telegram IDs
14.) Telegram bot auth token: put here the copied line from 5.)
15.) Telegram chat ID: put here the copied line from 11.)
16.) Save settings
17.) Test notification => write a post and click send , now it must immediately appear a mesage on your smartphone like this:

"Your Groupname"
[User_how_posted_the_post]
RE: / Edit:
Posttitle from first Post

I hope i will help all others

Bye Jan

EDIT:

Now i have tested some changes...

i have missed some messages in the app "telegram" if users post in forum .
so i added this lines in main_listener.php => Line 67

Code: Select all

	private function prefix_from_mode($mode)
	{
		if ($mode === 'post')
		{
			return 'erstellte neues Thema: ';
		}
		else if ($mode === 'reply')
		{
			return 'hat geantwortet auf: ';
		}
		else if ($mode === 'quote')
		{
			return 'zitierte den Beitrag : ';
		}
		else if ($mode === 'edit')
		{
			return 'bearbeitete den Beitrag: ';
		}
		else
		{
			return ucfirst($mode).': ';
		}
	}
	
(i put a german translation in it - sorry)

Now it appears immediately a message in "telegram" if users "post new topics","edit Posts","quote posts" or "post an reply"

i hope it is helpful!

Bye Jan

Bruninoit
Registered User
Posts: 501
Joined: Thu Jun 13, 2013 2:34 pm
Location: Florence (Italy)
Name: Bruno Andrew
Contact:

Re: [3.2][BETA] Telegram Notifications

Post by Bruninoit » Wed Jan 24, 2018 9:42 am

A more simple tipp!

To get chat id for a group/supergroup, just add @channelidbot to the group (it will give chatid and leaves the chat)
To get chat id for a channel, just forward a message from the channel to @channelidbot

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

Re: [3.2][BETA] Telegram Notifications

Post by lassik » Tue Jan 30, 2018 9:17 pm

Thanks for the encouraging feedback :)

I have now released a new version 0.5.0. The download link in the first post now points to this version. This version has been tested quite a bit. Both a fresh install and upgrading from 0.3.0 work for me.

New features:

Change behavior slightly:

* Only notify about edits when 'Reason for editing this post' is filled in.
* Show the edit reason in Telegram notifications about edited posts.
* When moderator edits user's post, show username of moderator instead of user.
* Include text from the beginning of the post (for new posts and replies; optional).
* Notify about new user activations (and re-activations of deactivated users).

Add several new yes/no configuration settings to the Administrator Control Panel:

Notify about events
* Edited posts (when "reason for editing this post" is given)
* Replies to existing topics
* New topics
* New users (when the user account is activated)

Notification content
* Verbose notifications
* Include text from the beginning of the post

Notification formats are now:

Brief:
[User X] Topic title
[User X] Re: Topic title
[User X] Quote: Topic title
[User X] Edit: Topic title

Verbose:
User X posted new topic: Topic title
User X replied in topic: Topic title
User X replied with quote in topic: Topic title
User X edited post in topic: Topic title
lord_wolken wrote:
Fri Dec 22, 2017 2:56 pm
I added a small text preview to the telegram message changing the line 54 of main_listener.php as follows (if anybody might find it helpful):
Thanks! I've incorporated your change to the latest version (0.5.0). You can enable it by setting "Include text from the beginning of the post" to "Yes" in the ACP.
lord_wolken wrote:
Fri Dec 22, 2017 2:56 pm
Do you know if it would be possible to include as well an attached image? or link to attached files?
Linking to attached files is probably possible but I won't have time to add it. I'm not sure if images are possible with reasonable effort.
jan_2017 wrote:
Sun Jan 21, 2018 11:35 pm
download and enable telegram notifications extension like in first post

1.) Install App telegramm on your smartphone
2.) create own account like whatsapp
3.) than search for member "BotFather"
4.) follow instructions if click at /newbot
5.) at the end copy ALL in the line: "Use this token to access the HTTP API:"
6.) go to new created bot in telegram
7.) open settings (hold finger pressed on "Group name")
8.) select "add to group " => you want to put in / now bot is in your Group (check this)
9.) go to internet explorer and open "https://api.telegram.org/bot<copies_lin ... getUpdates" (copy the line from point 5.) without "<" and ">" in the adressline
10.) Now it appears a long text - search for "{"id":-654321233, "title": "YOUR GROUPNAME FROM TELEGRAMM"......"
11.) It is very important to copy all numbers with the symbol "-" , like that for example: -654321233
12.) go to your forum and open ACP
13.) go to extensions > telegram IDs
14.) Telegram bot auth token: put here the copied line from 5.)
15.) Telegram chat ID: put here the copied line from 11.)
16.) Save settings
17.) Test notification => write a post and click send , now it must immediately appear a mesage on your smartphone like this:
Bruninoit wrote:
Wed Jan 24, 2018 9:42 am
A more simple tipp!

To get chat id for a group/supergroup, just add @channelidbot to the group (it will give chatid and leaves the chat)
To get chat id for a channel, just forward a message from the channel to @channelidbot
Those are great instructions, thanks :)

The newest version (0.5.0) now has a "Find chat ID" page in the ACP. It will try to automatically find the chat ID for you by asking the bot about the latest channel it has visited. So you still need to invite the bot to a channel first and fill in the auth token, but then it should be able to find it.
jan_2017 wrote:
Sun Jan 21, 2018 11:35 pm
i have missed some messages in the app "telegram" if users post in forum .
so i added this lines in main_listener.php => Line 67

Code: Select all

	private function prefix_from_mode($mode)
	{
		if ($mode === 'post')
		{
			return 'erstellte neues Thema: ';
		}
That's a good idea. In the latest version I added a "Verbose notifications" option to the ACP. When set to "Yes", the notifications will be longer/clearer, like the ones you wrote in German. When set to "No", very short notifications will be used as before.

If you want to add German translations (or any other language), they can now be added directly into 'language/de/info_acp_namespace.php' and 'language/de/telegram.php' (just copy the English files and then edit).

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

Re: [3.2][BETA] Telegram Notifications

Post by demonlibra » Wed Jan 31, 2018 3:29 pm

lassik wrote:
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.
How to delete version 0.4.0 and update this extension?

jan_2017
Registered User
Posts: 122
Joined: Sun May 07, 2017 3:39 pm

Re: [3.2][BETA] Telegram Notifications

Post by jan_2017 » Fri Feb 02, 2018 5:31 pm

Hello lassik.

I have successfully installed the new version 0.5.0. It works just as I imagined it. By the way ... I upload the german language files here. For all other german users: In folder "language" a new folder "de" has to be created. These files have to go in there:

telegram.php

Code: Select all

<?php
/**
 *
 * @package phpBB extension - Telegram notifications
 * @copyright (c) 2018 Lassi Kortela
 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
 *
 */

if (!defined('IN_PHPBB'))
{
	exit;
}

if (empty($lang) || !is_array($lang))
{
	$lang = array();
}

$lang = array_merge($lang, array(
	'TELEGRAM_BRIEF_EDIT'		=> 'Bearbeitet',
	'TELEGRAM_BRIEF_QUOTE'		=> 'Zitat',
	'TELEGRAM_BRIEF_REPLY'		=> 'Antwort',
	'TELEGRAM_BRIEF_POST'		=> '',
	'TELEGRAM_BRIEF_USER'		=> 'Neuer Benutzer freigeschaltet',
	'TELEGRAM_VERBOSE_EDIT'		=> 'bearbeitete Beitrag in Thema',
	'TELEGRAM_VERBOSE_QUOTE'	=> 'antwortete mit Zitat in Beitrag',
	'TELEGRAM_VERBOSE_REPLY'	=> 'antwortete in Thema',
	'TELEGRAM_VERBOSE_POST'		=> 'schrieb ein neues Thema',
	'TELEGRAM_VERBOSE_USER'		=> 'Neuer Benutzer wurde freigeschaltet',
));
info_acp_namespace.php

Code: Select all

<?php
/**
 *
 * @package phpBB extension - Telegram notifications
 * @copyright (c) 2017, 2018 Lassi Kortela
 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
 *
 */

if (!defined('IN_PHPBB'))
{
	exit;
}

if (empty($lang) || !is_array($lang))
{
	$lang = array();
}

$lang = array_merge($lang, array(
	'ACP_TELEGRAM_BOT_AUTH_TOKEN'	=> 'Telegram BOT - Autorisierungszeichen',
	'ACP_TELEGRAM_CHAT_ID'			=> 'Telegram Chat ID',
	'ACP_TELEGRAM_CONNECTION'		=> 'Telegram Verbindung',
	'ACP_TELEGRAM_ERROR'			=> 'Fehlermeldung',
	'ACP_TELEGRAM_FIND_CHAT_ID'		=> 'Finde Chat ID',
	'ACP_TELEGRAM_FOUND_CHAT_ID'	=> 'Es wurde folgende Chat ID gefunden',
	'ACP_TELEGRAM_INCLUDE_TEXT'		=> 'Füge den Text vom Anfang des Beitrages ein',
	'ACP_TELEGRAM_LAST_ERROR'		=> 'Letzte Fehlermeldung',
	'ACP_TELEGRAM_NOTIFICATIONS'	=> 'Telegram Benachrichtigungen',
	'ACP_TELEGRAM_NOTIFY_ABOUT'		=> 'Über Ereignisse benachrichtigen',
	'ACP_TELEGRAM_NOTIFY_CONTENT'	=> 'Benachrichtigungsinhalt',
	'ACP_TELEGRAM_NOTIFY_EDIT'		=> 'Bearbeitete Beiträge anzeigen (Wenn hierzu im Beitrag die Zeile "Grund für die Bearbeitung dieses Beitrags" angegeben wird)',
	'ACP_TELEGRAM_NOTIFY_REPLY'		=> 'Antworten auf vorhandene Themen',
	'ACP_TELEGRAM_NOTIFY_TOPIC'		=> 'Neue Themen',
	'ACP_TELEGRAM_NOTIFY_USER'		=> 'Neue Benutzer (wenn das Benutzerkonto aktiviert ist)',
	'ACP_TELEGRAM_SETTINGS'			=> 'Telegram Einstellungen',
	'ACP_TELEGRAM_SETTINGS_UPDATED'	=> 'Telegram Einstellungen wurden aktualisiert',
	'ACP_TELEGRAM_USE_CHAT_ID'		=> 'Verwende diese Chat-ID',
	'ACP_TELEGRAM_VERBOSE'			=> 'Ausführliche Benachrichtigungen',
));
Please create new folder on github like "de" , "ru" ,.....
I want to upload language files ;)

I still have a suggestion for improvement:

If a reason for edited posts is entered into the cell, the Messanger notification might say:
(For example)

"Reason: Topic title deleted"

At the moment see only "Topic title deleted"

Next improvement:

I would be glad if the number of characters were adjustable, which should be displayed by the contribution.

https://github.com/lassik/phpbb-ext-tel ... s/issues/3

Very good Job!!!!!

Bye Jan
---------------------------
Edit:

And another suggestion for improvement: If a post or topic is deleted with justification, this should also be reported in the Messanger.

https://github.com/lassik/phpbb-ext-tel ... s/issues/4
---------------------------
Edit No 2:

Missing permission !!!

https://github.com/lassik/phpbb-ext-tel ... s/issues/7

User avatar
david63
Jr. Extension Validator
Posts: 14112
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: [3.2][BETA] Telegram Notifications

Post by david63 » Fri Feb 02, 2018 7:31 pm

Just for reference I note that Apple Store has removed the Telegram app due to misuse
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

jan_2017
Registered User
Posts: 122
Joined: Sun May 07, 2017 3:39 pm

Re: [3.2][BETA] Telegram Notifications

Post by jan_2017 » Fri Feb 02, 2018 8:05 pm

Oh no damned :| :evil:

Edit:

I hope that the background does not paralyze the good messenger.

By the way....google store still has it !!!

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

Re: [3.2][BETA] Telegram Notifications

Post by lassik » Sat Feb 03, 2018 2:41 pm

Now released 0.6.0 to add the language translations from eunaumtenhoid and jan_2017. Thanks a lot! If there are other language translations, please submit them here or via GitHub PR. They are easy for me to add.

The rest of the proposed changes (thanks Jan!) will take me some time, probably a few months. Some comments here: https://github.com/lassik/phpbb-ext-tel ... ons/issues
demonlibra wrote:
Wed Jan 31, 2018 3:29 pm
How to delete version 0.4.0 and update this extension?
Unfortunately this has to be done manually :( Please try the following:

1. Take a full backup of your forum.
2. Disable the Telegram Notifications extension in the ACP.
3. Delete the ext/lassik/telegramnotifications/ directory of your phpBB installation.
4. Open a database console (usually MySQL) and delete all references to the extension.
This should work (change the phpbb_ parts if you are using a different table prefix):
delete from phpbb_modules where module_langname like '%TELEGRAM%';
delete from phpbb_modules where module_basename like '%telegramnotifications%';
delete from phpbb_migrations where migration_name like '%telegramnotifications%';
5. Then install, enable and configure the latest version of Telegram Notifications as normal.

NOTE: This may leave some of the remaining parent_id/left_id/right_id columns in the phpbb_modules table in an inconsistent state. You may also want to fix them manually. I think I did that when I removed the broken 0.4.0 from our forum.
david63 wrote:
Fri Feb 02, 2018 7:31 pm
Just for reference I note that Apple Store has removed the Telegram app due to misuse
That's too bad. Thankfully it's now back: https://www.cnet.com/news/telegram-and- ... app-store/

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

Re: [3.2][BETA] Telegram Notifications

Post by demonlibra » Sun Feb 04, 2018 7:40 am

lassik wrote:
Sat Feb 03, 2018 2:41 pm
demonlibra wrote:
Wed Jan 31, 2018 3:29 pm
How to delete version 0.4.0 and update this extension?
Unfortunately this has to be done manually
Thanks.
Deleted all rows in table "phpbb_migrations" which contained word "telegram" by phpmyadmin.
Last edited by demonlibra on Sun Feb 04, 2018 8:06 am, edited 1 time in total.

jan_2017
Registered User
Posts: 122
Joined: Sun May 07, 2017 3:39 pm

Re: [3.2][BETA] Telegram Notifications

Post by jan_2017 » Sun Feb 04, 2018 7:52 am

-wrong post-

Danabek476
Registered User
Posts: 2
Joined: Sat Feb 10, 2018 6:49 am

Re: [3.2][BETA] Telegram Notifications

Post by Danabek476 » Sat Feb 10, 2018 6:51 am

Hello, please help how to turn off notifications when editing a topic?

jan_2017
Registered User
Posts: 122
Joined: Sun May 07, 2017 3:39 pm

Re: [3.2][BETA] Telegram Notifications

Post by jan_2017 » Sat Feb 10, 2018 7:53 am

Danabek476 wrote:
Sat Feb 10, 2018 6:51 am
Hello, please help how to turn off notifications when editing a topic?
You must have the current version 0.5.0 installed to change this.

Bye Jan

Danabek476
Registered User
Posts: 2
Joined: Sat Feb 10, 2018 6:49 am

Re: [3.2][BETA] Telegram Notifications

Post by Danabek476 » Mon Feb 12, 2018 5:46 am

installed 0.6
Thank you vert much

jan_2017
Registered User
Posts: 122
Joined: Sun May 07, 2017 3:39 pm

Re: [3.2][BETA] Telegram Notifications

Post by jan_2017 » Mon Feb 12, 2018 9:22 pm

Hello lassik.

What changes did you make in version 0.6.0?

Bye Jan

Post Reply

Return to “Extensions in Development”

Who is online

Users browsing this forum: Acorn, alex75, gtsoukn, jackennils and 19 guests