1
0

command.js 1.2 KB

123456789101112131415161718192021222324252627
  1. /**
  2. * Processes Minecraft commands.
  3. * @param {import('../../util/i18n.js')} lang - The user language.
  4. * @param {import('discord.js').Message} msg - The Discord message.
  5. * @param {String[]} args - The command arguments.
  6. * @param {String} title - The page title.
  7. * @param {String} cmd - The command at this point.
  8. * @param {String} querystring - The querystring for the link.
  9. * @param {String} fragment - The section for the link.
  10. * @param {import('discord.js').MessageReaction} reaction - The reaction on the message.
  11. * @param {String} spoiler - If the response is in a spoiler.
  12. */
  13. function minecraft_command(lang, msg, args, title, cmd, querystring, fragment, reaction, spoiler) {
  14. if ( args.join('') ) {
  15. if ( args[0].startsWith( '/' ) ) this.SYNTAX(lang, msg, args[0].substring(1), args.slice(1), title, cmd, querystring, fragment, reaction, spoiler);
  16. else this.SYNTAX(lang, msg, args[0], args.slice(1), title, cmd, querystring, fragment, reaction, spoiler);
  17. }
  18. else {
  19. msg.notMinecraft = true;
  20. this.WIKI.gamepedia(lang, msg, title, lang.get('minecraft.link'), cmd, reaction, spoiler, querystring, fragment);
  21. }
  22. }
  23. module.exports = {
  24. name: 'command',
  25. run: minecraft_command
  26. };