mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-22 10:19:11 +02:00
Add send list option to anagrams
This commit is contained in:
@@ -46,10 +46,16 @@ module.exports = class AnagramicaCommand extends Command {
|
|||||||
await msg.reply(stripIndents`
|
await msg.reply(stripIndents`
|
||||||
**You have ${time} seconds to provide anagrams for the following letters:**
|
**You have ${time} seconds to provide anagrams for the following letters:**
|
||||||
${letters.map(letter => `\`${letter.toUpperCase()}\``).join(' ')}
|
${letters.map(letter => `\`${letter.toUpperCase()}\``).join(' ')}
|
||||||
|
|
||||||
|
_Need to see the list again? Type \`send list\`._
|
||||||
`);
|
`);
|
||||||
const picked = [];
|
const picked = [];
|
||||||
const filter = res => {
|
const filter = res => {
|
||||||
if (res.author.id !== msg.author.id) return false;
|
if (res.author.id !== msg.author.id) return false;
|
||||||
|
if (res.content.toLowerCase() === 'send list') {
|
||||||
|
msg.reply(letters.map(letter => `\`${letter.toUpperCase()}\``).join(' ')).catch(() => null);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (picked.includes(res.content.toLowerCase())) return false;
|
if (picked.includes(res.content.toLowerCase())) return false;
|
||||||
const score = this.getScore(letters, res.content.toLowerCase());
|
const score = this.getScore(letters, res.content.toLowerCase());
|
||||||
if (!score) return false;
|
if (!score) return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user