Giter Club home page Giter Club logo

phpbb-discord-notifications's Introduction

phpbb-discord-notifications

Build Status

A phpBB extension that publishes notification messages to a Discord channel when certain events occur on a phpBB board. The intent of this extension is meant to announce content changes on a forum to a community residing on a Discord server. It is not intended as a compliment to the announcements found within the phpBB admin or moderator control panels. See the wiki for additional information.

Installation

Copy the extension to phpBB/ext/mober/discordnotifications

Go to "ACP" > "Customise" > "Extensions" and enable the "Discord Notifications" extension.

Additional languages

There are translations provided by other users which are not distributed with this extension:

https://www.phpbb.com/customise/db/extension/discord_notifications_2/support/topic/237636

Tests and Continuous Integration

We use Travis-CI as a continuous integration server and phpunit for our unit testing. See more information on the phpBB Developer Docs. To run the tests locally, you need to install phpBB from its Git repository. Afterwards run the following command from the phpBB Git repository's root:

Windows:

phpBB\vendor\bin\phpunit.bat -c phpBB\ext\roots\discordnotifications\phpunit.xml.dist

Other Systems:

phpBB/vendor/bin/phpunit -c phpBB/ext/roots/discordnotifications/phpunit.xml.dist

License

GPLv2

phpbb-discord-notifications's People

Contributors

echtkpvl avatar efinst0rm avatar galixte avatar m-ober avatar nou-nou avatar rootslinux avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

phpbb-discord-notifications's Issues

No message preview

Got the webhook all running, however I don't get any message preview in Discord
image

image

Is there possibly a permission required within phpBB for the extension to be able to read the message?

Webhook error sending test messages.

Information
There was a problem with sending the test message. Check your webhook URL and verify your server meets the extension requirements

I'm using the exactly version you used for the testing version which is 3.3.5

Webhook is correct and copied directly from Discord itself.

AJAX Error when locking topics

Since the lock thread event doesn't include post_id, post_subject, poster_id, or username, it results in 4 PHP errors, which end up logging to HTML, and polluting the JSON response, causing bad moderator feedback.

I patched this on my forum by null-coalescing these values, though I have not tested whether this causes issues with the respective event hook, as we don't use the topic lock hooks for our community.

                $lock_data = array();
                $lock_data['forum_id'] = $event['data'][$id]['forum_id'];
                $lock_data['forum_name'] = $event['data'][$id]['forum_name'];
+               $lock_data['post_id'] = $event['data'][$id]['post_id'] ?? null;
+               $lock_data['post_subject'] = $event['data'][$id]['post_subject'] ?? null;
                $lock_data['topic_id'] = $event['data'][$id]['topic_id'];
                $lock_data['topic_title'] = $event['data'][$id]['topic_title'];
                // Two sets of user data captured: one for the post (if applicable) and one for the user that started the topic
+               $lock_data['post_user_id'] = $event['data'][$id]['poster_id'] ?? null;
+               $lock_data['post_user_name'] = $event['data'][$id]['username'] ?? null;
                $lock_data['topic_user_id'] = $event['data'][$id]['topic_poster'];
                $lock_data['topic_user_name'] = $event['data'][$id]['topic_first_poster_name'];

Make default language configurable / use default forum language

Currently the language/translation chosen by the user who triggered an event is also used to render the Discord notification. Forum wide events (for example: user created) use the default forum language.

This can lead to inconsistent notification languages, depending on how many translations are installed/used.

The language for Discord notifications should either be configurable or set to the default forum language.

Ping roles with notification

Guten tag, ich habe leider absolut 0 Ahnung wie ich jemmanden direkt anschreiben aknn via Github auch wenn ich das in diesem fall gerne machen würde.

Gibt es die möglichkeit das der webhook eine angegebene Gruppe pingt wenn etwas neues gekommen ist? ich habe versucht im Reply die @ gruppe anzugeben aber das hat lediglich nen text gepostet mit dieser gruppe aber ohne diese gruppe zu pingen auf Discord.

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.