Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async setGame(content) {
- if ((Date.now() - this.setGameTime) <= 240000 || !content.force) return;
- if (!content.random) {
- if (!content.url) return this.user.setPresence({ game: { name: content.txt, type: content.type } });
- this.user.setPresence({ game: { name: content.txt, type: content.type, url: content.url } });
- return;
- };
- 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'],
- streaming = [`Cody - ${await this.usersAlt.size()} usuários em ${await this.guildsAlt.size()} servidores com ${await this.channelsAlt.size()} canais.`],
- listening = ['Spotify.', `${await this.usersAlt.size()} usuários fazerem suas coisas.`],
- watching = ['animes.', 'Netflix.'],
- randomGames = [{
- content: playing[Math.round(Math.random() * (playing.length - 1))],
- type: 0,
- url: 'https://www.twitch.tv/zmarciogod'
- }, {
- content: streaming[Math.round(Math.random() * (streaming.length - 1))],
- type: 1,
- url: false
- }, {
- content: listening[Math.round(Math.random() * (listening.length - 1))],
- type: 2,
- url: false
- }, {
- content: watching[Math.round(Math.random() * (watching.length - 1))],
- type: 3,
- url: false
- }]
- if (!this.user.presence.game && !randomGames.find(game => game.content === this.user.presence.game.name)) return;
- for (let i = 0; i < randomGames.length - 1; i++) {
- if (randomGames[i].content !== this.user.presence.game.name) return;
- randomGames.splice(i, 1);
- };
- const random = randomGames[Math.round(Math.random() * (randomGames.length - 1))];
- if (!random.url) return this.user.setPresence({ game: { name: random.content, type: random.type } });
- this.user.setPresence({ game: { name: random.content, type: random.type, url: random.url } });
- this.setGameTime = Date.now();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement