added cheers, cheer management commands, timeout cheer

This commit is contained in:
2025-07-07 15:42:51 +02:00
parent fe5c071900
commit afd7dda332
10 changed files with 198 additions and 6 deletions

View File

@@ -0,0 +1,14 @@
import { redis } from "bun";
import { Command, sendMessage } from ".";
import parseCommandArgs from "../lib/parseCommandArgs";
import { namedcheers } from "../cheers";
export default new Command('disablecheer', ['disablecheer'], 'admin', async msg => {
const args = parseCommandArgs(msg.messageText);
if (!args[0]) { await sendMessage('Please specify a cheer to disable', msg.messageId); return; };
const selection = namedcheers.get(args[0].toLowerCase());
if (!selection) { await sendMessage(`There is no ${args[0]} cheer`, msg.messageId); return; };
const result = await redis.sadd('disabledcheers', selection.name);
if (result === 0) { await sendMessage(`The ${selection.name} cheer is already disabled`, msg.messageId); return; };
await sendMessage(`Successfully disabled the ${selection.name} cheer`, msg.messageId);
}, false);