From 50750508abe2194d39b06619db47a0879cc64795 Mon Sep 17 00:00:00 2001 From: qwerinope Date: Wed, 2 Apr 2025 17:44:57 +0200 Subject: [PATCH] add !modme command as backup --- src/commands/index.ts | 3 ++- src/commands/modme.ts | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 src/commands/modme.ts diff --git a/src/commands/index.ts b/src/commands/index.ts index 103b1b5..9e98829 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -5,5 +5,6 @@ import inventory from "./inventory"; import stats from "./stats"; import mbucks from "./mbucks"; import getloot from "./getloot"; +import modme from "./modme"; -export default [timeout, thank, give, inventory, stats, mbucks, getloot] +export default [timeout, thank, give, inventory, stats, mbucks, getloot, modme] diff --git a/src/commands/modme.ts b/src/commands/modme.ts new file mode 100644 index 0000000..9a585ae --- /dev/null +++ b/src/commands/modme.ts @@ -0,0 +1,11 @@ +import { createBotCommand } from "@twurple/easy-bot"; +import api, { broadcasterApi } from "../lib/api"; + +const MODS = ['qwerinope'] + +export default createBotCommand('modme', async (_params, { userName, broadcasterId }) => { + if (!MODS.includes(userName)) return + + if (broadcasterApi) await broadcasterApi.moderation.addModerator(broadcasterId, userName) + else await api.moderation.addModerator(broadcasterId, userName) +})