All Projects → kulttuuri → DiscordNotifications

kulttuuri / DiscordNotifications

Licence: MIT License
Integrate Discord with Mediawiki. Sends notifications into your Discord room when certain actions are being performed in your wiki (for example when article is being edited, new article was added...)

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to DiscordNotifications

mediawiki-api-demos
Demo apps and code snippets in Python, Javascript and PHP demonstrating how to use various modules of the MediaWiki Action API
Stars: ✭ 125 (+247.22%)
Mutual labels:  mediawiki
mediawiki rust
Rust API interface for MediaWiki sites.
Stars: ✭ 23 (-36.11%)
Mutual labels:  mediawiki
SemanticBreadcrumbLinks
Provides in-page navigation by building breadcrumb links from an attributive property filter.
Stars: ✭ 15 (-58.33%)
Mutual labels:  mediawiki
SemanticCite
Allows to manage citation resources using semantic annotations
Stars: ✭ 22 (-38.89%)
Mutual labels:  mediawiki
WikibaseImport
Import entities from another Wikibase instance (e.g. Wikidata)
Stars: ✭ 25 (-30.56%)
Mutual labels:  mediawiki
meza
Setup an enterprise MediaWiki server with simple commands
Stars: ✭ 38 (+5.56%)
Mutual labels:  mediawiki
wikibot
Some MediaWiki bot examples including wikipedia, wikidata using MediaWiki module of CeJS library. 採用 CeJS MediaWiki 自動化作業用程式庫來製作 MediaWiki (維基百科/維基數據) 機器人的範例。
Stars: ✭ 26 (-27.78%)
Mutual labels:  mediawiki
bitnami-docker-mediawiki
Bitnami Docker Image for MediaWiki
Stars: ✭ 89 (+147.22%)
Mutual labels:  mediawiki
SemanticExtraSpecialProperties
Provides extra special properties to Semantic MediaWiki.
Stars: ✭ 24 (-33.33%)
Mutual labels:  mediawiki
SemanticResultFormats
Provides additional visualizations (result formats) for Semantic MediaWiki
Stars: ✭ 40 (+11.11%)
Mutual labels:  mediawiki
Mermaid
Provides a parser function to generate diagrams and flowcharts with the help of the mermaid script language
Stars: ✭ 27 (-25%)
Mutual labels:  mediawiki
Dota2WebApi
A Dota 2 Web API for Liquipedia
Stars: ✭ 24 (-33.33%)
Mutual labels:  mediawiki
DiscordWikiBot
Discord bot for Wikimedia projects and MediaWiki wiki sites
Stars: ✭ 30 (-16.67%)
Mutual labels:  mediawiki
tutorials
Collection of tutorials for various libraries and technologies
Stars: ✭ 98 (+172.22%)
Mutual labels:  mediawiki
WikiSearch
A flutter search engine based on MediaWiki with caching.
Stars: ✭ 39 (+8.33%)
Mutual labels:  mediawiki
rdf2smw
Convert RDF to Semantic MediaWiki facts in MediaWiki XML format, with a standalone commandline tool
Stars: ✭ 18 (-50%)
Mutual labels:  mediawiki
wikiapi
JavaScript MediaWiki API for node.js
Stars: ✭ 28 (-22.22%)
Mutual labels:  mediawiki
efi-install-guide-source
The MediaWiki source pages for "Sakaki's EFI Install Guide" (as hosted on the Gentoo wiki)
Stars: ✭ 19 (-47.22%)
Mutual labels:  mediawiki
mediawiki twentyten
The TwentyTen theme for WordPress ported to a MediaWiki skin.
Stars: ✭ 14 (-61.11%)
Mutual labels:  mediawiki
Wikitext-VSCode-Extension
A Visual Studio Code Extension that provides language support for Wikitext.
Stars: ✭ 50 (+38.89%)
Mutual labels:  mediawiki

Discord MediaWiki

This is a extension for MediaWiki that sends notifications of actions in your Wiki like editing, adding or removing a page into Discord channel.

Looking for extension that can send notifications to HipChat or Slack?

Screenshot

Supported MediaWiki operations to send notifications

  • Article is added, removed, moved or edited.
  • Article protection settings are changed.
  • Article is imported.
  • New user is added.
  • User is blocked.
  • User groups are changed.
  • File is uploaded.
  • ... and each notification can be individually enabled or disabled :)

Language Support

This extension supports language localisation. Notifications are being sent in the language set to your localSettings.php file in the variable wgLanguageCode.

Want to translate this extension to your language? Just visit translatewiki.net and follow the guides! :)

Upgrading extension

Upgrading from older version to 1.1.3 of this extension has one change that you need to take into account:

  • All configuration parameters now use the format wgDiscord. If you had configured any of the wgNotificationWikiUrlEnding parameters, you need to change these to format: wgDiscordNotificationWikiUrlEnding.

Requirements

  • cURL or ability to use PHP function file_get_contents for sending the data. Defaults to cURL. See the configuration parameter $wgDiscordSendMethod below to switch between cURL and file_get_contents.
  • MediaWiki 1.25+
  • Apache should have NE (NoEscape) flag on to prevent issues in URLs. By default you should have this enabled.

How to install

  1. Create a new Discord Webhook for your channel. You can create and manage webhooks for your channel by clicking the settings icon next to channel name in the Discord app. Read more from here: https://support.discordapp.com/hc/en-us/articles/228383668

  2. After setting up the Webhook you will get a Webhook URL. Copy that URL as you will need it in step 4.

  3. Download latest release of this extension, uncompress the archive and move folder DiscordNotifications into your mediawiki_installation/extensions folder. (And instead of manually downloading the latest version, you could also just git clone this repository to that same extensions folder).

  4. Add settings listed below in your localSettings.php. Note that it is mandatory to set these settings for this extension to work:

require_once("$IP/extensions/DiscordNotifications/DiscordNotifications.php");
// Required. Your Discord webhook URL. Read more from here: https://support.discordapp.com/hc/en-us/articles/228383668
$wgDiscordIncomingWebhookUrl = "";
// Required. Name the message will appear to be sent from. Change this to whatever you wish it to be.
$wgDiscordFromName = $wgSitename;
// Avatar to use for messages. If blank, uses the webhook's default avatar.
$wgDiscordAvatarUrl = "";
// URL into your MediaWiki installation with the trailing /.
$wgDiscordNotificationWikiUrl = "http://your_wiki_url/";
// Wiki script name. Leave this to default one if you do not have URL rewriting enabled.
$wgDiscordNotificationWikiUrlEnding = "index.php?title=";
// What method will be used to send the data to Discord server. By default this is "curl" which only works if you have the curl extension enabled. There have been cases where VisualEditor extension does not work with the curl method, so in that case the recommended solution is to use the file_get_contents method. This can be: "curl" or "file_get_contents". Default: "curl".
$wgDiscordSendMethod = "curl";
  1. Enjoy the notifications in your Discord room!

Additional options

These options can be set after including your plugin in your localSettings.php file.

Customize request call method (Fix extension not working with VisualEditor)

By default this extension uses curl to send the requests to slack's API. If you use VisualEditor and get unknown errors, do not have curl enabled on your server or notice other problems, the recommended solution is to change method to file_get_contents.

$wgDiscordSendMethod = "file_get_contents";

Send notifications to multiple channels

You can add more webhook urls that you want to send notifications to by adding them in this array:

$wgDiscordAdditionalIncomingWebhookUrls = ["https://yourUrlOne.com", "https://yourUrlTwo..."];

Remove additional links from user and article pages

By default user and article links in the nofication message will get additional links for ex. to block user, view article history etc. You can disable either one of those by setting settings below to false.

// If this is true, pages will get additional links in the notification message (edit | delete | history).
$wgDiscordIncludePageUrls = true;
// If this is true, users will get additional links in the notification message (block | groups | talk | contribs).
$wgDiscordIncludeUserUrls = true;
// If this is true, all minor edits made to articles will not be submitted to Discord.
$wgDiscordIgnoreMinorEdits = false;

Disable new user extra information

By default we show full name of newly created user in the notification. You can disable this setting using the settings below. This is helpful for example in situation where you do not want to expose this information for users in your Discord channel.

// If this is true, newly created user full name is added to notification.
$wgDiscordShowNewUserFullName = true;

Show edit size

By default we show size of the edit. You can hide this information with the setting below.

$wgDiscordIncludeDiffSize = false;

Disable notifications from certain user roles

By default notifications from all users will be sent to your Discord room. If you wish to exclude users in certain group to not send notification of any actions, you can set the group with the setting below.

// If this is set, actions by users with this permission won't cause alerts
$wgDiscordExcludedPermission = "";

Disable notifications from certain pages / namespaces

You can exclude notifications from certain namespaces / articles by adding them into this array. Note: This targets all pages starting with the name.

// Actions (add, edit, modify) won't be notified to Discord room from articles starting with these names
$wgDiscordExcludeNotificationsFrom = ["User:", "Weirdgroup"];

Show non-public article deletions

By default we do not show non-public article deletion notifications. You can change this using the parameter below.

$wgDiscordNotificationShowSuppressed = true;

Actions to notify of

MediaWiki actions that will be sent notifications of into Discord. Set desired options to false to disable notifications of those actions.

// New user added into MediaWiki
$wgDiscordNotificationNewUser = true;
// User or IP blocked in MediaWiki
$wgDiscordNotificationBlockedUser = true;
// User groups changed in MediaWiki
$wgDiscordNotificationUserGroupsChanged
// Article added to MediaWiki
$wgDiscordNotificationAddedArticle = true;
// Article removed from MediaWiki
$wgDiscordNotificationRemovedArticle = true;
// Article moved under new title in MediaWiki
$wgDiscordNotificationMovedArticle = true;
// Article edited in MediaWiki
$wgDiscordNotificationEditedArticle = true;
// File uploaded
$wgDiscordNotificationFileUpload = true;
// Article protection settings changed
$wgDiscordNotificationProtectedArticle = true;
// Action on Flow Boards (experimental)
$wgDiscordNotificationFlow = true;
// Article has been imported
$wgDiscordNotificationAfterImportPage = true;

Additional MediaWiki URL Settings

Should any of these default MediaWiki system page URLs differ in your installation, change them here.

$wgDiscordNotificationWikiUrlEndingUserRights          = "Special%3AUserRights&user=";
$wgDiscordNotificationWikiUrlEndingBlockUser           = "Special:Block/";
$wgDiscordNotificationWikiUrlEndingUserPage            = "User:";
$wgDiscordNotificationWikiUrlEndingUserTalkPage        = "User_talk:";
$wgDiscordNotificationWikiUrlEndingUserContributions   = "Special:Contributions/";
$wgDiscordNotificationWikiUrlEndingBlockList           = "Special:BlockList";
$wgDiscordNotificationWikiUrlEndingEditArticle         = "action=edit";
$wgDiscordNotificationWikiUrlEndingDeleteArticle       = "action=delete";
$wgDiscordNotificationWikiUrlEndingHistory             = "action=history";
$wgDiscordNotificationWikiUrlEndingDiff                = "diff=prev&oldid=";

Contributors

@innosflew @uzalu @DFelten @lens0021 @The-Voidwalker @GerbilSoft

License

MIT License

Issues / Ideas / Comments

Feel free to use the Issues section on Github for this project to submit any issues / ideas / comments! :)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].