Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
600
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     async setGame(content) {
  2.         if ((Date.now() - this.setGameTime) <= 240000 || !content.force) return;
  3.         if (!content.random) {
  4.             if (!content.url) return this.user.setPresence({ game: { name: content.txt, type: content.type } });
  5.             this.user.setPresence({ game: { name: content.txt, type: content.type, url: content.url } });
  6.             return;
  7.         };
  8.         const playing = ['Minecraft', 'GTA V', 'Dead Cells', 'https://discord.gg/5Xt3uHF', 'Vote em mim e adquira vários benefícios: https://botsparadiscord.xyz/bots/507292506942210048/votar'],
  9.             streaming = [`Cody - ${await this.usersAlt.size()} usuários em ${await this.guildsAlt.size()} servidores com ${await this.channelsAlt.size()} canais.`],
  10.             listening = ['Spotify.', `${await this.usersAlt.size()} usuários fazerem suas coisas.`],
  11.             watching = ['animes.', 'Netflix.'],
  12.             randomGames = [{
  13.                 content: playing[Math.round(Math.random() * (playing.length - 1))],
  14.                 type: 0,
  15.                 url: 'https://www.twitch.tv/zmarciogod'
  16.             }, {
  17.                 content: streaming[Math.round(Math.random() * (streaming.length - 1))],
  18.                 type: 1,
  19.                 url: false
  20.             }, {
  21.                 content: listening[Math.round(Math.random() * (listening.length - 1))],
  22.                 type: 2,
  23.                 url: false
  24.             }, {
  25.                 content: watching[Math.round(Math.random() * (watching.length - 1))],
  26.                 type: 3,
  27.                 url: false
  28.             }]
  29.         if (!this.user.presence.game && !randomGames.find(game => game.content === this.user.presence.game.name)) return;
  30.         for (let i = 0; i < randomGames.length - 1; i++) {
  31.             if (randomGames[i].content !== this.user.presence.game.name) return;
  32.             randomGames.splice(i, 1);
  33.         };
  34.         const random = randomGames[Math.round(Math.random() * (randomGames.length - 1))];
  35.         if (!random.url) return this.user.setPresence({ game: { name: random.content, type: random.type } });
  36.         this.user.setPresence({ game: { name: random.content, type: random.type, url: random.url } });
  37.         this.setGameTime = Date.now();
  38.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement