From d5e3ad8e99143629f0ebe1121185e9c2c7404a85 Mon Sep 17 00:00:00 2001 From: "Jill \"oatmealine\" Monoids" Date: Mon, 13 Nov 2023 19:32:37 +0300 Subject: [PATCH] list counters --- src/commands/counter.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/commands/counter.ts b/src/commands/counter.ts index d4d2f9f..3622bb7 100644 --- a/src/commands/counter.ts +++ b/src/commands/counter.ts @@ -177,6 +177,11 @@ module.exports = { .setAutocomplete(true) ) ) + .addSubcommand(sub => + sub + .setName('list') + .setDescription('[ADMIN] List every counter in this server') + ) .setDefaultMemberPermissions('0') .setDMPermission(false), @@ -355,6 +360,11 @@ module.exports = { await interaction.followUp({ content: `The ${counter.emoji} counter has been removed. 😭` }); + } else if (subcommand === 'list') { + const counters = await db('counters') + .where('guild', interaction.guildId!); + + await interaction.followUp(counters.map(c => `${c.emoji} **${c.value}** <#${c.channel}>`).join('\n')); } } },