From 03635e748bde20bb384b1993beac48286c6e1aea Mon Sep 17 00:00:00 2001 From: amy Date: Wed, 9 Apr 2025 18:55:14 +0330 Subject: [PATCH] option to change speed --- src/commands/pat.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/commands/pat.ts b/src/commands/pat.ts index 990ef32..5e4a709 100644 --- a/src/commands/pat.ts +++ b/src/commands/pat.ts @@ -20,6 +20,7 @@ export default class PingCommand extends Command { async run(interaction: ChatInputCommandInteraction, config: Config) { const user = interaction.options.getUser('user', true) + const speed = interaction.options.getInteger('speed') ?? 0 const avatarResponse = await fetch(user.avatarURL({})!) const avatarBuf = Buffer.from(await avatarResponse.arrayBuffer()) const frames: SharpInput[] = [] @@ -46,7 +47,7 @@ export default class PingCommand extends Command { const webP = await sharp( frames, { join: { animated: true } } - ).webp({ delay: new Array(pos).fill(200), loop: 0 }).toBuffer(); + ).webp({ delay: new Array(pos).fill(200-speed), loop: 0 }).toBuffer(); await interaction.reply({ content: `Patting ${user.displayName}`, files: [ @@ -65,6 +66,9 @@ export default class PingCommand extends Command { .addUserOption(builder => builder.setName("user") .setDescription("The one to plap") .setRequired(true)) + .addIntegerOption(builder => builder.setName("speed") + .setDescription("speed (higher is faster, max is 200)") + .setRequired(false)) .setContexts([ InteractionContextType.BotDM, InteractionContextType.Guild,