mirror of
https://github.com/qwerinope/qweribot.git
synced 2025-12-19 08:41:39 +01:00
add !modme command as backup
This commit is contained in:
@@ -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]
|
||||
|
||||
11
src/commands/modme.ts
Normal file
11
src/commands/modme.ts
Normal file
@@ -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)
|
||||
})
|
||||
Reference in New Issue
Block a user