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) +})