[ABD] Discord Notifications -- send messages to Discord to report forum events

Any abandoned Extensions will be moved to this forum.

WARNING: Extensions in this forum are not currently being supported or maintained by the original Extension author. Proceed at your own risk.
Forum rules
IMPORTANT: Extension Development Forum rules

WARNING: Extensions in this forum are not currently being supported nor updated by the original Extension author. Proceed at your own risk.
nou nou
Registered User
Posts: 328
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.2][RC] Discord Notifications -- send messages to Discord to report forum events

Post by nou nou » Wed Feb 06, 2019 5:08 am

I don't mean to spam this topic, but I've seemingly managed to fix this bug in notification_service.php.

You can strip the tabs from the message footer (which is the post preview) by changing

Code: Select all

$footer = str_replace(array("\r", "\n"), ' ', $footer);
into

Code: Select all

$footer = str_replace(array("\r", "\n", "\t"), ' ', $footer);
For good measure, I'm doing the same with $message, by looking for

Code: Select all

$message = str_replace('"', "'", $message);
after which I added

Code: Select all

$message = str_replace("\t"," ", $message);
So far everything is going through nicely!

User avatar
Galixte de EzCom
Registered User
Posts: 1028
Joined: Mon Oct 04, 2004 11:14 pm
Location: France
Name: Raphaël M.
Contact:

Re: [3.2][RC] Discord Notifications -- send messages to Discord to report forum events

Post by Galixte de EzCom » Wed Feb 06, 2019 9:28 am

Hi nou nou,

could you submit pull requests on GitHub? https://github.com/rootslinux/phpbb-dis ... ions/pulls
Communau EzCom
📖 « Traductions d’extensions & styles pour phpBB 3.1.x & 3.2.x ».
📋 Lists of all extensions identified for phpBB 3.1.x & 3.2.x.
📋 Lists of all styles identified for phpBB 3.1.x & 3.2.x.
Image Tu as un forum et tu veux aussi un site web ? Regarde par ici.

nou nou
Registered User
Posts: 328
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.2][RC] Discord Notifications -- send messages to Discord to report forum events

Post by nou nou » Wed Feb 06, 2019 5:26 pm

I have zero experience with GitHub (other than downloading from it :)) but I can look into that, sure!

EDIT: Done! (I think).

Slipscream
Registered User
Posts: 10
Joined: Sun Feb 24, 2019 6:08 pm

Re: [3.2][RC] Discord Notifications -- send messages to Discord to report forum events

Post by Slipscream » Thu Feb 28, 2019 8:38 pm

So happy this extension exists for PHPBB.

I do have a request, IF you still are taking them. When I used to run IPS, there was a mod much like this, but it allowed you to pick the channel you wanted to post to PER FORUM. So for example, a post appears in FORUM A and is announced in discord in #CHANNEL_A while another post is posted in FORUM B and sent to discord #CHANNEL_B.

Is this something you would look into adding> It would really add the "cherry on the cake" as it were.

OR alternatively, could you explain what files I would need to edit in order to duplicate the extension? That would almost be easiest as I could then just create webhooks for whatever instances of the extension I am running.

Slipscream
Registered User
Posts: 10
Joined: Sun Feb 24, 2019 6:08 pm

Re: [3.2][RC] Discord Notifications -- send messages to Discord to report forum events

Post by Slipscream » Wed Mar 06, 2019 3:54 pm

Anyone have a clue of how to duplicate this extension? I thought I had it sorted but despite my efforts, it did not work. This is such an awesome extension but it is missing the ability to select which channel on discord gets posted to based on the forum. All I want to do is dup this so PHPBB thinks it's a different extension to allow me to run multiple copies.

Any help on this would be appreciated.

Skyrider
Registered User
Posts: 18
Joined: Tue Nov 15, 2011 12:23 pm

Re: [3.2][RC] Discord Notifications -- send messages to Discord to report forum events

Post by Skyrider » Wed Mar 20, 2019 11:55 pm

+1

Wanting this as well. I'd like staff forum sections to be relayed to the staff channels on discord.

sellenium
Registered User
Posts: 1
Joined: Sat Jul 06, 2019 4:50 pm

Re: [3.2][RC] Discord Notifications -- send messages to Discord to report forum events

Post by sellenium » Sat Jul 06, 2019 4:56 pm

Is it possible to replace Discord with Viber or Messenger (Facebook)?

User avatar
salvocortesiano
Registered User
Posts: 181
Joined: Mon Mar 22, 2010 1:49 pm
Location: Florence (Italy)
Name: Salvo Cortesiano
Contact:

Re: [3.2][RC] Discord Notifications -- send messages to Discord to report forum events

Post by salvocortesiano » Wed Jul 17, 2019 3:42 pm

Great extension Roots. :D Translation in Italian.
acp_discord_notifications.php

Code: Select all

<?php
/**
 * Discord Notifications extension for the phpBB Forum Software package.
 *
 * @copyright (c) 2018, Tyler Olsen, https://github.com/rootslinux
 * @license GNU General Public License, version 2 (GPL-2.0)
 *
 * This file contains the language strings for the ACP settings page for this extension.
 *
 * iTALiAN translation by Salvo Cortesiano -> https://www.netshadows.it/ombra/
 *
 */

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

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

$lang = array_merge($lang, array(
	// ACP Extension Settings Page
	'DN_ACP_DESCRIPTION'			=> 'Queste impostazioni consentono a vari eventi sul forum di inviare messaggi di notifica a un server Discord.',

	'DN_MAIN_SETTINGS'				=> 'Impostazioni principali',
	'DN_MASTER_ENABLE'				=> 'Abilita Notifiche Discord',
	'DN_WEBHOOK_URL'				=> 'Discord Webhook URL',
	'DN_WEBHOOK_DESCRIPTION'		=> 'L’URL del webhook generato dal server Discord. Guarda <a href="https://support.discordapp.com/hc/it/articles/228383668-Intro-to-Webhooks">questo artico</a> su come creare un nuovo webhook.',
	'DN_POST_PREVIEW_LENGTH'		=> 'Anteprima Lunghezza Messaggio',
	'DN_POST_PREVIEW_DESCRIPTION'	=> 'Specificare il numero di caratteri da visualizzare in un’anteprima del post (10 - 2000). Il valore 0 (zero) disabilita l’anteprima del post.',
	'DN_TEST_MESSAGE'				=> 'Messaggio di prova',
	'DN_TEST_MESSAGE_TEXT'			=> 'Questo è un test: Ciao Discord!',
	'DN_TEST_DESCRIPTION'			=> 'Messaggio da inviare a Discord per verificare che la connessione con phpBB funzioni.',
	'DN_SEND_TEST'					=> 'Invia un messaggio di prova',
	'DN_SEND_TEST_DESCRIPTION'		=> 'Invia il contenuto del messaggio di prova al webhook di Discord. Usalo per verificare che il tuo webhook funzioni correttamente.',

	'DN_TYPE_SETTINGS'				=> 'Tipi di notifica',
	'DN_TYPE_DESCRIPTION'			=> 'Seleziona quali notifiche devono essere inviati a Discord',
	'DN_POST_CREATE'				=> 'Messaggio creato',
	'DN_POST_UPDATE'				=> 'Messaggio aggiornato',
	'DN_POST_DELETE'				=> 'Messaggio cancellato',
	'DN_POST_LOCK'					=> 'Messaggio bloccato',
	'DN_POST_UNLOCK'				=> 'Messaggio sbloccato',
	'DN_TOPIC_CREATE'				=> 'Argomento creato',
	'DN_TOPIC_UPDATE'				=> 'Argomento aggiornato',
	'DN_TOPIC_DELETE'				=> 'Argomento cancellato',
	'DN_TOPIC_LOCK'					=> 'Argomento bloccato',
	'DN_TOPIC_UNLOCK'				=> 'Argomento sbloccato',
	'DN_USER_CREATE'				=> 'Utente creato',
	'DN_USER_DELETE'				=> 'Utente cancellato',

	'DN_FORUM_SETTINGS'				=> 'Forum di notifica',
	'DN_FORUM_DESCRIPTION'			=> 'Seleziona quali forum devono generare notifiche per eventi specifici del forum, come quelli relativi a messaggi e argomenti',

	// Messages that appear after a user tries to send a test message
	'DN_TEST_SUCCESS'				=> 'Successo! Controlla il tuo server Discord, dovresti vedere il messaggio di test visualizzato lì.',
	'DN_TEST_FAILURE'				=> 'Si è verificato un problema durante l’invio del messaggio di prova. Controlla il tuo URL webhook e verifica che il tuo server soddisfi i requisiti dell’estensione.',
	'DN_TEST_BAD_MESSAGE'			=> 'Inserisci almeno un carattere per il messaggio di prova',
	'DN_TEST_BAD_WEBHOOK'			=> 'L’URL webhook non è un URL valido. Verifica questa impostazione e riprova.',

	// Success/Failure messages that can be generated once the user saves
	'DN_SETTINGS_SAVED'				=> 'Impostazioni di notifica Discord modificate con successo.',
	'DN_MASTER_WEBHOOK_REQUIRED'	=> 'Per abilitare le notifiche è necessario un URL webhook Discord valido.',
	'DN_WEBHOOK_URL_INVALID'		=> 'L’URL webhook di Discord deve essere un URL completo e valido.',
	'DN_POST_PREVIEW_INVALID'		=> 'La lunghezza dell’anteprima del messaggio deve essere un numero compreso tra 10 e 2000 oppure 0 (zero) per disabilitare le anteprime.',
));
discord_notification_messages.php

Code: Select all

<?php
/**
 * Discord Notifications extension for the phpBB Forum Software package.
 *
 * @copyright (c) 2018, Tyler Olsen, https://github.com/rootslinux
 * @license GNU General Public License, version 2 (GPL-2.0)
 *
 * This file contains the language strings for the notification messages that are transmitted to Discord.
 *
 * iTALiAN translation by Salvo Cortesiano -> https://www.netshadows.it/ombra/
 *
 */

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

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

// These messages are used by the event/notification_event_listener class. The notifications naturally generate dynamic content,
// and this is done using formatted strings passed to sprintf(). Each notification message below has a comment indicating what each
// %s string argument should represent (typically this is a hyperlink with text describing a user, topic, post, or forum).
// Note that the order of what gets populated in the %s arguments is unfortunately fixed, meaning that this could make good
// translations into other difficult.
$lang = array_merge($lang, array(
	// Post Notifications
	'CREATE_POST'				=> '%s %s creato un nuovo %s nell’argomento %s situato nel forum %s', // %s == emoji, user, post, topic, forum
	'UPDATE_POST_SELF'			=> '%s %s modificato il loro %s nell’argomento %s situato nel forum %s', // %s == emoji, user, post, topic, forum
	'UPDATE_POST_OTHER'			=> '%s %s modificato il %s scritto da %s nell’argomento %s situato nel forum %s', // %s == emoji, edit user, post, user, topic, forum
	'DELETE_POST'				=> '%s Messaggio cancellato dall’utente %s nell’argomento %s situato nel forum %s', // %s == emoji, user, topic, forum
	'LOCK_POST'					=> '%s Il %s scritto dall’utente %s nell’argomento intitolato %s nel %s forum è stato bloccato', // %s == emoji, post, user, topic, forum
	'UNLOCK_POST'				=> '%s Il %s scritto dall’utente %s nell’argomento intitolato %s nel %s forum è stato sbloccato', // %s == emoji, post, user, topic, forum

	// Topic Notifications
	'CREATE_TOPIC'				=> '%s %s creato un nuovo topic titolo %s nel %s forum', // %s == emoji, user, topic, forum
	'UPDATE_TOPIC_SELF'			=> '%s %s ha modificato il loro argomento %s situato nel forum %s', // %s == emoji, user, topic, forum
	'UPDATE_TOPIC_OTHER'		=> '%s %s modificato l’argomento %s scritto da %s situato nel forum %s', // %s == emoji, edit user, topic, user, forum
	'DELETE_TOPIC'				=> '%s Eliminato l’argomento avviato dall’utente %s titolato \'%s\' contenente %d messaggi nel forum %s', // %s/d == emoji, user, topic title, post count, forum
	'LOCK_TOPIC'				=> '%s L’argomento titolato %s nel %s avviato dall’utente %s è stato bloccato', // %s == emoji, topic, forum, user
	'UNLOCK_TOPIC'				=> '%s L’argomento titolato %s nel %s avviato dall’utente %s è stato sbloccato', // %s == emoji, topic, forum, user

	// User Notifications
	'CREATE_USER'				=> '%s Nuovo account utente creato per %s', // %s == emoji, user
	'DELETE_USER'				=> '%s Account eliminato per l’utente %s', // %s == emoji, user
	'DELETE_MULTI_USER'			=> '%s Account cancellati per gli utenti %s', // %s == emoji, list of users

	// Additional Text
	'PREVIEW'					=> 'Anteprima: ',
	'REASON'					=> 'Ragione: ',
	'POST'						=> 'messaggio',
	'AND'						=> 'e',
	'CONJ'						=> ',', // short for "conjunction character"
	'OTHER'						=> 'altro',
	'OTHERS'					=> 'altri',
	'UNKNOWN_USER'				=> '{user}',
	'UNKNOWN_FORUM'				=> '{forum}',
	'UNKNOWN_TOPIC'				=> '{topic}',
));
info_acp_discord_notifications.php

Code: Select all

<?php
/**
 * Discord Notifications extension for the phpBB Forum Software package.
 *
 * @copyright (c) 2018, Tyler Olsen, https://github.com/rootslinux
 * @license GNU General Public License, version 2 (GPL-2.0)
 *
 * iTALiAN translation by Salvo Cortesiano -> https://www.netshadows.it/ombra/
 *
 */

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

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

$lang = array_merge($lang, array(
	// ACP Module
	'ACP_DISCORD_NOTIFICATIONS'					=> 'Notifiche Discord',
	'ACP_DISCORD_NOTIFICATIONS_TITLE'			=> 'Impostazioni di notifica Discord',

	// ACP Logs
	'ACP_DISCORD_NOTIFICATIONS_LOG_UPDATE'		=> '<strong>Impostazioni di notifica Discord modificate</strong>',
));
Best regards
Salvo Cortesiano
The best way to predict the future is to invent it!
Image

User avatar
salvocortesiano
Registered User
Posts: 181
Joined: Mon Mar 22, 2010 1:49 pm
Location: Florence (Italy)
Name: Salvo Cortesiano
Contact:

Re: [3.2][RC] Discord Notifications -- send messages to Discord to report forum events

Post by salvocortesiano » Wed Jul 17, 2019 4:18 pm

sellenium wrote:
Sat Jul 06, 2019 4:56 pm
Is it possible to replace Discord with Viber or Messenger (Facebook)?
webhooks:
GitHub
CircleCI
DataDog
PHPBB
No webhooks:
Twitch / YouTube
Nelly The Hamster
Facebook

Regards
The best way to predict the future is to invent it!
Image

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

Re: [ABD] Discord Notifications -- send messages to Discord to report forum events

Post by Paul » Thu Jul 18, 2019 4:56 am

This topic has been marked as [ABD] - Abandoned as the extension author has not been active recently. If the extension author wishes to continue development, please PM anyone on the Extension Customisations Team to request this topic be unlocked.

Notice!
We do not recommend that a user of the phpBB software install this extension, or any other extension that is marked as "abandoned" or "in development", on a live forum. Doing so may cause your forum to not perform in the manner it should.


Thank you,
The phpBB Extension Customisations Team
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development

Locked

Return to “Abandoned Extensions”