Filtering works
This commit is contained in:
parent
dcc5cad7b3
commit
f2d6eaea16
@ -78,7 +78,7 @@ client.on('message', async message => {
|
|||||||
message.channel.send(`<:BeachBall:739941658639990866> ${(players[0].toString()).slice(19)}`).then(message => {
|
message.channel.send(`<:BeachBall:739941658639990866> ${(players[0].toString()).slice(19)}`).then(message => {
|
||||||
message.react(config.emoteID).then(() => {
|
message.react(config.emoteID).then(() => {
|
||||||
const roundone = (reaction, user) => {
|
const roundone = (reaction, user) => {
|
||||||
return reaction.emoji.name === config.emoteID && user.id !== '223215601638703105' //&& reaction.user === players[0]
|
return reaction.emoji.name === config.emoteID && user.id !== '223215601638703105' && user.id === (players[0].toString()).substr(0,18)
|
||||||
}
|
}
|
||||||
const collector = message.createReactionCollector(roundone, {
|
const collector = message.createReactionCollector(roundone, {
|
||||||
// Sets the maximums to 1 type of emoji, 25 reactions, 25 users, in 60 Seconds
|
// Sets the maximums to 1 type of emoji, 25 reactions, 25 users, in 60 Seconds
|
||||||
@ -100,7 +100,7 @@ client.on('message', async message => {
|
|||||||
|
|
||||||
// Makes a filter that allows the hand emoji and only form the player that was randomly picked
|
// Makes a filter that allows the hand emoji and only form the player that was randomly picked
|
||||||
const handfilter = (reaction, user) => {
|
const handfilter = (reaction, user) => {
|
||||||
return reaction.emoji.name === config.emoteID && user.id !== '223215601638703105' //&& reaction.user === players[num]
|
return reaction.emoji.name === config.emoteID && user.id !== '223215601638703105' && user.id === (players[num].toString()).substr(0,18)
|
||||||
}
|
}
|
||||||
const collector = message.createReactionCollector(handfilter, {
|
const collector = message.createReactionCollector(handfilter, {
|
||||||
// Sets the maximums to 1 type of emoji, 25 reactions, 25 users, in 60 Seconds
|
// Sets the maximums to 1 type of emoji, 25 reactions, 25 users, in 60 Seconds
|
||||||
@ -124,7 +124,6 @@ client.on('message', async message => {
|
|||||||
}
|
}
|
||||||
ball()
|
ball()
|
||||||
})
|
})
|
||||||
|
|
||||||
collector.on("end", () => {
|
collector.on("end", () => {
|
||||||
message.channel.send("Ouch!")
|
message.channel.send("Ouch!")
|
||||||
console.log(Array.from(collector.users))
|
console.log(Array.from(collector.users))
|
||||||
|
Loading…
Reference in New Issue
Block a user