Browse Source

add settings slash command layout

Markus-Rost 4 years ago
parent
commit
ac523827c1
4 changed files with 284 additions and 3 deletions
  1. 1 1
      bot.js
  2. 1 1
      cmds/rcscript.js
  3. 1 1
      cmds/settings.js
  4. 281 0
      interactions/commands.json

+ 1 - 1
bot.js

@@ -219,7 +219,7 @@ fs.readdir( './interactions', (error, files) => {
 client.ws.on( 'INTERACTION_CREATE', interaction => {
 	if ( interaction.version !== 1 || interaction.type !== 2 ) return;
 	if ( !slash.hasOwnProperty(interaction.data.name) ) {
-		console.log( '- Slash: Unknown command: ' + interaction.data.name );
+		console.log( '- Slash: Unknown command: ' + ( isDebug ? JSON.stringify(interaction, null, '\t') : interaction.data.name ) );
 		return client.api.interactions(interaction.id, interaction.token).callback.post( {
 			data: {
 				type: 4,

+ 1 - 1
cmds/rcscript.js

@@ -320,7 +320,7 @@ function cmd_rcscript(lang, msg, args, line, wiki) {
 					return msg.replyMsg( lang.get('settings.wikiinvalid') + wikihelp, {}, true );
 				} ) );
 			}
-			if ( args[0] === 'lang' ) {
+			if ( args[0] === 'lang' || args[0] === 'language' ) {
 				if ( !args[1] ) {
 					return msg.replyMsg( lang.get('rcscript.current_lang') + ' `' + allLangs.names[selected_row.lang] + '`\n`' + cmd + ' lang ' + lang.get('rcscript.new_lang') + '`\n' + lang.get('rcscript.help_lang') + ' `' + Object.values(allLangs.names).join('`, `') + '`', {files:( msg.uploadFiles() ? [`./RcGcDb/locale/widgets/${selected_row.lang}.png`] : [] )}, true );
 				}

+ 1 - 1
cmds/settings.js

@@ -197,7 +197,7 @@ function cmd_settings(lang, msg, args, line, wiki) {
 			} );
 		}
 		
-		if ( args[0] === 'lang' ) {
+		if ( args[0] === 'lang' || args[0] === 'language' ) {
 			if ( channel && !patreons[msg.guild.id] ) return msg.replyMsg( lang.get('general.patreon') + '\n<' + process.env.patreon + '>', {}, true );
 			prelang += 'lang';
 			var langhelp = '\n' + lang.get('settings.langhelp', prefix + 'settings ' + prelang) + ' `' + Object.values(allLangs.names).join('`, `') + '`';

+ 281 - 0
interactions/commands.json

@@ -28,5 +28,286 @@
 				"required": true
 			}
 		]
+	},
+	{
+		"id": "",
+		"application_id": "",
+		"name": "settings",
+		"description": "Change the settings for the server.",
+		"default_permission": false,
+		"options": [
+			{
+				"type": 7,
+				"name": "channel",
+				"description": "The channel to change the settings for.",
+				"required": false
+			},
+			{
+				"type": 3,
+				"name": "wiki",
+				"description": "The default wiki for the server or channel.",
+				"required": false
+			},
+			{
+				"type": 3,
+				"name": "lang",
+				"description": "The language for the server or, Patreon only, channel.",
+				"required": false,
+				"choices": [
+					{
+						"name": "English (en)",
+						"value": "en"
+					},
+					{
+						"name": "বাংলা (bn)",
+						"value": "bn"
+					},
+					{
+						"name": "Deutsch (de)",
+						"value": "de"
+					},
+					{
+						"name": "Español (es)",
+						"value": "es"
+					},
+					{
+						"name": "Français (fr)",
+						"value": "fr"
+					},
+					{
+						"name": "हिन्दी (hi)",
+						"value": "hi"
+					},
+					{
+						"name": "한국어 (ko)",
+						"value": "ko"
+					},
+					{
+						"name": "Polski (pl)",
+						"value": "pl"
+					},
+					{
+						"name": "Português do Brasil (pt-br)",
+						"value": "pt-br"
+					},
+					{
+						"name": "Русский (ru)",
+						"value": "ru"
+					},
+					{
+						"name": "Türkçe (tr)",
+						"value": "tr"
+					},
+					{
+						"name": "简体中文 (zh-hans)",
+						"value": "zh-hans"
+					},
+					{
+						"name": "繁體中文 (zh-hant)",
+						"value": "zh-hant"
+					}
+				]
+			},
+			{
+				"type": 8,
+				"name": "role",
+				"description": "The minimal required role for the server or, Patreon only, channel.",
+				"required": false
+			},
+			{
+				"type": 5,
+				"name": "inline",
+				"description": "Should inline commands be enabled for the server or, Patreon only, channel?",
+				"required": false
+			},
+			{
+				"type": 3,
+				"name": "prefix",
+				"description": "Patreon only: The bot command prefix for the server.",
+				"required": false
+			}
+		]
+	},
+	{
+		"id": "",
+		"application_id": "",
+		"name": "verification",
+		"description": "Change the verifications for the server.",
+		"default_permission": false,
+		"options": [
+			{
+				"type": 4,
+				"name": "id",
+				"description": "The ID of the verification. Set to 0 to add a new verification.",
+				"required": false
+			},
+			{
+				"type": 7,
+				"name": "channel",
+				"description": "The channel for the verification.",
+				"required": false
+			},
+			{
+				"type": 8,
+				"name": "role",
+				"description": "The role for the verification.",
+				"required": false
+			},
+			{
+				"type": 4,
+				"name": "editcount",
+				"description": "The edit count for the verification.",
+				"required": false
+			},
+			{
+				"type": 4,
+				"name": "accountage",
+				"description": "The wiki account age in days for the verification.",
+				"required": false
+			},
+			{
+				"type": 5,
+				"name": "rename",
+				"description": "Should the Discord user be renamed to their wiki username for the verification.",
+				"required": false
+			},
+			{
+				"type": 3,
+				"name": "usergroup",
+				"description": "The usergroup for the verification. Add multiple usergroups comma separated.",
+				"required": false
+			},
+			{
+				"type": 5,
+				"name": "and",
+				"description": "Should all provided usergroups be required for the verification, instead of just one of them?",
+				"required": false
+			},
+			{
+				"type": 4,
+				"name": "postcount",
+				"description": "The Fandom feeds post count for the verification.",
+				"required": false
+			},
+			{
+				"type": 3,
+				"name": "posteditcount",
+				"description": "How the Fandom feeds post count should relate to the edit count requirement for the verification.",
+				"required": false,
+				"choices": [
+					{
+						"name": "Require both edit and post count.",
+						"value": "and"
+					},
+					{
+						"name": "Require either edit or post count.",
+						"value": "or"
+					},
+					{
+						"name": "Require combined edit and post count.",
+						"value": "both"
+					}
+				]
+			}
+		]
+	},
+	{
+		"id": "",
+		"application_id": "",
+		"name": "rcscript",
+		"description": "Change the recent changes webhooks for the server.",
+		"default_permission": false,
+		"options": [
+			{
+				"type": 4,
+				"name": "id",
+				"description": "The ID of the recent changes webhook. Set to 0 to add a new recent changes webhook.",
+				"required": false
+			},
+			{
+				"type": 3,
+				"name": "wiki",
+				"description": "The wiki for the recent changes webhook.",
+				"required": false
+			},
+			{
+				"type": 3,
+				"name": "lang",
+				"description": "The language for the recent changes webhook.",
+				"required": false,
+				"choices": [
+					{
+						"name": "English (en)",
+						"value": "en"
+					},
+					{
+						"name": "Deutsch (de)",
+						"value": "de"
+					},
+					{
+						"name": "हिन्दी (hi)",
+						"value": "hi"
+					},
+					{
+						"name": "Polski (pl)",
+						"value": "pl"
+					},
+					{
+						"name": "Português do Brasil (pt-br)",
+						"value": "pt-br"
+					},
+					{
+						"name": "Русский (ru)",
+						"value": "ru"
+					},
+					{
+						"name": "简体中文 (zh-hans)",
+						"value": "zh-hans"
+					}
+				]
+			},
+			{
+				"type": 4,
+				"name": "display",
+				"description": "The display mode for the recent changes webhook.",
+				"required": false,
+				"choices": [
+					{
+						"name": "Compact text messages with inline links.",
+						"value": 0
+					},
+					{
+						"name": "Embed messages with edit tags and category changes.",
+						"value": 1
+					},
+					{
+						"name": "Embed messages with image previews.",
+						"value": 2
+					},
+					{
+						"name": "Patreon only: Embed messages with image previews and edit differences.",
+						"value": 3
+					}
+				]
+			},
+			{
+				"type": 7,
+				"name": "channel",
+				"description": "The channel for the recent changes webhook.",
+				"required": false
+			},
+			{
+				"type": 5,
+				"name": "feeds",
+				"description": "Should Fandom feeds posts be send to the recent changes webhook?",
+				"required": false
+			},
+			{
+				"type": 5,
+				"name": "feedsonly",
+				"description": "Should only Fandom feeds enabled for the recent changes webhook? (MediaWiki changes disabled)",
+				"required": false
+			}
+		]
 	}
 ]