light counter consistency stuff
This commit is contained in:
parent
a0c9b12da0
commit
233a663d0c
|
@ -144,7 +144,7 @@ module.exports = {
|
|||
.addStringOption(option =>
|
||||
option
|
||||
.setName('key')
|
||||
.setDescription('The codename. Best to leave descriptive for later; used in searching for counters')
|
||||
.setDescription('Give your counter a simple name')
|
||||
.setRequired(true)
|
||||
)
|
||||
.addStringOption(option =>
|
||||
|
@ -399,13 +399,13 @@ module.exports = {
|
|||
.delete();
|
||||
|
||||
await interaction.followUp({
|
||||
content: `The ${counter.emoji} counter has been removed. 😭`
|
||||
content: `The ${counter.emoji} ${counter.key} 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'));
|
||||
await interaction.followUp(counters.map(c => `${c.emoji} ${c.key}: **${c.value}** <#${c.channel}>`).join('\n'));
|
||||
} else if (subcommand === 'help') {
|
||||
await interaction.followUp(help.get(interaction.options.getString('topic', true))!);
|
||||
} else if (subcommand === 'link') {
|
||||
|
@ -421,12 +421,14 @@ module.exports = {
|
|||
|
||||
const item = await getItem(itemID);
|
||||
if (!item) return interaction.followUp('No such item exists!');
|
||||
if (item.untradable) return interaction.followUp('This item is untradable!');
|
||||
|
||||
await db<Counter>('counters')
|
||||
.where('id', counter.id)
|
||||
.update({
|
||||
'linkedItem': item.id,
|
||||
'emoji': item.emoji,
|
||||
'key': item.name,
|
||||
'value': 0
|
||||
});
|
||||
|
||||
|
|
|
@ -375,7 +375,7 @@ function counterAutocompleteBuilder(linked: boolean) {
|
|||
const foundCounters = await query;
|
||||
|
||||
await interaction.respond(
|
||||
foundCounters.map(choice => ({ name: choice.emoji, value: choice.key }))
|
||||
foundCounters.map(choice => ({ name: `${choice.emoji} ${choice.key}`, value: choice.key }))
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue