Ooga-booga rewrite is coming along well

This commit is contained in:
Alex 2020-08-05 03:21:22 -05:00
parent 014fddea3c
commit db35107a63

View File

@ -5,10 +5,9 @@ const Discord = require('discord.js');
const config = require('./config.json') const config = require('./config.json')
// Create client // Create client
const client = new Discord.Client(); const client = new Discord.Client();
// Triggers when the bot is logged in and
client.on('ready', () => { client.on('ready', () => {
//logs when the bot comes online //logs when the bot comes online
console.info( console.info(
@ -52,24 +51,36 @@ client.on('message', async message => {
// Makes a message saying Who wants to play? // Makes a message saying Who wants to play?
message.channel.send("who wants to play a game?") message.channel.send("who wants to play a game?")
.then( message => { .then(message => {
// Reacts with a beach ball // Reacts with a beach ball
message.react("740294983982252203").then((reaction) => { message.react("739941658639990866")
const collector = new message.createReactionCollector( beachballfilter, { .then((reaction) => {
maxEmojis: 1, // Collects reactions on the previous message
max: 25, const beachballfilter = (reaction, user) => {
maxUsers: 25, return reaction.emoji.id === '739941658639990866' && user.id !== '223215601638703105'
time: 60000 }
}) const collector = message.createReactionCollector(beachballfilter, {
// Sets the maximums to 1 type of emoji, 25 reactions, 25 users, in 60 Seconds
max: 25,
maxUsers: 25,
time: 10000
})
// let players
let players // Triggers when someone joins the react
// Triggers when someone joins the react collector.on("end", (Collected) => {
collector.on("collect", (reaction) => { let players = Array.from(collector.users)
players = reaction.users.fetch({limit: 100})
})
})
console.log(players)
console.log(players.length)
message.channel.send(`<:BeachBall:739941658639990866> ${players[0]}`)
})
})
}) })
} }