Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Apr 6th, 2020 201 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Event = require("../../structures/Event.js");
  2. const ClientEmbed = require("../../structures/ClientEmbed.js");
  3. const Emojis = require("../../utils/Emojis.js");
  4. const Emojis = require("../../utils/Emojis.js")
  5. const moment = require("moment");
  6. require("moment-duration-format");
  7.  
  8. function traduzir(_números) {
  9.     _números = _números.toString();
  10.     var texto = ``,
  11.         números = {
  12.             1: `${Emojis.One}`,
  13.             2: `${Emojis.Two}`,
  14.             3: `${Emojis.Three}`,
  15.             4: `${Emojis.Four}`,
  16.             5: `${Emojis.Five}`,
  17.             6: `${Emojis.Six}`,
  18.             7: `${Emojis.Seven}`,
  19.             8: `${Emojis.Eight}`,
  20.             9: `${Emojis.Nine}`,
  21.             0: `${Emojis.Zero}`
  22.         };
  23.     for (let i = 0; i < _números.length; i++)
  24.         texto += '' + números[parseInt(_números[i])] + '';
  25.     return texto;
  26. }
  27.  
  28. module.exports = class MessageEvent extends Event {
  29.     constructor(client) {
  30.         super(client)
  31.         this.client = client
  32.         this.name = 'guildMemberRemove'
  33.     }
  34.  
  35.     async ON(member) {
  36.  
  37.         try {
  38.             const guild = member.guild;
  39.             const guildDatabase = await this.client.database.guilds.findOne(guild.id);
  40.  
  41.             if (guildDatabase.byebye) {
  42.                 const channel = guild.channels.get(guildDatabase.byebyechannel)
  43.                 if (channel && !!guildDatabase.byebyemsg) {
  44.                     channel.send(guildDatabase.byebyemsg.replace(/{member}/g, `<@${member.id}>`).replace(/{guild}/g, `${member.guild.name}`).replace(/{name}/g, `${member.user.username}`).replace(/{users}/g, `${member.guild.members.size}`));
  45.                 }
  46.             }
  47.             if (guildDatabase.contador) {
  48.                 const channel = guild.channels.get(guildDatabase.chatcontador)
  49.                 if (channel && !!guildDatabase.welcomemsg) {
  50.                     channel.setTopic(guildDatabase.msgcontador.replace(/{contador}/g, `${traduzir(guild.memberCount)}`));
  51.                 }
  52.             }
  53.  
  54.             if (guildDatabase.serverstats) {
  55.                 console.log('test');
  56.  
  57.                 const total = guild.channels.get(guildDatabase.statuscanais.total)
  58.                 const users = guild.channels.get(guildDatabase.statuscanais.users)
  59.                 const bots = guild.channels.get(guildDatabase.statuscanais.bots)
  60.  
  61.                 if (total) {
  62.                     total.setName(`Total de Usuários: ${guild.members.size}`)
  63.                 }
  64.                 if (users) {
  65.                     users.setName(`Membros: ${guild.members.filter(a => !a.user.bot).size}`)
  66.                 }
  67.                 if (bots) {
  68.                     bots.setName(`Bots: ${guild.members.filter(a => a.user.bot).size}`)
  69.                 }
  70.             }
  71.  
  72.             this.client.channels.get('688371003445084267').setName(`👤Usuários: ${this.client.users.size}`)
  73.             this.client.channels.get('688371124022804525').setName(`🌀Latência: ${Math.round(this.client.ping)}ms`)
  74.             this.client.channels.get('695804872876097627').setName(`⌛UpTime: ${moment.duration(process.uptime() * 1000).format("d[d] h[h] m[m] s[s]")}`)
  75.  
  76.         } catch (err) {
  77.  
  78.             console.log(`Erro no meu evento de GuildMemberRemove - Erro:\n${err}`)
  79.         }
  80.     }
  81.  
  82. }
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