From d3ee8635b29c0b41537fb5d40293110bff4d11dd Mon Sep 17 00:00:00 2001 From: qwerinope Date: Sun, 14 Sep 2025 14:07:35 +0200 Subject: [PATCH] fix #7, many commands are now for mods instead of admins --- README.md | 16 ++++++++-------- src/commands/addinvuln.ts | 2 +- src/commands/disablecheer.ts | 2 +- src/commands/disablecommand.ts | 2 +- src/commands/enablecheer.ts | 2 +- src/commands/enablecommand.ts | 2 +- src/commands/itemlock.ts | 2 +- src/commands/removeinvuln.ts | 2 +- src/events/message.ts | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 5c98d6e..655e18f 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ It's theoretically possible to get 5 of each item. This depends on if the `CHATTER_IS_STREAMER` environment variable is set. If it's `true`, the chatterbot and streamerbot are the same account. -The chatterbot is the user that types in chat. They have very minimal required scopes as interacting with the stream is always done by the streamerbot. Only sending chat messages is done by the chatterbot. +The chatterbot is the user that types in chat. They have very minimal required scopes as interacting with the stream is always done by the streamerbot. Only things the chatterbot does is relay whispers and send chat messages. The streamerbot (not that streamerbot) is the broadcaster. This bot needs them to authenticate as well. This account will be used to perform moderation and watch the chat. @@ -133,16 +133,16 @@ COMMAND|FUNCTION|USER|ALIASES|DISABLEABLE `gettimeout {target}`|Get the remaining timeout duration of targeted user|anyone|`gettimeout` `gett`|:white_check_mark: `stacking [on/off]`|Check/set if timeouts are stacking. Only admins can set the stacking state|anyone/admins|`stacking`|:x: `vulnchatters`|Get amount of chatters vulnerable to explosives|anyone|`vulnchatters` `vulnc`|:white_check_mark: -`disablecommand {command/item}`|Disable a specific command/item|admins|`disablecommand`|:x: -`enablecommand {command/item}`|Re-enable a specific command/item|admins|`enablecommand`|:x: -`disablecheer {cheer}`|Disable a specific cheer event|admins|`disablecheer`|:x: -`enablecheer {cheer}`|Re-enable a specific cheer event|admins|`enablecheer`|:x: +`disablecommand {command/item}`|Disable a specific command/item|moderator|`disablecommand`|:x: +`enablecommand {command/item}`|Re-enable a specific command/item|moderator|`enablecommand`|:x: +`disablecheer {cheer}`|Disable a specific cheer event|moderator|`disablecheer`|:x: +`enablecheer {cheer}`|Re-enable a specific cheer event|moderator|`enablecheer`|:x: `getinvulns`|Get a list of every invulnerable chatter in the channel|anyone|`getinvulns`|:x: `getadmins`|Get a list of every admin in the channel|anyone|`getadmins`|:x: -`itemlock {target}`|Toggle the itemlock on the specified target|admins|`itemlock`|:x: +`itemlock {target}`|Toggle the itemlock on the specified target|moderator|`itemlock`|:x: `testcheer {amount} [args]`|Create a fake cheering event|streamer/chatterbot|`testcheer`|:x: -`addinvuln {target}`|Adds an invuln user|admins|`addinvuln`|:x: -`removeinvuln {target}`|Removes an invuln user|admins|`removeinvuln`|:x: +`addinvuln {target}`|Adds an invuln user|moderator|`addinvuln`|:x: +`removeinvuln {target}`|Removes an invuln user|moderator|`removeinvuln`|:x: `addadmin {target}`|Adds an admin|streamer/chatterbot|`addadmin`|:x: `removeadmin {target}`|Removes an admin|streamer/chatterbot|`removeadmin`|:x: diff --git a/src/commands/addinvuln.ts b/src/commands/addinvuln.ts index 9f6855b..a00b747 100644 --- a/src/commands/addinvuln.ts +++ b/src/commands/addinvuln.ts @@ -6,7 +6,7 @@ import User from "user"; export default new Command({ name: 'addinvuln', aliases: ['addinvuln'], - usertype: 'admin', + usertype: 'moderator', disableable: false, execution: async msg => { const args = parseCommandArgs(msg.messageText); diff --git a/src/commands/disablecheer.ts b/src/commands/disablecheer.ts index dc46ff3..8f36ffe 100644 --- a/src/commands/disablecheer.ts +++ b/src/commands/disablecheer.ts @@ -6,7 +6,7 @@ import { namedcheers } from "cheers"; export default new Command({ name: 'disablecheer', aliases: ['disablecheer'], - usertype: 'admin', + usertype: 'moderator', disableable: false, execution: async msg => { const args = parseCommandArgs(msg.messageText); diff --git a/src/commands/disablecommand.ts b/src/commands/disablecommand.ts index 4431b9d..2d6ddc9 100644 --- a/src/commands/disablecommand.ts +++ b/src/commands/disablecommand.ts @@ -5,7 +5,7 @@ import parseCommandArgs from "lib/parseCommandArgs"; export default new Command({ name: 'disablecommand', aliases: ['disablecommand'], - usertype: 'admin', + usertype: 'moderator', disableable: false, execution: async msg => { const args = parseCommandArgs(msg.messageText); diff --git a/src/commands/enablecheer.ts b/src/commands/enablecheer.ts index be3d506..f23d5e8 100644 --- a/src/commands/enablecheer.ts +++ b/src/commands/enablecheer.ts @@ -6,7 +6,7 @@ import { namedcheers } from "cheers"; export default new Command({ name: 'enablecheer', aliases: ['enablecheer'], - usertype: 'admin', + usertype: 'moderator', disableable: false, execution: async msg => { const args = parseCommandArgs(msg.messageText); diff --git a/src/commands/enablecommand.ts b/src/commands/enablecommand.ts index bfdadae..21ef5dc 100644 --- a/src/commands/enablecommand.ts +++ b/src/commands/enablecommand.ts @@ -5,7 +5,7 @@ import parseCommandArgs from "lib/parseCommandArgs"; export default new Command({ name: 'enablecommand', aliases: ['enablecommand'], - usertype: 'admin', + usertype: 'moderator', disableable: false, execution: async msg => { const args = parseCommandArgs(msg.messageText); diff --git a/src/commands/itemlock.ts b/src/commands/itemlock.ts index 37da4d1..b09b377 100644 --- a/src/commands/itemlock.ts +++ b/src/commands/itemlock.ts @@ -5,7 +5,7 @@ import User from "user"; export default new Command({ name: 'itemlock', aliases: ['itemlock'], - usertype: 'admin', + usertype: 'moderator', disableable: false, execution: async msg => { const args = parseCommandArgs(msg.messageText); diff --git a/src/commands/removeinvuln.ts b/src/commands/removeinvuln.ts index 1157fe3..862422b 100644 --- a/src/commands/removeinvuln.ts +++ b/src/commands/removeinvuln.ts @@ -7,7 +7,7 @@ import User from "user"; export default new Command({ name: 'removeinvuln', aliases: ['removeinvuln'], - usertype: 'admin', + usertype: 'moderator', disableable: false, execution: async msg => { const args = parseCommandArgs(msg.messageText); diff --git a/src/events/message.ts b/src/events/message.ts index 86f0fe6..80adda8 100644 --- a/src/events/message.ts +++ b/src/events/message.ts @@ -59,7 +59,7 @@ async function handleChatMessage(msg: EventSubChannelChatMessageEvent, user: Use if (!streamerUsers.includes(msg.chatterId)) return; break; case "moderator": - if (!await redis.exists(`user:${user.id}:mod`)) return; + if (!(await redis.exists(`user:${user.id}:mod`) || await isAdmin(user.id))) return; break; };