We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
You can continue the conversation there. Go to discussion →
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Before the command executed, preconditon will run first
The text was updated successfully, but these errors were encountered:
You can use interceptors when you initialize the client.
SlashCommandClient.builder("bot.huge.packages.commands") .addSlashInterceptor(object : SlashCommandInterceptor { override suspend fun intercept(ctx: SlashCommandContext): Boolean { if (!ctx.function.hasAnnotation<RequireBetaAccess>()) return true if (!ctx.isFromGuild || !ctx.guildData.hasBetaAccess()) { ctx.located(EmojiUtils.NoEntry, "interceptors.requireBetaAccess").setEphemeral(true).queue() return false } return true } } .addSlashInterceptor { SlashInterceptors.requireVoiceConnected(it) } .enableMetrics() .setRateLimitClient(redis.slashRateLimitClient) .withTimeout(5.minutes) .buildWith(shardManager)
@RequireBetaAccess @OnSlashCommand(name = "commandname", target = InteractionTarget.GUILD) suspend fun command(ctx: GuildSlashCommandContext) { // Your command code }
@Retention(AnnotationRetention.RUNTIME) @Target(AnnotationTarget.FUNCTION) annotation class RequireBetaAccess()
The code shown is a small part of HUGE.
Sorry, something went wrong.
Blad3Mak3r
No branches or pull requests
Before the command executed, preconditon will run first
The text was updated successfully, but these errors were encountered: