invite.js 766 B

12345678910111213141516171819202122232425
  1. const {defaultPermissions} = require('../util/default.json');
  2. /**
  3. * Processes the "invite" command.
  4. * @param {import('../util/i18n.js')} lang - The user language.
  5. * @param {import('discord.js').Message} msg - The Discord message.
  6. * @param {String[]} args - The command arguments.
  7. * @param {String} line - The command as plain text.
  8. * @param {String} wiki - The wiki for the message.
  9. */
  10. function cmd_invite(lang, msg, args, line, wiki) {
  11. if ( args.join('') ) {
  12. this.LINK(lang, msg, line, wiki);
  13. } else {
  14. msg.client.generateInvite(defaultPermissions).then( invite => msg.sendChannel( lang.get('invite.bot') + '\n<' + invite + '>' ), log_error );
  15. }
  16. }
  17. module.exports = {
  18. name: 'invite',
  19. everyone: true,
  20. pause: false,
  21. owner: false,
  22. run: cmd_invite
  23. };