SHARE
TWEET

Untitled

a guest Aug 23rd, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require('discord.js');
  2. const database = require('../database');
  3.  
  4. exports.run = (bot, message, args) => {
  5.     if(args[0] == 'canal') {
  6.         database.Guilds.findOne({
  7.           serverID: message.guild.id
  8.           }, function (gerro, guilda) {
  9.   if(guilda) {
  10.               let canal = message.mentions.channels.first() ? message.mentions.channels.first() : message.guild.channels.get(args[0]) ? message.guild.channels.get(args[0]) : message.guild.channels.find(channel => channel.name === args[0]) ? message.guild.channels.find(channel => channel.name === args[0]) : message.guild.channels.find(channel => channel.name === args[0]) ? message.guild.channels.find(channel => channel.name === args[0]) : false
  11.               if(!canal) return message.channel.send('sem canal')
  12.     guilda.welcome.set('canal', canal.id)
  13.     guilda.save()
  14.  
  15. message.channel.send('pronto')
  16.  } else {
  17.   message.channel.send('não tem database deste servidor')
  18. }
  19. })
  20.  
  21.     } else if(args[0] == 'msg') {
  22.         database.Guilds.findOne({
  23.           serverID: message.guild.id
  24.           }, function (gerro, guilda) {
  25.                 if(guilda) {
  26.         if(!args.join(' ')) return message.channel.send('args')
  27.     guilda.welcome.set('msg', args.join(' '))
  28.     guilda.save()
  29.     message.channel.send('pronto')
  30.          } else {
  31.   message.channel.send('não tem database deste servidor')
  32. }
  33. })
  34.  
  35.  
  36.     } else if(args[0] == 'ativar') {
  37.         database.Guilds.findOne({
  38.           serverID: message.guild.id
  39.           }, function (gerro, guilda) {
  40.                 if(guilda) {
  41.     guilda.welcome.set('on', true)
  42.     guilda.save()
  43.     message.channel.send('pronto')
  44.          } else {
  45.   message.channel.send('não tem database deste servidor')
  46.          }
  47. })
  48.     } else if(args[0] == 'desativar') {
  49.             database.Guilds.findOne({
  50.               serverID: message.guild.id
  51.           }, function (gerro, guilda) {
  52.                 if(guilda) {
  53.     guilda.welcome.set('on', false)
  54.     guilda.save()
  55.     message.channel.send('pronto')
  56.          } else {
  57.   message.channel.send('não tem database deste servidor')
  58.          }
  59. })
  60.     } else {
  61.       message.channel.send('Utilização: canal, mensagem, ativar, desativar')
  62.     }}
  63.  
  64.     exports.config = {
  65.         name: 'painel',
  66.         aliases: []
  67.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top