list counters
This commit is contained in:
parent
dbd29820a3
commit
d5e3ad8e99
|
@ -177,6 +177,11 @@ module.exports = {
|
||||||
.setAutocomplete(true)
|
.setAutocomplete(true)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
.addSubcommand(sub =>
|
||||||
|
sub
|
||||||
|
.setName('list')
|
||||||
|
.setDescription('[ADMIN] List every counter in this server')
|
||||||
|
)
|
||||||
.setDefaultMemberPermissions('0')
|
.setDefaultMemberPermissions('0')
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
|
@ -355,6 +360,11 @@ module.exports = {
|
||||||
await interaction.followUp({
|
await interaction.followUp({
|
||||||
content: `The ${counter.emoji} counter has been removed. 😭`
|
content: `The ${counter.emoji} counter has been removed. 😭`
|
||||||
});
|
});
|
||||||
|
} else if (subcommand === 'list') {
|
||||||
|
const counters = await db<Counter>('counters')
|
||||||
|
.where('guild', interaction.guildId!);
|
||||||
|
|
||||||
|
await interaction.followUp(counters.map(c => `${c.emoji} **${c.value}** <#${c.channel}>`).join('\n'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue