Giter VIP home page Giter VIP logo

phpbb-discord-notifications's People

Contributors

galixte avatar rootslinux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

phpbb-discord-notifications's Issues

Handle notifications dropped due to rate limiting

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.

Feature Request: Multiple rule sets

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.

Not all Mode's are handled.

Not all Mode's are handled in "handle_post_submit_action" of "core.submit_post_end" event

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 ๐Ÿ‘

Initial notification types to enable

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.

  • Test Notification (user-defined string that can only be sent manually by clicking a button in ACP)
  • User Created
  • Topic Created/Updated/Deleted/Locked/Unlocked
  • Post Created/Updated/Deleted

Notes:

  • It would be nice to allow the user in the ACP to select which of these event types they want notifications to be posted for.
  • Consider the relationships between topics and post notifications. Example A) creating a topic would always create a new post, so only post one notification in this case. Example B) deleting a topic containing multiple posts, and we probably only want a single notification here.
  • The test notification is useful for admins to verify that their webhooks are setup right and that the forums send data to their channel without issue. Add a default message string in the UI so that the user isn't required to enter their own data. Also, the value for the webhook used in this message should be that which is entered into the page form, not what is in the database (so that users don't have to save a webhook URL to the DB in order to test)

Doesn't work at all?

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

Error: Cannot send an empty message

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)

Feature Request: Enrinch notification message with additional context

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:

  • Add the forum user name and their forum avatar into the author field
  • Add the forum name and avatar to the username and avatar_url (will override the default Discord bot name and icon)

phpbb update broke the extension

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.

Add notifications for user to be activated

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 :

  • Rename the current user added notification ("New user activated" ?)
  • Add a new notification (" New user to activate" ?)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.