Bladeren bron

fully release rcscript

Markus-Rost 4 jaren geleden
bovenliggende
commit
edf5bfbd03
5 gewijzigde bestanden met toevoegingen van 29 en 14 verwijderingen
  1. 26 6
      README.md
  2. 1 1
      cmds/help.js
  3. 0 5
      cmds/rcscript.js
  4. 1 1
      functions/special_page.js
  5. 1 1
      util/default.json

+ 26 - 6
README.md

@@ -1,20 +1,27 @@
 # Wiki-Bot
 # Wiki-Bot
-**Wiki-Bot** is a bot for [Discord](https://discord.com/) with the purpose to easily link to [Gamepedia](https://www.gamepedia.com/) and [Fandom](https://www.fandom.com/) wikis.
-<br>He resolves redirects and follows interwiki links.
-<br>**Wiki-Bot** has translations for English, German, French, Dutch, Polish, Portuguese, Russian, Turkish and Chinese.
+**Wiki-Bot** is a bot for [Discord](https://discord.com/) with the purpose to easily link and search [MediaWiki](https://www.mediawiki.org/wiki/MediaWiki) sites like [Gamepedia](https://www.gamepedia.com/) and [Fandom](https://www.fandom.com/) wikis. **Wiki-Bot** shows short descriptions and additional info about pages and is able to resolve redirects and follow interwiki links.
 
 
-**Wiki-Bot is not affiliated with Fandom and is an unofficial tool!**
+**Wiki-Bot** has translations for English, German, French, Dutch, Polish, Portuguese, Russian, Turkish and Chinese.
 
 
-[Use this link to invite **Wiki-Bot** to your Discord server.](https://discord.com/oauth2/authorize?client_id=461189216198590464&permissions=403033152&scope=bot)
+[Use this link to invite **Wiki-Bot** to your Discord server.](https://discord.com/oauth2/authorize?client_id=461189216198590464&permissions=939912256&scope=bot)
 
 
 Support server: [https://discord.gg/v77RTk5](https://discord.gg/v77RTk5)
 Support server: [https://discord.gg/v77RTk5](https://discord.gg/v77RTk5)
 
 
 #### Table of Contents
 #### Table of Contents
+* [Setup](#setup)
 * [Commands](#commands)
 * [Commands](#commands)
   * [Admin](#admin)
   * [Admin](#admin)
 * [User Verification](#user-verification)
 * [User Verification](#user-verification)
+* [Recent Changes Webhook](#recent-changes-webhook)
 * [Voice Channel](#voice-channel)
 * [Voice Channel](#voice-channel)
 
 
+## Setup
+After [inviting](https://discord.com/oauth2/authorize?client_id=461189216198590464&permissions=939912256&scope=bot) **Wiki-Bot** to your server you need to set the wiki you want to search by default. You do this with the `!wiki settings` command.
+* Change the wiki with `!wiki settings wiki <url>`
+  * Example: `!wiki settings wiki https://minecraft.gamepedia.com/Minecraft_Wiki`
+* Change the language with `!wiki settings lang <language>`
+  * Example: `!wiki settings lang German`
+
 ## Commands
 ## Commands
 For a full list with all commands use `!wiki help`
 For a full list with all commands use `!wiki help`
 
 
@@ -24,6 +31,7 @@ For a full list with all commands use `!wiki help`
 | `!wiki !<wiki> <search term>` | **Wiki-Bot** will answer with a link to a matching article in the named Gamepedia wiki: `https://<wiki>.gamepedia.com/` |
 | `!wiki !<wiki> <search term>` | **Wiki-Bot** will answer with a link to a matching article in the named Gamepedia wiki: `https://<wiki>.gamepedia.com/` |
 | `!wiki ?<wiki> <search term>` | **Wiki-Bot** will answer with a link to a matching article in the named Fandom wiki: `https://<wiki>.fandom.com/` |
 | `!wiki ?<wiki> <search term>` | **Wiki-Bot** will answer with a link to a matching article in the named Fandom wiki: `https://<wiki>.fandom.com/` |
 | `!wiki ??<wiki> <search term>` | **Wiki-Bot** will answer with a link to a matching article in the named Wikia wiki: `https://<wiki>.wikia.org/` |
 | `!wiki ??<wiki> <search term>` | **Wiki-Bot** will answer with a link to a matching article in the named Wikia wiki: `https://<wiki>.wikia.org/` |
+| `!wiki !!<wiki> <search term>` | **Wiki-Bot** will answer with a link to a matching article in the named MediaWiki project. Example: `!wiki !!en.wikipedia.org Cookie` |
 | `!wiki User:<username>` | **Wiki-Bot** will show some information about the user. |
 | `!wiki User:<username>` | **Wiki-Bot** will show some information about the user. |
 | `!wiki diff <diff> [<oldid>]` | **Wiki-Bot** will answer with a link to the diff in the wiki. |
 | `!wiki diff <diff> [<oldid>]` | **Wiki-Bot** will answer with a link to the diff in the wiki. |
 | `!wiki diff <page name>` | **Wiki-Bot** will answer with a link to the last diff on the article in the wiki. |
 | `!wiki diff <page name>` | **Wiki-Bot** will answer with a link to the last diff on the article in the wiki. |
@@ -57,6 +65,7 @@ For a full list with all administrator commands use `!wiki help admin`
 | `!wiki verification <id> usergroup <new user group>` | **Wiki-Bot** will change the user group for the wiki verification. Accepts a `\|` separated list.<br>• Provide `AND` as the first list entry to make all provided user groups required. |
 | `!wiki verification <id> usergroup <new user group>` | **Wiki-Bot** will change the user group for the wiki verification. Accepts a `\|` separated list.<br>• Provide `AND` as the first list entry to make all provided user groups required. |
 | `!wiki verification <id> accountage <new account age>` | **Wiki-Bot** will change the minimal account age (in days) for the wiki verification. |
 | `!wiki verification <id> accountage <new account age>` | **Wiki-Bot** will change the minimal account age (in days) for the wiki verification. |
 | `!wiki verification <id> rename` | **Wiki-Bot** will change if the users Discord nickname should be changed to their wiki username for the wiki verification. |
 | `!wiki verification <id> rename` | **Wiki-Bot** will change if the users Discord nickname should be changed to their wiki username for the wiki verification. |
+| `!wiki rcscript` | **Wiki-Bot** will change the recent changes webhook. |
 | `!wiki voice` | **Wiki-Bot** will try to give everyone in a voice channel a specific role. |
 | `!wiki voice` | **Wiki-Bot** will try to give everyone in a voice channel a specific role. |
 | `!wiki pause @Wiki-Bot` | **Wiki-Bot** will ignore all commands on this server, except a few admin commands. |
 | `!wiki pause @Wiki-Bot` | **Wiki-Bot** will ignore all commands on this server, except a few admin commands. |
 
 
@@ -73,13 +82,24 @@ Using the `!wiki verification` command, admins can add up to 10 verification ent
 
 
 See the [admin commands](#admin) or `!wiki help verification` on how to change the wiki verification entries on the server.
 See the [admin commands](#admin) or `!wiki help verification` on how to change the wiki verification entries on the server.
 
 
+## Recent Changes Webhook
+**Wiki-Bot** is able to run a recent changes webhook based on [RcGcDw](https://gitlab.com/piotrex43/RcGcDw) by using the `!wiki rcscript` command. The recent changes can be displayed in compact text messages with inline links or embed messages with edit tags and category changes.
+
+Requirements to add a recent changes webhook:
+* The wiki needs to run on [MediaWiki 1.30](https://www.mediawiki.org/wiki/MediaWiki_1.30) or higher.
+* The system message `MediaWiki:Custom-RcGcDw` need to be set to the Discord server id.
+
 ## Voice Channel
 ## Voice Channel
 **Wiki-Bot** is able to give everyone in a voice channel a specific role. This allows for the creation of channels only visible or writable when in a specific voice channel.
 **Wiki-Bot** is able to give everyone in a voice channel a specific role. This allows for the creation of channels only visible or writable when in a specific voice channel.
-<br>Use `!wiki voice` to get the format for the role name.
+
+Use `!wiki voice` to get the format for the role name.
 
 
 ## Bot Lists
 ## Bot Lists
 [![Wiki-Bot](https://botsfordiscord.com/api/bot/461189216198590464/widget)](https://botsfordiscord.com/bot/461189216198590464)
 [![Wiki-Bot](https://botsfordiscord.com/api/bot/461189216198590464/widget)](https://botsfordiscord.com/bot/461189216198590464)
 [![Wiki-Bot](https://discord.boats/api/widget/461189216198590464)](https://discord.boats/bot/461189216198590464)
 [![Wiki-Bot](https://discord.boats/api/widget/461189216198590464)](https://discord.boats/bot/461189216198590464)
 [![Wiki-Bot](https://top.gg/api/widget/461189216198590464.svg)](https://top.gg/bot/461189216198590464)
 [![Wiki-Bot](https://top.gg/api/widget/461189216198590464.svg)](https://top.gg/bot/461189216198590464)
 
 
+## Other
+Credits to [Encredechine](https://community.fandom.com/wiki/User:Encredechine) for the **Wiki-Bot** logo.
+
 [Privacy Policy](privacy.md)
 [Privacy Policy](privacy.md)

+ 1 - 1
cmds/help.js

@@ -66,7 +66,7 @@ const restrictions = {
 	minecraft: ['command', 'bug'],
 	minecraft: ['command', 'bug'],
 	admin: ['settings', 'verification', 'rcscript', 'voice', 'pause'],
 	admin: ['settings', 'verification', 'rcscript', 'voice', 'pause'],
 	inline: ['inline.link', 'inline.template'],
 	inline: ['inline.link', 'inline.template'],
-	patreon: ['settings.prefix', 'rcscript.default', 'rcscript.add', 'rcscript.wiki', 'rcscript.lang', 'rcscript.display', 'rcscript.feeds', 'rcscript.delete']
+	patreon: ['settings.prefix']
 }
 }
 
 
 /**
 /**

+ 0 - 5
cmds/rcscript.js

@@ -26,11 +26,6 @@ const display_types = [
  */
  */
 function cmd_rcscript(lang, msg, args, line, wiki) {
 function cmd_rcscript(lang, msg, args, line, wiki) {
 	if ( !msg.isAdmin() ) return msg.reactEmoji('❌');
 	if ( !msg.isAdmin() ) return msg.reactEmoji('❌');
-	// Patreon only during testing
-	if ( !( msg.guild.id in patreons ) ) {
-		return msg.replyMsg( lang.get('patreon') + '\n<' + process.env.patreon + '>', {}, true );
-	}
-	// Patreon only during testing
 	if ( !msg.channel.permissionsFor(msg.client.user).has('MANAGE_WEBHOOKS') ) {
 	if ( !msg.channel.permissionsFor(msg.client.user).has('MANAGE_WEBHOOKS') ) {
 		console.log( msg.guild.id + ': Missing permissions - MANAGE_WEBHOOKS' );
 		console.log( msg.guild.id + ': Missing permissions - MANAGE_WEBHOOKS' );
 		return msg.replyMsg( lang.get('missingperm') + ' `MANAGE_WEBHOOKS`' );
 		return msg.replyMsg( lang.get('missingperm') + ' `MANAGE_WEBHOOKS`' );

+ 1 - 1
functions/special_page.js

@@ -126,7 +126,7 @@ function special_page(lang, msg, title, specialpage, embed, wiki, reaction, spoi
 		overwrites[specialpage](this, lang, msg, wiki, reaction, spoiler, args, embed);
 		overwrites[specialpage](this, lang, msg, wiki, reaction, spoiler, args, embed);
 		return;
 		return;
 	}
 	}
-	if ( specialpage === 'recentchanges' && msg.isAdmin() && msg.guild.id in patreons ) {
+	if ( specialpage === 'recentchanges' && msg.isAdmin() ) {
 		embed.addField( lang.get('rcscript.title'), lang.get('rcscript.ad', ( patreons[msg?.guild?.id] || process.env.prefix ), '[RcGcDw](https://gitlab.com/piotrex43/RcGcDw)') );
 		embed.addField( lang.get('rcscript.title'), lang.get('rcscript.ad', ( patreons[msg?.guild?.id] || process.env.prefix ), '[RcGcDw](https://gitlab.com/piotrex43/RcGcDw)') );
 	}
 	}
 	got.get( wiki + 'api.php?action=query&meta=siteinfo|allmessages&siprop=general&amenableparser=true&amtitle=' + encodeURIComponent( title ) + '&ammessages=' + ( specialpage in descriptions ? descriptions[specialpage] : encodeURIComponent( specialpage ) + '-summary' ) + ( specialpage in querypages ? querypages[specialpage][0] : '' ) + '&format=json', {
 	got.get( wiki + 'api.php?action=query&meta=siteinfo|allmessages&siprop=general&amenableparser=true&amtitle=' + encodeURIComponent( title ) + '&ammessages=' + ( specialpage in descriptions ? descriptions[specialpage] : encodeURIComponent( specialpage ) + '-summary' ) + ( specialpage in querypages ? querypages[specialpage][0] : '' ) + '&format=json', {

+ 1 - 1
util/default.json

@@ -18,7 +18,7 @@
 		},
 		},
 		"rcgcdw": {
 		"rcgcdw": {
 			"default": 1,
 			"default": 1,
-			"patreon": 1,
+			"patreon": 3,
 			"display": 2
 			"display": 2
 		}
 		}
 	},
 	},