rootslinux / phpbb-discord-notifications Goto Github PK
View Code? Open in Web Editor NEWphpBB Extension that publishes forum event notifications to a Discord channel
License: GNU General Public License v2.0
phpBB Extension that publishes forum event notifications to a Discord channel
License: GNU General Public License v2.0
If the notification service sends a large number of messages within a short time window, Discord will return a failure response indicating that the message was not accepted due to rate limiting, and will provide a timer in which requests will become accepted again (usually 1-2 seconds). The naive implementation of the current system does not handle failures and simply drops the message completely. This means that we could have the case where notifications are generated but never seen in Discord due to being dropped by the rate limiting response.
To fix this, we need to look at the response generated from the curl call and see if there's a failure due to rate limiting. If so, place the message on a queue and retry later once the limiting period has expired. When a new message is about to be sent, the queue should first be checked and if any messages are in the queue, add the new message to the queue instead of sending. The queue should only hold valid messages. If any other failures occur due to invalid formatting or other issues that will not automatically resolve, the message should be dropped (and possibly logged).
All of this logic should take place in notification_service.php. This is a low priority item as we don't expect rate limiting to be a problem under most circumstances. Although forums that are very active will have a higher likelihood of encountering this problem.
It would be nice if we had the ability to set up multiple notifications sets so it could send notifications to different Discord channels based on different criteria rules.
Hi @rootslinux,
Did you see this issue reported here: https://www.phpbb.com/community/viewtopic.php?p=15187251#p15187251 ?
Following case's are there for mode in "core.submit_post_end":
case 'post':
case 'reply':
case 'quote':
case 'edit_topic':
case 'edit_first_post':
case 'edit':
case 'edit_last_post':
Of which This are not handled:
case 'quote':
case 'edit_topic':
case 'edit_first_post':
case 'edit_last_post':
Suggestion :
case 'quote':
{Should be same as 'notify_post_created'}
[!!!IMPORTANT!!! this does not even make Notification]
case 'edit_topic':
{Should be same as 'notify_topic_updated'}
case 'edit_first_post':
{Should be same as 'notify_topic_updated'}
case 'edit_last_post':
{Should be same as 'notify_post_updated'}
Especially the case 'quote'
.
Thanking you ๐
Best regards ๐
Making a note to myself on what type of events I initially want notifications to be generated for. This list can be expanded upon in future iterations if needed.
Notes:
Hey,
So I have the webhook URL that is set in the ACP settings, and I have also set the specific channel where the webhook should post the message, however, it simply doesn't, not even with the test button, there are no errors, the error log also doesn't say anything, can we debug what's wrong here?
Thanks
Would it be possible to change/edit the url to the forum? I have a shorter version as mine sits in an iframe.
So as an example my url's are like this:
https://www.website.eu/forum.php?t=94
instead of:
https://www.website.eu/forum/viewtopic.php?t=94t=94
Thank you
When I am sending replays to the forum topics, I see this
{"message": "Cannot send an empty message", "code": 50006}[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 1868: Cannot modify header information - headers already sent by (output started at [ROOT]/ext/roots/discordnotifications/notification_service.php:328)
Discord notifications support a wealth of enriched content. As of release 1.0.0, we are using color, description, and footer. But as the link below shows, there's much more that could be added with these messages:
https://birdie0.github.io/discord-webhooks-guide/discord_webhook.html
Suggestions to consider:
The extension appears to have been made non-functional by the latest phpbb update.
Attempting to make a new post:
{"message": "Cannot send an empty message", "code": 50006}[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 1847: Cannot modify header information - headers already sent by (output started at [ROOT]/ext/roots/discordnotifications/notification_service.php:328)
The message isn't empty.
Hi,
On my forum, we require an admin activation for new accounts and we want to use your extension to get notified when we have new accounts to review.
We currently only get notifications after an account is activated.
To keep the current behavior, I suggest to :
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.