[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.
Febreen
Registered User
Posts: 20
Joined: Tue Apr 18, 2017 5:44 pm

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

Post by Febreen »

Thanks for your reply to my post.
I'll send you the french's translation when the extension'll be finished, with all translations of the futures texts u'll add on this.

Good luck for your job!
Roots
Registered User
Posts: 47
Joined: Thu Jun 17, 2004 12:53 pm
Location: Austin TX

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

Post by Roots »

Febreen wrote: Tue Nov 13, 2018 8:16 pm I'll send you the french's translation when the extension'll be finished, with all translations of the futures texts u'll add on this.
The extension is finished now. If you hurry I can submit your translation into the release of the initial extension. Actually, the best way to do this is to submit your translation as a pull request to https://github.com/rootslinux/phpbb-dis ... ifications. I'll merge it in package it, and submit it for official review.
User avatar
EFiNSTORM
Registered User
Posts: 164
Joined: Fri Dec 26, 2008 4:09 am
Location: localhost

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

Post by EFiNSTORM »

Hey,

Got a quick question I am using an external page that calls submit_post function from normal phpbb and it does not trigger an discord event.

Was wondering if you would be able to help me out.

Thanks
Roots
Registered User
Posts: 47
Joined: Thu Jun 17, 2004 12:53 pm
Location: Austin TX

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

Post by Roots »

EFiNSTORM wrote: Sun Nov 18, 2018 1:28 am Hey,

Got a quick question I am using an external page that calls submit_post function from normal phpbb and it does not trigger an discord event.

Was wondering if you would be able to help me out.

Thanks
I've been meaning to write a guide for users in the wiki for the situation where people expect a notification and don't receive one. The submit_post event generates multiple different types of notifications so it can be tricky to figure out why it's not generating one. In general, here's the steps I would take to debug:
  1. ACP: use the Send Test Message button to make sure that your webhook URL and Discord channel are setup correctly.
  2. ACP: make sure the master enable is ON (the top-most setting on the page)
  3. ACP: make sure the notification type you want to receive is enabled
  4. ACP: make sure the forum that you're making changes to is enabled to generate notifications
  5. If the action you are taking affects multiple posts or topics (ie mass delete, mass lock/unlock, etc) no notification is generated for these cases by design
  6. If your forums are very traffic heavy, or you wrote some sort of script to do multiple actions one after another, notifications may be dropped (if your board tried to send more than 5 notifications in a 5 second period)
I'm not 100% sure how your external page works. But if the way you call submit_post() doesn't generate a phpBB event (see: https://wiki.phpbb.com/Event_List ), then notifications won't work because they are completely reliant on these events being generated. So my suggestion is first check all the things I listed above. Then try comparing a normal phpBB submit (ie replying to a topic with a new post) and confirming that the notification appears. If it does, and your external page does not generate a notification, then it's something with the way your external page handles the call that is not generating the event (possibly by calling a different function than the standard one after a real submit post action).
User avatar
EFiNSTORM
Registered User
Posts: 164
Joined: Fri Dec 26, 2008 4:09 am
Location: localhost

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

Post by EFiNSTORM »

Roots wrote: Mon Nov 19, 2018 7:17 pm
EFiNSTORM wrote: Sun Nov 18, 2018 1:28 am Hey,

Got a quick question I am using an external page that calls submit_post function from normal phpbb and it does not trigger an discord event.

Was wondering if you would be able to help me out.

Thanks
I've been meaning to write a guide for users in the wiki for the situation where people expect a notification and don't receive one. The submit_post event generates multiple different types of notifications so it can be tricky to figure out why it's not generating one. In general, here's the steps I would take to debug:
  1. ACP: use the Send Test Message button to make sure that your webhook URL and Discord channel are setup correctly.
  2. ACP: make sure the master enable is ON (the top-most setting on the page)
  3. ACP: make sure the notification type you want to receive is enabled
  4. ACP: make sure the forum that you're making changes to is enabled to generate notifications
  5. If the action you are taking affects multiple posts or topics (ie mass delete, mass lock/unlock, etc) no notification is generated for these cases by design
  6. If your forums are very traffic heavy, or you wrote some sort of script to do multiple actions one after another, notifications may be dropped (if your board tried to send more than 5 notifications in a 5 second period)
I'm not 100% sure how your external page works. But if the way you call submit_post() doesn't generate a phpBB event (see: https://wiki.phpbb.com/Event_List ), then notifications won't work because they are completely reliant on these events being generated. So my suggestion is first check all the things I listed above. Then try comparing a normal phpBB submit (ie replying to a topic with a new post) and confirming that the notification appears. If it does, and your external page does not generate a notification, then it's something with the way your external page handles the call that is not generating the event (possibly by calling a different function than the standard one after a real submit post action).
It's weird mChat trigger for new topic works just fine on my forum (shows new topic creating on shoutbox). It just doesn't show in the discord notification. If I reply / delete anything in the topic created via my external page it will trigger the event on discord just fine.
Roots
Registered User
Posts: 47
Joined: Thu Jun 17, 2004 12:53 pm
Location: Austin TX

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

Post by Roots »

That is weird. It could be a number of different problems, but my guess is that it is due to an error from an unexpected data type. I considered adding error logging for this sort of thing, but I wasn't sure how to do it in phpBB in a way that wouldn't accumulate a huge log (ie I'd want the log to be automatically pruned so it doesn't balloon into a huge file).

https://github.com/rootslinux/phpbb-dis ... stener.php
If you look here and go to the handle_post_submit_action() function, you can see what the expected data is and how it determines whether to call notify_topic_created(), which actually builds the "topic created" notification type. Usually when I wasn't seeing notifications it was due to missing data in these structures that are built up and passed around, as unexpected/missing data would cause an error which would cause the whole notification system to fail for that message.
User avatar
EFiNSTORM
Registered User
Posts: 164
Joined: Fri Dec 26, 2008 4:09 am
Location: localhost

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

Post by EFiNSTORM »

Thanks for all your help I tracked down the issue it was on my end due to wrong spacing and the remove_formatting() function was unable to remove the BBcode from the post.
Roots
Registered User
Posts: 47
Joined: Thu Jun 17, 2004 12:53 pm
Location: Austin TX

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

Post by Roots »

Cool, glad you found a fix for it.
Kacer
Registered User
Posts: 3
Joined: Sun Nov 25, 2018 7:44 pm

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

Post by Kacer »

Heyya,

I'm currently facing the problem that my discord won't receive any message at all from the bot.
I've installed the extension without any issue, I've created for testing purposes a new discord and web hook.
The extension is enabled and the discord webhook URL input field contains the desired url (copied form discord webhook tab). I've tried to send a test message, and tried with a Notification type+forum. Still no message.
I'm running phpBB 3.2.4
PHP Version 7.2.10
cURL support enabled
cURL Information 7.59.0

Any way to back trace the problem?
Thank you for any help!
Roots
Registered User
Posts: 47
Joined: Thu Jun 17, 2004 12:53 pm
Location: Austin TX

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

Post by Roots »

My recommendation:

First try using the curl program or another application to send a message to your webhook. For example, run the following:
curl -H "Content-Type: application/json" -X POST -d '{"username": "test", "content": "hello"}' YOURWEBHOOKURL
If you can confirm that your webhook can receive messages this way, then we know its not a problem with your Discord setup.


Using the "Send test message" button in the ACP panel is the most sure-fire way to verify that the extension is working. The only thing you need to set for the test message is the webhook URL (all other enable/disable settings are ignored in this case). If your webhook URL is entered correctly and its still not working, check to make sure you have the php-curl library installed on your system: http://php.net/manual/en/book.curl.php This is a requirement for this extension to run.


I hope that helps. If you're still not getting any messages sending then there's something else funky going on. Also FYI, I'm going to be totally unavailable for two weeks starting the day after tomorrow, so I'll be unable to provide any support for that time.
Kacer
Registered User
Posts: 3
Joined: Sun Nov 25, 2018 7:44 pm

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

Post by Kacer »

Roots wrote: Mon Nov 26, 2018 6:35 pm My recommendation:

First try using the curl program or another application to send a message to your webhook. For example, run the following:
curl -H "Content-Type: application/json" -X POST -d '{"username": "test", "content": "hello"}' YOURWEBHOOKURL
If you can confirm that your webhook can receive messages this way, then we know its not a problem with your Discord setup.


Using the "Send test message" button in the ACP panel is the most sure-fire way to verify that the extension is working. The only thing you need to set for the test message is the webhook URL (all other enable/disable settings are ignored in this case). If your webhook URL is entered correctly and its still not working, check to make sure you have the php-curl library installed on your system: http://php.net/manual/en/book.curl.php This is a requirement for this extension to run.


I hope that helps. If you're still not getting any messages sending then there's something else funky going on. Also FYI, I'm going to be totally unavailable for two weeks starting the day after tomorrow, so I'll be unable to provide any support for that time.
Heyya,

Thank you very much I was able to resolve the problem thanks to your help!

Code: Select all

(60) SSL certificate : unable to get local issuer certificate
The problem as you guessed, was indeed with curl. Curl was unable to verify the certificate that I provided on the server a nicely signed certificate and a minor change in php.ini fixed my problem!

Thank you!
Roots
Registered User
Posts: 47
Joined: Thu Jun 17, 2004 12:53 pm
Location: Austin TX

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

Post by Roots »

Great! I'm glad to hear it. :)
Kacer
Registered User
Posts: 3
Joined: Sun Nov 25, 2018 7:44 pm

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

Post by Kacer »

Heyya I would like to gratefully thank you about your splendid work! The bot works fine and does what it intends to do.

I may ask a little too much but I would like to suggest a feature.
The intention is to use this extension with multiple webhooks towards multiple discord channels, making it "expandable".
Currently the bot sends everything to one discord channel

Here's an example:
Forum Announcement webhook bot -> Fetches only the Forum "Announcement" category/section and sends it to the f.ex. #general discord channel
Forum Report webhook bot -> Fetches only the Forum "Report" category/section and sends it to the f.ex. #report discord channel

As it is for now, it works perfectly fine :)
Roots
Registered User
Posts: 47
Joined: Thu Jun 17, 2004 12:53 pm
Location: Austin TX

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

Post by Roots »

I think that's a fine suggestion, and I believe it's covered by the feature request reported by another user here: https://github.com/rootslinux/phpbb-dis ... /issues/23 . Feel free to add a comment to that if there's something not covered that you'd like to see, or add an entirely new issue if you don't feel that covers what you're asking.


That request will take quite a lot of work to implement, so don't expect it anytime soon. If enough users ask for it, its more likely that it will come in the future. Of course, anyone is welcome to come along and implement it themselves if they like, as I'm not sure when I'd be able to get around to it.
User avatar
Galixte de EzCom
Registered User
Posts: 1106
Joined: Mon Oct 04, 2004 11:14 pm
Location: France
Name: Raphaël M.

FRENCH translation for the Discord Notifications extension

Post by Galixte de EzCom »

Hi,

this is the FRENCH translation for the Discord Notifications extension, available on GitHub and on the EzCom Community.
Communau EzCom
📖 « Traductions d’extensions & styles pour phpBB 3.2.x & 3.3.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.

Return to “Abandoned Extensions”