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.
Live demo: https://runescape.wiki (https://discord.gg/runescapewiki)
- Discord webhook URL: Found by editing a channel -> Integrations -> Webhooks
- MediaWiki: This extension aims to always support the latest LTS release.
- Use the branch that is equal to, or below your current version.
- We do not support versions of MediaWiki that are considered end-of-life.
- The
masterbranch may contain changes that are only applicable to the current alpha version of MediaWiki.
- cURL (likely installed already). Without this, the extension may still work, but requests will be sent inefficiently.
- Clone this repository to your MediaWiki installation's
extensionsfolder usinggit clone https://github.com/jaydenkieran/mw-discord.git -b REL1_35 Discord - Modify your
LocalSettings.phpfile and add:
// Load the extension
wfLoadExtension( 'Discord' );
// Set the webhook URL(s) (string or array)
$wgDiscordWebhookURL = [ '' ];For further configuration variables, see below.
To get a webhook URL for use with this extension, open the Discord client and go to a server where you have the Manage Webhooks permission. Click the cog icon when hovering over a text channel, switch to the Webhooks tab on the left of the interface, and click 'Create webhook'. The webhook URL can then be copied from that interface.
This extension can be configured using the LocalSettings.php file in your MediaWiki installation.
| Variable | Type | Description |
|---|---|---|
$wgDiscordWebhookURL |
string/array | Discord webhook URLs |
These parameters aren't required for the extension to work.
| Variable | Type | Description | Default |
|---|---|---|---|
$wgDiscordNoBots |
bool | Do not send notifications that are triggered by a bot account | true |
$wgDiscordNoMinor |
bool | Do not send notifications that are for minor edits | false |
$wgDiscordNoNull |
bool | Do not send notifications for null edits | true |
$wgDiscordSuppressPreviews |
bool | Force previews for links in Discord messages to be suppressed | true |
$wgDiscordMaxChars |
int | Maximum amount of characters for user-generated text (e.g summaries, reasons). Set to null to disable truncation |
null |
$wgDiscordMaxCharsUsernames |
int | Maximum amount of characters for usernames. Set to null to disable truncation |
25 |
$wgDiscordDisabledHooks |
string array | List of hooks to disable sending webhooks for (see below) | [] |
$wgDiscordDisabledNS |
int array | List of namespace IDs to disable sending webhooks for. (see below) | [] |
$wgDiscordDisabledUsers |
string array | List of users whose performed actions shouldn't send webhooks | [] |
$wgDiscordPrependTimestamp |
bool | Prepend a timestamp (in UTC) to all sent messages. The format can be changed by editing the MediaWiki message discord-timestampformat |
false |
$wgDiscordUseEmojis |
bool | Prepend emojis to different types of messages to help distinguish them | false |
$wgDiscordEmojis |
string associative array | Map of hook names and their associated emojis to prepend to messages if $wgDiscordUseEmojis is enabled |
See extension.json |
PageSaveComplete- New edits to pages and page creationsPageDeleteComplete- Page deletionsPageUndeleteComplete- Page restorationsArticleRevisionVisibilitySet- Revision visibility changesArticleProtectComplete- Page protectionsPageMoveComplete- Page movesLocalUserCreated- User registrationsBlockIpComplete- User blockedUnblockUserComplete- User unblockedUserGroupsChanged- User rights changedUploadComplete- File was uploadedFileDeleteComplete- File revision was deletedFileUndeleteComplete- File revision was restoredAfterImportPage- Page was importedArticleMergeComplete- Article histories were mergedRenameUserComplete- Rename was completed
ApprovedRevsRevisionApproved- Revision was approvedApprovedRevsRevisionUnapproved- Revision was unapprovedApprovedRevsFileRevisionApproved- File revision was approvedApprovedRevsFileRevisionUnapproved- File revision was unapproved
As we use namespace IDs the following resources might be helpful:
You can submit translations for this extension on Translatewiki.net.
This extension is available under the MIT license. You can see here for more information.
This extension was inspired by Szmyk's mediawiki-discord project.
