mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-11 11:21:16 +02:00
Remove mafia (Storyteller exists now)
This commit is contained in:
@@ -75,32 +75,6 @@ module.exports = class Util {
|
||||
return today;
|
||||
}
|
||||
|
||||
static async awaitPlayers(msg, max, min, { time = 30000, dmCheck = false } = {}) {
|
||||
const joined = [];
|
||||
joined.push(msg.author.id);
|
||||
const filter = res => {
|
||||
if (res.author.bot) return false;
|
||||
if (joined.includes(res.author.id)) return false;
|
||||
if (res.content.toLowerCase() !== 'join game') return false;
|
||||
joined.push(res.author.id);
|
||||
res.react(SUCCESS_EMOJI_ID || '✅').catch(() => null);
|
||||
return true;
|
||||
};
|
||||
const verify = await msg.channel.awaitMessages(filter, { max, time });
|
||||
verify.set(msg.id, msg);
|
||||
if (dmCheck) {
|
||||
for (const message of verify.values()) {
|
||||
try {
|
||||
await message.author.send('Hi! Just testing that DMs work, pay this no mind.');
|
||||
} catch (err) {
|
||||
verify.delete(message.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (verify.size < min) return false;
|
||||
return verify.map(message => message.author);
|
||||
}
|
||||
|
||||
static async verify(channel, user, time = 30000) {
|
||||
const filter = res => {
|
||||
const value = res.content.toLowerCase();
|
||||
|
||||
Reference in New Issue
Block a user