rate limits
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { ApplyOptions } from '@sapphire/decorators';
|
||||
import { Args, Command } from '@sapphire/framework';
|
||||
import { Args, BucketScope, Command } from '@sapphire/framework';
|
||||
import { Message } from 'discord.js';
|
||||
import { Configuration, OpenAIApi } from 'openai';
|
||||
|
||||
@ -11,9 +11,12 @@ const openai = new OpenAIApi(configuration);
|
||||
@ApplyOptions<Command.Options>({
|
||||
description: 'Make a picture!',
|
||||
options: ['prompt'],
|
||||
// 10mins
|
||||
cooldownDelay: 600_000,
|
||||
cooldownLimit: 1,
|
||||
cooldownFilteredUsers: ['himbothyswaggins']
|
||||
// Yes... I did hardcode myself.
|
||||
cooldownFilteredUsers: ['himbothyswaggins'],
|
||||
cooldownScope: BucketScope.User
|
||||
})
|
||||
export class UserCommand extends Command {
|
||||
// Register Chat Input and Context Menu command
|
||||
|
@ -20,10 +20,13 @@ const client = new SapphireClient({
|
||||
intents: [GatewayIntentBits.DirectMessages, GatewayIntentBits.GuildMessages, GatewayIntentBits.Guilds, GatewayIntentBits.MessageContent],
|
||||
loadMessageCommandListeners: true,
|
||||
defaultCooldown: {
|
||||
// 10s
|
||||
delay: 10_000,
|
||||
filteredCommands: ['ping', 'wryna'],
|
||||
limit: 2,
|
||||
scope: BucketScope.Guild
|
||||
// Yes... I did hardcode myself.
|
||||
filteredUsers: ['himbothyswaggins'],
|
||||
scope: BucketScope.User
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user