2.6 KiB
2.6 KiB
Discord (mw-discord)
MediaWiki extension for sending notifications to a Discord webhook from MediaWiki. When a certain event occurs on your MediaWiki wiki, including new edits, they can be sent as a message to a channel on a Discord server using a webhook.
Multiple webhook URLs are supported and messages will be sent to all of them using cURL, so your web server is required to have cURL installed (for most Linux distros, installing using sudo apt install curl should work).
Live demo: https://runescape.wiki (https://discord.gg/runescapewiki)
Requirements
- Discord webhook URL: This can be obtained by editing a channel on a server with the correct permissions.
- MediaWiki 1.31+
- cURL
Configuration
$wgDiscordWebhookURL- A string or array containing webhook URLs
Optional
$wgDiscordNoBots- Do not send notifications that are triggered by a bot account - default:true$wgDiscordNoMinor- Do not send notifications that are for minor edits - default:false$wgDiscordNoNull- Do not send notifications for null edits - default:true$wgDiscordSuppressPreviews- Force previews for links in Discord messages to be suppressed - default:true$wgDiscordDisabledHooks- Array containing list of hooks to disable sending webhooks for (see below) - default:[]$wgDiscordDisabledNS- Array containing list of namespaces indexes (ints) to disable sending webhooks for - default:[]
Hooks used
PageContentSaveComplete- New edits to pages and page creationsArticleDeleteComplete- Page deletionsArticleUndelete- Page restorationsArticleRevisionVisibilitySet- Revision visibility changesArticleProtectComplete- Page protectionsTitleMoveComplete- Page movesLocalUserCreated- User registrationsBlockIpComplete- User blockedUnblockUserComplete- User unblockedUserGroupsChanged- User rights changedUploadComplete- File was uploadedFileDeleteComplete- File revision was deletedFileUndeleteComplete- File revision was restored
License
This extension is licensed under the MIT License, see here for more information. This project is originally inspired by Szmyk's mediawiki-discord project, but has been rewritten completely to be more suitable for my needs.
