renamed unbannableUsers to something better

This commit is contained in:
2025-06-29 16:52:08 +02:00
parent 4c2f31e1f8
commit ab769fb546
6 changed files with 13 additions and 13 deletions

View File

@@ -1,15 +1,15 @@
import { Command, sendMessage } from ".";
import { unbannableUsers } from "..";
import { streamerUsers } from "..";
import { removeAdmin } from "../lib/admins";
import parseCommandArgs from "../lib/parseCommandArgs";
import { User } from "../user";
export default new Command('removeadmin', ['removeadmin'], 'unbannable', async msg => {
export default new Command('removeadmin', ['removeadmin'], 'streamer', async msg => {
const args = parseCommandArgs(msg.messageText);
if (!args[0]) { await sendMessage('Please specify a target', msg.messageId); return; };
const target = await User.initUsername(args[0].toLowerCase());
if (!target) { await sendMessage(`Chatter ${args[0]} doesn't exist`, msg.messageId); return; };
if (unbannableUsers.includes(target.id)) { await sendMessage(`Can't remove admin ${target.displayName} as they are managed by the bot program`, msg.messageId); return; };
if (streamerUsers.includes(target.id)) { await sendMessage(`Can't remove admin ${target.displayName} as they are managed by the bot program`, msg.messageId); return; };
const data = await removeAdmin(target.id);
if (data === 1) await sendMessage(`${target.displayName} is no longer an admin`, msg.messageId);
else await sendMessage(`${target.displayName} isn't an admin`, msg.messageId);