commands/ask: enforce userLimit
This commit is contained in:
parent
6f5f425166
commit
c4edf55f65
1 changed files with 17 additions and 1 deletions
|
@ -57,6 +57,22 @@ export default class Ask extends Command implements Command {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const userLimit = await config.quota.checkUser(interaction.user, interaction);
|
||||||
|
|
||||||
|
if (userLimit.used >= userLimit.quota) {
|
||||||
|
interaction.reply({
|
||||||
|
|
||||||
|
embeds: [{
|
||||||
|
color: 0xff0000,
|
||||||
|
description: "You've used up your quota,\n" + userLimit.toString(),
|
||||||
|
}],
|
||||||
|
ephemeral: true,
|
||||||
|
}).catch(e => {
|
||||||
|
console.error("Failed to reply to user: ", e);
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: check content in moderation API
|
// TODO: check content in moderation API
|
||||||
|
|
||||||
const messages: ChatCompletionMessageParam[] = [
|
const messages: ChatCompletionMessageParam[] = [
|
||||||
|
|
Loading…
Reference in a new issue