{ "version": 3, "sources": ["../../../../server/chat-commands/moderation.ts"], "sourcesContent": ["/**\n * Moderation commands\n * Pokemon Showdown - http://pokemonshowdown.com/\n *\n * These are commands for staff.\n *\n * For the API, see chat-plugins/COMMANDS.md\n *\n * @license MIT\n */\nimport {Utils} from '../../lib';\nimport {RoomSection, RoomSections} from './room-settings';\n\n/* eslint no-else-return: \"error\" */\n\nconst MAX_REASON_LENGTH = 600;\nconst MUTE_LENGTH = 7 * 60 * 1000;\nconst HOURMUTE_LENGTH = 60 * 60 * 1000;\nconst DAY = 24 * 60 * 60 * 1000;\n\n/** Require reasons for punishment commands */\nconst REQUIRE_REASONS = true;\n\n/**\n * Promotes a user within a room. Returns a User object if a popup should be shown to the user,\n * and null otherwise. Throws a Chat.ErrorMesage on an error.\n *\n * @param promoter the User object of the user who is promoting\n * @param room the Room in which the promotion is happening\n * @param userid the ID of the user to promote\n * @param symbol the GroupSymbol to promote to\n * @param username the username of the user to promote\n * @param force whether or not to forcibly promote\n */\nexport function runPromote(\n\tpromoter: User,\n\troom: Room,\n\tuserid: ID,\n\tsymbol: GroupSymbol,\n\tusername?: string,\n\tforce?: boolean\n) {\n\tconst targetUser = Users.getExact(userid);\n\tusername = username || userid;\n\tif (!username) return;\n\n\tif (userid.length > 18) {\n\t\tthrow new Chat.ErrorMessage(`User '${username}' does not exist (the username is too long).`);\n\t}\n\tif (!targetUser && !Users.isUsernameKnown(userid) && !force) {\n\t\tthrow new Chat.ErrorMessage(`User '${username}' is offline and unrecognized, and so can't be promoted.`);\n\t}\n\tif (targetUser && !targetUser.registered) {\n\t\tthrow new Chat.ErrorMessage(`User '${username}' is unregistered, and so can't be promoted.`);\n\t}\n\n\tlet currentSymbol: GroupSymbol | 'whitelist' = room.auth.getDirect(userid);\n\tif (room.auth.has(userid) && currentSymbol === Users.Auth.defaultSymbol()) {\n\t\tcurrentSymbol = 'whitelist';\n\t}\n\tconst currentGroup = Users.Auth.getGroup(currentSymbol);\n\tconst currentGroupName = currentGroup.name || \"regular user\";\n\n\tconst nextGroup = Config.groups[symbol];\n\n\tif (currentSymbol === symbol) {\n\t\tthrow new Chat.ErrorMessage(`User '${username}' is already a ${nextGroup?.name || symbol || 'regular user'} in this room.`);\n\t}\n\tif (!promoter.can('makeroom')) {\n\t\tif (currentGroup.id && !promoter.can(`room${currentGroup.id || 'voice'}` as 'roomvoice', null, room)) {\n\t\t\tthrow new Chat.ErrorMessage(`Access denied for promoting/demoting ${username} from ${currentGroupName}.`);\n\t\t}\n\t\tif (symbol !== ' ' && !promoter.can(`room${nextGroup.id || 'voice'}` as 'roomvoice', null, room)) {\n\t\t\tthrow new Chat.ErrorMessage(`Access denied for promoting/demoting ${username} to ${nextGroup.name}.`);\n\t\t}\n\t}\n\tif (targetUser?.locked && room.persist && room.settings.isPrivate !== true && nextGroup.rank > 2) {\n\t\tthrow new Chat.ErrorMessage(`${username} is locked and can't be promoted.`);\n\t}\n\n\tif (symbol === Users.Auth.defaultSymbol()) {\n\t\troom.auth.delete(userid);\n\t} else {\n\t\troom.auth.set(userid, symbol);\n\t}\n\n\tif (targetUser) {\n\t\ttargetUser.updateIdentity(room.roomid);\n\t\tif (room.subRooms) {\n\t\t\tfor (const subRoom of room.subRooms.values()) {\n\t\t\t\ttargetUser.updateIdentity(subRoom.roomid);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Only show popup if: user is online and in the room, the room is public, and not a groupchat or a battle.\n\tif (targetUser && room.users[targetUser.id] && room.persist && room.settings.isPrivate !== true) {\n\t\treturn targetUser;\n\t}\n\treturn null;\n}\n\nexport function runCrisisDemote(userid: ID) {\n\tconst from = [];\n\tconst section = Users.globalAuth.sectionLeaders.get(userid);\n\tif (section) {\n\t\tfrom.push(`Section Leader (${RoomSections.sectionNames[section] || section})`);\n\t\tUsers.globalAuth.deleteSection(userid);\n\t}\n\tconst globalGroup = Users.globalAuth.get(userid);\n\tif (globalGroup && globalGroup !== ' ') {\n\t\tfrom.push(globalGroup);\n\t\tUsers.globalAuth.delete(userid);\n\t}\n\tfor (const room of Rooms.global.chatRooms) {\n\t\tif (!room.settings.isPrivate && room.auth.isStaff(userid)) {\n\t\t\tlet oldGroup: string = room.auth.getDirect(userid);\n\t\t\tif (oldGroup === ' ') {\n\t\t\t\toldGroup = 'whitelist in ';\n\t\t\t} else {\n\t\t\t\troom.auth.set(userid, '+');\n\t\t\t}\n\t\t\tfrom.push(`${oldGroup}${room.roomid}`);\n\t\t}\n\t}\n\treturn from;\n}\n\nPunishments.addPunishmentType({\n\ttype: 'YEARLOCK',\n\tdesc: \"Locked for a year\",\n\tonActivate: (user, punishment) => {\n\t\tuser.locked = user.id;\n\t\tChat.punishmentfilter(user, punishment);\n\t},\n});\n\nexport const commands: Chat.ChatCommands = {\n\troomowner(target, room, user) {\n\t\troom = this.requireRoom();\n\t\tif (!room.persist) {\n\t\t\treturn this.sendReply(\"/roomowner - This room isn't designed for per-room moderation to be added\");\n\t\t}\n\t\tif (!target) return this.parse('/help roomowner');\n\t\tconst {targetUser, targetUsername, rest} = this.splitUser(target, {exactName: true});\n\t\tif (rest) return this.errorReply(`This command does not support specifying a reason.`);\n\t\tconst userid = toID(targetUsername);\n\n\t\tif (!Users.isUsernameKnown(userid)) {\n\t\t\treturn this.errorReply(`User '${targetUsername}' is offline and unrecognized, and so can't be promoted.`);\n\t\t}\n\n\t\tthis.checkCan('makeroom');\n\t\tif (room.auth.getDirect(userid) === '#') return this.errorReply(`${targetUsername} is already a room owner.`);\n\n\t\troom.auth.set(userid, '#');\n\t\tconst message = `${targetUsername} was appointed Room Owner by ${user.name}.`;\n\t\tif (room.settings.isPrivate === true) {\n\t\t\tthis.addModAction(message);\n\t\t\tRooms.get(`upperstaff`)?.addByUser(user, `<<${room.roomid}>> ${message}`).update();\n\t\t} else {\n\t\t\tthis.addGlobalModAction(message);\n\t\t}\n\t\tthis.modlog('ROOMOWNER', userid);\n\t\tif (targetUser) {\n\t\t\ttargetUser.popup(`You were appointed Room Owner by ${user.name} in ${room.roomid}.`);\n\t\t\troom.onUpdateIdentity(targetUser);\n\t\t\tif (room.subRooms) {\n\t\t\t\tfor (const subRoom of room.subRooms.values()) {\n\t\t\t\t\tsubRoom.onUpdateIdentity(targetUser);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\troom.saveSettings();\n\t},\n\troomownerhelp: [`/roomowner [username] - Appoints [username] as a room owner. Requires: &`],\n\n\troomdemote: 'roompromote',\n\tforceroompromote: 'roompromote',\n\tforceroomdemote: 'roompromote',\n\troompromote(target, room, user, connection, cmd) {\n\t\tif (!room) {\n\t\t\t// this command isn't marked as room-only because it's usable in PMs through /invite\n\t\t\treturn this.errorReply(\"This command is only available in rooms\");\n\t\t}\n\t\tthis.checkChat();\n\t\tif (!target) return this.parse('/help roompromote');\n\n\t\tconst force = cmd.startsWith('force');\n\t\tconst users = target.split(',').map(part => part.trim());\n\t\tlet nextSymbol = users.pop() as GroupSymbol | 'deauth';\n\t\tif (nextSymbol === 'deauth') nextSymbol = Users.Auth.defaultSymbol();\n\t\tconst nextGroup = Users.Auth.getGroup(nextSymbol);\n\n\t\tif (!nextSymbol) {\n\t\t\treturn this.errorReply(\"Please specify a group such as /roomvoice or /roomdeauth\");\n\t\t}\n\t\tif (!Config.groups[nextSymbol]) {\n\t\t\tif (!force || !user.can('bypassall')) {\n\t\t\t\tthis.errorReply(`Group '${nextSymbol}' does not exist.`);\n\t\t\t\tif (user.can('bypassall')) {\n\t\t\t\t\tthis.errorReply(`If you want to promote to a nonexistent group, use /forceroompromote`);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t} else if (!Users.Auth.isValidSymbol(nextSymbol)) {\n\t\t\t\t// yes I know this excludes astral-plane characters and includes combining characters\n\t\t\t\treturn this.errorReply(`Admins can forcepromote to nonexistent groups only if they are one character long`);\n\t\t\t}\n\t\t}\n\n\t\tif (!force && (nextGroup.globalonly || (nextGroup.battleonly && !room.battle))) {\n\t\t\treturn this.errorReply(`Group 'room${nextGroup.id || nextSymbol}' does not exist as a room rank.`);\n\t\t}\n\t\tconst nextGroupName = nextGroup.name || \"regular user\";\n\n\t\tfor (const toPromote of users) {\n\t\t\tconst userid = toID(toPromote);\n\t\t\tif (!userid) return this.parse('/help roompromote');\n\n\t\t\t// weird ts bug (?) - 7022\n\t\t\t// it implicitly is 'any' because it has no annotation and is \"is referenced directly or indirectly in its own initializer.\"\n\t\t\t// dunno why this happens, but for now we can just cast over it.\n\t\t\tconst oldSymbol: GroupSymbol = room.auth.getDirect(userid);\n\t\t\tlet shouldPopup;\n\t\t\ttry {\n\t\t\t\tshouldPopup = runPromote(user, room, userid, nextSymbol, toPromote, force);\n\t\t\t} catch (err: any) {\n\t\t\t\tif (err.name?.endsWith('ErrorMessage')) {\n\t\t\t\t\tthis.errorReply(err.message);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tconst targetUser = Users.getExact(userid);\n\t\t\tconst name = targetUser?.name || toPromote;\n\n\t\t\tif (this.pmTarget && targetUser) {\n\t\t\t\tconst text = `${targetUser.name} was invited (and promoted to Room ${nextGroupName}) by ${user.name}.`;\n\t\t\t\troom.add(`|c|${user.getIdentity(room)}|/log ${text}`).update();\n\t\t\t\tthis.modlog('INVITE', targetUser, null, {noip: 1, noalts: 1});\n\t\t\t} else if (\n\t\t\t\tnextSymbol in Config.groups && oldSymbol in Config.groups &&\n\t\t\t\tnextGroup.rank < Config.groups[oldSymbol].rank\n\t\t\t) {\n\t\t\t\tif (targetUser && room.users[targetUser.id] && !nextGroup.modlog) {\n\t\t\t\t\t// if the user can't see the demotion message (i.e. rank < %), it is shown in the chat\n\t\t\t\t\ttargetUser.send(`>${room.roomid}\\n(You were demoted to Room ${nextGroupName} by ${user.name}.)`);\n\t\t\t\t}\n\t\t\t\tthis.privateModAction(`${name} was demoted to Room ${nextGroupName} by ${user.name}.`);\n\t\t\t\tthis.modlog(`ROOM${nextGroupName.toUpperCase()}`, userid, '(demote)');\n\t\t\t\tshouldPopup?.popup(`You were demoted to Room ${nextGroupName} by ${user.name} in ${room.roomid}.`);\n\t\t\t} else if (nextSymbol === '#') {\n\t\t\t\tthis.addModAction(`${name} was promoted to ${nextGroupName} by ${user.name}.`);\n\t\t\t\tconst logRoom = Rooms.get(room.settings.isPrivate === true ? 'upperstaff' : 'staff');\n\t\t\t\tlogRoom?.addByUser(user, `<<${room.roomid}>> ${name} was appointed Room Owner by ${user.name}`);\n\t\t\t\tthis.modlog('ROOM OWNER', userid);\n\t\t\t\tshouldPopup?.popup(`You were promoted to ${nextGroupName} by ${user.name} in ${room.roomid}.`);\n\t\t\t} else {\n\t\t\t\tthis.addModAction(`${name} was promoted to Room ${nextGroupName} by ${user.name}.`);\n\t\t\t\tthis.modlog(`ROOM${nextGroupName.toUpperCase()}`, userid);\n\t\t\t\tshouldPopup?.popup(`You were promoted to Room ${nextGroupName} by ${user.name} in ${room.roomid}.`);\n\t\t\t}\n\n\t\t\tif (targetUser) {\n\t\t\t\ttargetUser.updateIdentity(room.roomid);\n\t\t\t\tif (room.subRooms) {\n\t\t\t\t\tfor (const subRoom of room.subRooms.values()) {\n\t\t\t\t\t\ttargetUser.updateIdentity(subRoom.roomid);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (targetUser.trusted && !Users.isTrusted(targetUser.id)) {\n\t\t\t\t\ttargetUser.trusted = '';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\troom.saveSettings();\n\t},\n\troompromotehelp: [\n\t\t`/roompromote OR /roomdemote [comma-separated usernames], [group symbol] - Promotes/demotes the user(s) to the specified room rank. Requires: @ # &`,\n\t\t`/room[group] [comma-separated usernames] - Promotes/demotes the user(s) to the specified room rank. Requires: @ # &`,\n\t\t`/roomdeauth [comma-separated usernames] - Removes all room rank from the user(s). Requires: @ # &`,\n\t],\n\n\tauth: 'authority',\n\tstafflist: 'authority',\n\tglobalauth: 'authority',\n\tauthlist: 'authority',\n\tauthority(target, room, user, connection) {\n\t\tif (target && target !== '+') {\n\t\t\tconst targetRoom = Rooms.search(target);\n\t\t\tconst availableRoom = targetRoom?.checkModjoin(user);\n\t\t\tif (targetRoom && availableRoom) return this.parse(`/roomauth1 ${target}`);\n\t\t\treturn this.parse(`/userauth ${target}`);\n\t\t}\n\t\tconst showAll = !!target;\n\t\tconst rankLists: {[k: string]: string[]} = {};\n\t\tfor (const [id, symbol] of Users.globalAuth) {\n\t\t\tif (symbol === ' ' || (symbol === '+' && !showAll)) continue;\n\t\t\tif (!rankLists[symbol]) rankLists[symbol] = [];\n\t\t\trankLists[symbol].push(Users.globalAuth.usernames.get(id) || id);\n\t\t}\n\n\t\tconst buffer = Utils.sortBy(\n\t\t\tObject.entries(rankLists) as [GroupSymbol, string[]][],\n\t\t\t([symbol]) => -Users.Auth.getGroup(symbol).rank\n\t\t).filter(\n\t\t\t([symbol]) => symbol !== Users.SECTIONLEADER_SYMBOL\n\t\t).map(\n\t\t\t([symbol, names]) => (\n\t\t\t\t`${(Config.groups[symbol] ? `**${Config.groups[symbol].name}s** (${symbol})` : symbol)}:\\n` +\n\t\t\t\tUtils.sortBy(names, name => toID(name)).join(\", \")\n\t\t\t)\n\t\t);\n\t\tif (!showAll) buffer.push(`(Use \\`\\`/auth +\\`\\` to show global voice users.)`);\n\n\t\tif (!buffer.length) return connection.popup(\"This server has no global authority.\");\n\t\tconnection.popup(buffer.join(\"\\n\\n\"));\n\t},\n\tauthhelp: [\n\t\t`/auth - Show global staff for the server.`,\n\t\t`/auth + - Show global staff for the server, including voices.`,\n\t\t`/auth [room] - Show what roomauth a room has.`,\n\t\t`/auth [user] - Show what global and roomauth a user has.`,\n\t],\n\n\troomstaff: 'roomauth',\n\troomauth1: 'roomauth',\n\troomauth(target, room, user, connection, cmd) {\n\t\tlet userLookup = '';\n\t\tif (cmd === 'roomauth1') userLookup = `\\n\\nTo look up auth for a user, use /userauth ${target}`;\n\t\tlet targetRoom = room;\n\t\tif (target) targetRoom = Rooms.search(target)!;\n\t\tif (!targetRoom?.checkModjoin(user)) {\n\t\t\treturn this.errorReply(`The room \"${target}\" does not exist.`);\n\t\t}\n\t\tconst showAll = user.can('mute', null, targetRoom);\n\n\t\tconst rankLists: {[groupSymbol: string]: ID[]} = {};\n\t\tfor (const [id, rank] of targetRoom.auth) {\n\t\t\tif (rank === ' ' && !showAll) continue;\n\t\t\tif (!rankLists[rank]) rankLists[rank] = [];\n\t\t\trankLists[rank].push(id);\n\t\t}\n\n\t\tconst buffer = Utils.sortBy(\n\t\t\tObject.entries(rankLists) as [GroupSymbol, ID[]][],\n\t\t\t([symbol]) => -Users.Auth.getGroup(symbol).rank\n\t\t).map(([symbol, names]) => {\n\t\t\tlet group = Config.groups[symbol] ? `${Config.groups[symbol].name}s (${symbol})` : symbol;\n\t\t\tif (symbol === ' ') group = 'Whitelisted (this list is only visible to staff)';\n\t\t\treturn `${group}:\\n` +\n\t\t\t\tUtils.sortBy(names).map(userid => {\n\t\t\t\t\tconst isOnline = Users.get(userid)?.statusType === 'online';\n\t\t\t\t\t// targetRoom guaranteed to exist above\n\t\t\t\t\treturn userid in targetRoom!.users && isOnline ? `**${userid}**` : userid;\n\t\t\t\t}).join(', ');\n\t\t});\n\n\t\tlet curRoom = targetRoom;\n\t\twhile (curRoom.parent) {\n\t\t\tconst modjoinSetting = curRoom.settings.modjoin === true ? curRoom.settings.modchat : curRoom.settings.modjoin;\n\t\t\tconst roomType = (modjoinSetting ? `modjoin ${modjoinSetting} ` : '');\n\t\t\tconst inheritedUserType = (modjoinSetting ? ` of rank ${modjoinSetting} and above` : '');\n\t\t\tif (curRoom.parent) {\n\t\t\t\tconst also = buffer.length === 0 ? `` : ` also`;\n\t\t\t\tbuffer.push(`${curRoom.title} is a ${roomType}subroom of ${curRoom.parent.title}, so ${curRoom.parent.title} users${inheritedUserType}${also} have authority in this room.`);\n\t\t\t}\n\t\t\tcurRoom = curRoom.parent;\n\t\t}\n\t\tif (!buffer.length) {\n\t\t\tconnection.popup(`The room '${targetRoom.title}' has no auth. ${userLookup}`);\n\t\t\treturn;\n\t\t}\n\t\tif (!curRoom.settings.isPrivate) {\n\t\t\tbuffer.push(`${curRoom.title} is a public room, so global auth with no relevant roomauth will have authority in this room.`);\n\t\t} else if (curRoom.settings.isPrivate === 'hidden' || curRoom.settings.isPrivate === 'voice') {\n\t\t\tbuffer.push(`${curRoom.title} is a hidden room, so global auth with no relevant roomauth will have authority in this room.`);\n\t\t}\n\t\tbuffer.push(`Names in **bold** are online.`);\n\t\tif (targetRoom !== room) buffer.unshift(`${targetRoom.title} room auth:`);\n\t\tconnection.popup(`${buffer.join(\"\\n\\n\")}${userLookup}`);\n\t},\n\troomauthhelp: [\n\t\t`/roomauth [room] - Shows a list of the staff and authority in the given [room].`,\n\t\t`If no room is given, it defaults to the current room.`,\n\t],\n\n\tuserauth(target, room, user, connection) {\n\t\tconst targetId = toID(target) || user.id;\n\t\tconst targetUser = Users.getExact(targetId);\n\t\tconst targetUsername = targetUser?.name || target;\n\n\t\tconst buffer = [];\n\t\tlet innerBuffer = [];\n\t\tconst group = Users.globalAuth.get(targetId);\n\t\tif (group !== ' ' || Users.isTrusted(targetId)) {\n\t\t\tbuffer.push(`Global auth: ${group === ' ' ? 'trusted' : group}`);\n\t\t}\n\t\tconst sectionLeader = Users.globalAuth.sectionLeaders.get(targetId);\n\t\tif (sectionLeader) {\n\t\t\tbuffer.push(`Section leader: ${RoomSections.sectionNames[sectionLeader]}`);\n\t\t}\n\t\tfor (const curRoom of Rooms.rooms.values()) {\n\t\t\tif (curRoom.settings.isPrivate) continue;\n\t\t\tif (!curRoom.auth.has(targetId)) continue;\n\t\t\tinnerBuffer.push(curRoom.auth.getDirect(targetId).trim() + curRoom.roomid);\n\t\t}\n\t\tif (innerBuffer.length) {\n\t\t\tbuffer.push(`Room auth: ${innerBuffer.join(', ')}`);\n\t\t}\n\t\tif (targetId === user.id || user.can('lock')) {\n\t\t\tinnerBuffer = [];\n\t\t\tfor (const curRoom of Rooms.rooms.values()) {\n\t\t\t\tif (!curRoom.settings.isPrivate) continue;\n\t\t\t\tif (curRoom.settings.isPrivate === true) continue;\n\t\t\t\tif (!curRoom.auth.has(targetId)) continue;\n\t\t\t\tinnerBuffer.push(curRoom.auth.getDirect(targetId).trim() + curRoom.roomid);\n\t\t\t}\n\t\t\tif (innerBuffer.length) {\n\t\t\t\tbuffer.push(`Hidden room auth: ${innerBuffer.join(', ')}`);\n\t\t\t}\n\t\t}\n\t\tif (targetId === user.id || user.can('makeroom')) {\n\t\t\tinnerBuffer = [];\n\t\t\tfor (const chatRoom of Rooms.global.chatRooms) {\n\t\t\t\tif (!chatRoom.settings.isPrivate) continue;\n\t\t\t\tif (chatRoom.settings.isPrivate !== true) continue;\n\t\t\t\tif (!chatRoom.auth.has(targetId)) continue;\n\t\t\t\tinnerBuffer.push(chatRoom.auth.getDirect(targetId).trim() + chatRoom.roomid);\n\t\t\t}\n\t\t\tif (innerBuffer.length) {\n\t\t\t\tbuffer.push(`Private room auth: ${innerBuffer.join(', ')}`);\n\t\t\t}\n\t\t}\n\t\tif (!buffer.length) {\n\t\t\tbuffer.push(\"No global or room auth.\");\n\t\t}\n\n\t\tbuffer.unshift(`${targetUsername} user auth:`);\n\t\tconnection.popup(buffer.join(\"\\n\\n\"));\n\t},\n\tuserauthhelp: [\n\t\t`/userauth [username] - Shows all authority visible to the user for the given [username].`,\n\t\t`If no username is given, it defaults to the current user.`,\n\t],\n\n\tsectionleaders(target, room, user, connection) {\n\t\tconst usernames = Users.globalAuth.usernames;\n\t\tconst buffer = [];\n\t\tconst sections: {[k in RoomSection]: Set} = Object.create(null);\n\t\tfor (const [id, username] of usernames) {\n\t\t\tconst sectionid = Users.globalAuth.sectionLeaders.get(id);\n\t\t\tif (!sectionid) continue;\n\t\t\tif (!sections[sectionid]) sections[sectionid] = new Set();\n\t\t\tsections[sectionid].add(username);\n\t\t}\n\t\tlet sectionid: RoomSection;\n\t\tfor (sectionid in sections) {\n\t\t\tif (!sections[sectionid].size) continue;\n\t\t\tbuffer.push(`**${RoomSections.sectionNames[sectionid]}**:\\n` + Utils.sortBy([...sections[sectionid]]).join(', '));\n\t\t}\n\t\tif (!buffer.length) throw new Chat.ErrorMessage(`There are no Section Leaders currently.`);\n\t\tconnection.popup(buffer.join(`\\n\\n`));\n\t},\n\tsectionleadershelp: [\n\t\t`/sectionleaders - Shows the current room sections and their section leaders.`,\n\t],\n\n\tasync autojoin(target, room, user, connection) {\n\t\tconst targets = target.split(',').filter(Boolean);\n\t\tif (targets.length > 16 || connection.inRooms.size > 1) {\n\t\t\treturn connection.popup(\"To prevent DoS attacks, you can only use /autojoin for 16 or fewer rooms, when you haven't joined any rooms yet. Please use /join for each room separately.\");\n\t\t}\n\t\tRooms.global.autojoinRooms(user, connection);\n\t\tconst autojoins: string[] = [];\n\n\t\tconst promises = targets.map(\n\t\t\troomid => user.tryJoinRoom(roomid as RoomID, connection).then(ret => {\n\t\t\t\tif (ret === Rooms.RETRY_AFTER_LOGIN) {\n\t\t\t\t\tautojoins.push(roomid);\n\t\t\t\t}\n\t\t\t})\n\t\t);\n\n\t\tawait Promise.all(promises);\n\t\tconnection.autojoins = autojoins.join(',');\n\t},\n\tautojoinhelp: [`/autojoin [rooms] - Automatically joins all the given rooms.`],\n\n\tjoim: 'join',\n\tj: 'join',\n\tasync join(target, room, user, connection) {\n\t\ttarget = target.trim();\n\t\tif (!target) return this.parse('/help join');\n\t\tif (target.startsWith('http://')) target = target.slice(7);\n\t\tif (target.startsWith('https://')) target = target.slice(8);\n\t\tif (target.startsWith(`${Config.routes.client}/`)) target = target.slice(Config.routes.client.length + 1);\n\t\tif (target.startsWith(`${Config.routes.replays}/`)) target = `battle-${target.slice(Config.routes.replays.length + 1)}`;\n\t\tif (target.startsWith('psim.us/')) target = target.slice(8);\n\t\t// isn't in tryJoinRoom so you can still join your own battles / gameRooms etc\n\t\tconst numRooms = [...Rooms.rooms.values()].filter(r => user.id in r.users).length;\n\t\tif (!user.can('altsself') && !target.startsWith('view-') && numRooms >= 50) {\n\t\t\treturn connection.sendTo(target as RoomID, `|noinit||You can only join 50 rooms at a time.`);\n\t\t}\n\t\tconst ret = await user.tryJoinRoom(target as RoomID, connection);\n\t\tif (ret === Rooms.RETRY_AFTER_LOGIN) {\n\t\t\tconnection.sendTo(\n\t\t\t\ttarget as RoomID,\n\t\t\t\t`|noinit|namerequired|The room '${target}' does not exist or requires a login to join.`\n\t\t\t);\n\t\t}\n\t},\n\tjoinhelp: [`/join [roomname] - Attempt to join the room [roomname].`],\n\n\tleave: 'part',\n\tpart(target, room, user, connection) {\n\t\tconst targetRoom = target ? Rooms.search(target) : room;\n\t\tif (!targetRoom) {\n\t\t\tif (target.startsWith('view-')) {\n\t\t\t\tconnection.openPages?.delete(target.slice(5));\n\t\t\t\tif (!connection.openPages?.size) connection.openPages = null;\n\t\t\t\tChat.handleRoomClose(target as RoomID, user, connection);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn this.errorReply(`The room '${target}' does not exist.`);\n\t\t}\n\t\tChat.handleRoomClose(targetRoom.roomid, user, connection);\n\t\tuser.leaveRoom(targetRoom, connection);\n\t},\n\tleavehelp: [`/leave - Leave the current room, or a given room.`],\n\n\t/*********************************************************\n\t * Moderating: Punishments\n\t *********************************************************/\n\n\tkick: 'warn',\n\tk: 'warn',\n\twarn(target, room, user) {\n\t\tif (!target) return this.parse('/help warn');\n\t\tthis.checkChat();\n\t\tif (room?.settings.isPersonal && !user.can('warn' as any)) {\n\t\t\treturn this.errorReply(\"Warning is unavailable in group chats.\");\n\t\t}\n\t\t// If used in pms, staff, help tickets or battles, log the warn to the global modlog.\n\t\tconst globalWarn = (\n\t\t\t!room || ['staff', 'adminlog'].includes(room.roomid) ||\n\t\t\troom.roomid.startsWith('help-') || (room.battle && (!room.parent || room.parent.type !== 'chat'))\n\t\t);\n\n\t\tconst {targetUser, inputUsername, targetUsername, rest: reason} = this.splitUser(target);\n\t\tconst targetID = toID(targetUsername);\n\t\tconst {privateReason, publicReason} = this.parseSpoiler(reason);\n\n\t\tconst saveReplay = globalWarn && room?.battle;\n\t\tif (!targetUser?.connected) {\n\t\t\tif (!globalWarn) return this.errorReply(`User '${targetUsername}' not found.`);\n\t\t\tif (room) {\n\t\t\t\tthis.checkCan('warn', null, room);\n\t\t\t} else {\n\t\t\t\tthis.checkCan('lock');\n\t\t\t}\n\n\t\t\tthis.addGlobalModAction(\n\t\t\t\t`${targetID} was warned by ${user.name} while offline.${publicReason ? ` (${publicReason})` : ``}`\n\t\t\t);\n\t\t\tthis.globalModlog('WARN OFFLINE', targetUser || targetID, privateReason);\n\t\t\tPunishments.offlineWarns.set(targetID, publicReason);\n\t\t\tif (saveReplay) this.parse('/savereplay forpunishment');\n\t\t\treturn;\n\t\t}\n\t\tif (!globalWarn && !(targetUser.id in room.users)) {\n\t\t\treturn this.errorReply(`User ${targetUsername} is not in the room ${room.roomid}.`);\n\t\t}\n\t\tif (publicReason.length > MAX_REASON_LENGTH) {\n\t\t\treturn this.errorReply(`The reason is too long. It cannot exceed ${MAX_REASON_LENGTH} characters.`);\n\t\t}\n\t\tif (room) {\n\t\t\tthis.checkCan('warn', targetUser, room);\n\t\t} else {\n\t\t\tthis.checkCan('lock', targetUser);\n\t\t}\n\t\tif (targetUser.can('makeroom')) return this.errorReply(\"You are not allowed to warn upper staff members.\");\n\n\t\tconst now = Date.now();\n\t\tconst timeout = now - targetUser.lastWarnedAt;\n\t\tif (timeout < 15 * 1000) {\n\t\t\tconst remainder = (15 - (timeout / 1000)).toFixed(2);\n\t\t\treturn this.errorReply(`You must wait ${remainder} more seconds before you can warn ${targetUser.name} again.`);\n\t\t}\n\n\t\tconst logMessage = `${targetUser.name} was warned by ${user.name}.${(publicReason ? ` (${publicReason})` : ``)}`;\n\t\tif (globalWarn) {\n\t\t\tthis.addGlobalModAction(logMessage);\n\t\t\tthis.globalModlog('WARN', targetUser, privateReason);\n\t\t} else {\n\t\t\tthis.addModAction(logMessage);\n\t\t\tthis.modlog('WARN', targetUser, privateReason, {noalts: 1});\n\t\t}\n\t\ttargetUser.send(`|c|~|/warn ${publicReason}`);\n\n\t\tconst userid = targetUser.getLastId();\n\n\t\tif (room) {\n\t\t\tthis.add(`|hidelines|unlink|${userid}`);\n\t\t\tif (userid !== toID(inputUsername)) this.add(`|hidelines|unlink|${toID(inputUsername)}`);\n\t\t}\n\n\t\ttargetUser.lastWarnedAt = now;\n\n\t\t// Automatically upload replays as evidence/reference to the punishment\n\t\tif (saveReplay) this.parse('/savereplay forpunishment');\n\t\treturn true;\n\t},\n\twarnhelp: [\n\t\t`/warn OR /k [username], [reason] - Warns a user showing them the site rules and [reason] in an overlay.`,\n\t\t`/warn OR /k [username], [reason] spoiler: [private reason] - Warns a user, marking [private reason] only in the modlog.`,\n\t\t`Requires: % @ # &`,\n\t],\n\n\tredirect: 'redir',\n\tredir(target, room, user, connection) {\n\t\troom = this.requireRoom();\n\t\tif (!target) return this.parse('/help redirect');\n\t\tif (room.settings.isPrivate || room.settings.isPersonal) {\n\t\t\treturn this.errorReply(\"Users cannot be redirected from private or personal rooms.\");\n\t\t}\n\t\tconst {targetUser, targetUsername, rest: targetRoomid} = this.splitUser(target);\n\t\tconst targetRoom = Rooms.search(targetRoomid);\n\t\tif (!targetRoom || targetRoom.settings.modjoin || targetRoom.settings.staffRoom) {\n\t\t\treturn this.errorReply(`The room \"${targetRoomid}\" does not exist.`);\n\t\t}\n\t\tthis.checkCan('warn', targetUser, room);\n\t\tthis.checkCan('warn', targetUser, targetRoom);\n\n\t\tif (!user.can('rangeban', targetUser)) {\n\t\t\tthis.errorReply(`Redirects have been deprecated. Instead of /redirect, use <> or /invite to guide users to the correct room, and punish if users don't cooperate.`);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!targetUser?.connected) {\n\t\t\treturn this.errorReply(`User ${targetUsername} not found.`);\n\t\t}\n\t\tif (targetRoom.roomid === \"global\") return this.errorReply(`Users cannot be redirected to the global room.`);\n\t\tif (targetRoom.settings.isPrivate || targetRoom.settings.isPersonal) {\n\t\t\treturn this.errorReply(`The room \"${targetRoom.title}\" is not public.`);\n\t\t}\n\t\tif (targetUser.inRooms.has(targetRoom.roomid)) {\n\t\t\treturn this.errorReply(`User ${targetUser.name} is already in the room ${targetRoom.title}!`);\n\t\t}\n\t\tif (!targetUser.inRooms.has(room.roomid)) {\n\t\t\treturn this.errorReply(`User ${targetUsername} is not in the room ${room.roomid}.`);\n\t\t}\n\t\ttargetUser.leaveRoom(room.roomid);\n\t\ttargetUser.popup(`You are in the wrong room; please go to <<${targetRoom.roomid}>> instead`);\n\t\tthis.addModAction(`${targetUser.name} was redirected to room ${targetRoom.title} by ${user.name}.`);\n\t\tthis.modlog('REDIRECT', targetUser, `to ${targetRoom.title}`, {noip: 1, noalts: 1});\n\t\ttargetUser.leaveRoom(room);\n\t},\n\tredirhelp: [\n\t\t`/redirect OR /redir [username], [roomname] - [DEPRECATED]`,\n\t\t`Attempts to redirect the [username] to the [roomname]. Requires: &`,\n\t],\n\n\tm: 'mute',\n\tmute(target, room, user, connection, cmd) {\n\t\troom = this.requireRoom();\n\t\tif (!target) return this.parse('/help mute');\n\t\tthis.checkChat();\n\n\t\tconst {targetUser, inputUsername, targetUsername, rest: reason} = this.splitUser(target);\n\t\tif (!targetUser) return this.errorReply(`User '${targetUsername}' not found.`);\n\t\tif (reason.length > MAX_REASON_LENGTH) {\n\t\t\treturn this.errorReply(`The reason is too long. It cannot exceed ${MAX_REASON_LENGTH} characters.`);\n\t\t}\n\t\tconst {publicReason, privateReason} = this.parseSpoiler(reason);\n\n\t\tconst muteDuration = ((cmd === 'hm' || cmd === 'hourmute') ? HOURMUTE_LENGTH : MUTE_LENGTH);\n\t\tthis.checkCan('mute', targetUser, room);\n\t\tif (targetUser.can('makeroom')) return this.errorReply(\"You are not allowed to mute upper staff members.\");\n\t\tconst canBeMutedFurther = ((room.getMuteTime(targetUser) || 0) <= (muteDuration * 5 / 6));\n\t\tif (targetUser.locked ||\n\t\t\t(room.isMuted(targetUser) && !canBeMutedFurther) ||\n\t\t\tPunishments.isRoomBanned(targetUser, room.roomid)) {\n\t\t\tconst alreadyPunishment = targetUser.locked ? \"locked\" : room.isMuted(targetUser) ? \"muted\" : \"room banned\";\n\t\t\tconst problem = ` but was already ${alreadyPunishment}`;\n\t\t\tif (!reason) {\n\t\t\t\treturn this.privateModAction(`${targetUser.name} would be muted by ${user.name} ${problem}.`);\n\t\t\t}\n\t\t\treturn this.addModAction(`${targetUser.name} would be muted by ${user.name} ${problem}. (${publicReason})`);\n\t\t}\n\n\t\tif (targetUser.id in room.users) {\n\t\t\ttargetUser.popup(`|modal|${user.name} has muted you in ${room.roomid} for ${Chat.toDurationString(muteDuration)}. ${publicReason}`);\n\t\t}\n\t\tthis.addModAction(`${targetUser.name} was muted by ${user.name} for ${Chat.toDurationString(muteDuration)}.${(publicReason ? ` (${publicReason})` : ``)}`);\n\t\tthis.modlog(`${cmd.includes('h') ? 'HOUR' : ''}MUTE`, targetUser, privateReason);\n\t\tif (targetUser.autoconfirmed && targetUser.autoconfirmed !== targetUser.id) {\n\t\t\tconst displayMessage = `${targetUser.name}'s ac account: ${targetUser.autoconfirmed}`;\n\t\t\tthis.privateModAction(displayMessage);\n\t\t}\n\t\tconst userid = targetUser.getLastId();\n\t\tthis.add(`|hidelines|unlink|${userid}`);\n\t\tif (userid !== toID(inputUsername)) this.add(`|hidelines|unlink|${toID(inputUsername)}`);\n\n\t\troom.mute(targetUser, muteDuration);\n\t},\n\tmutehelp: [`/mute OR /m [username], [reason] - Mutes a user with reason for 7 minutes. Requires: % @ # &`],\n\n\thm: 'hourmute',\n\thourmute(target) {\n\t\tif (!target) return this.parse('/help hourmute');\n\t\tthis.run('mute');\n\t},\n\thourmutehelp: [`/hourmute OR /hm [username], [reason] - Mutes a user with reason for an hour. Requires: % @ # &`],\n\n\tum: 'unmute',\n\tunmute(target, room, user) {\n\t\troom = this.requireRoom();\n\t\tif (!target) return this.parse('/help unmute');\n\t\tconst {targetUser, targetUsername, rest} = this.splitUser(target);\n\t\tif (rest) return this.errorReply(`This command does not support specifying a reason.`);\n\t\tthis.checkChat();\n\t\tthis.checkCan('mute', null, room);\n\n\t\tconst successfullyUnmuted = room.unmute(\n\t\t\ttargetUser?.id || toID(targetUsername), `Your mute in '${room.title}' has been lifted.`\n\t\t);\n\n\t\tif (successfullyUnmuted) {\n\t\t\tthis.addModAction(`${(targetUser ? targetUser.name : successfullyUnmuted)} was unmuted by ${user.name}.`);\n\t\t\tthis.modlog('UNMUTE', (targetUser || successfullyUnmuted), null, {noip: 1, noalts: 1});\n\t\t} else {\n\t\t\tthis.errorReply(`${(targetUser ? targetUser.name : targetUsername)} is not muted.`);\n\t\t}\n\t},\n\tunmutehelp: [`/unmute [username] - Removes mute from user. Requires: % @ # &`],\n\n\trb: 'ban',\n\tweekban: 'ban',\n\twb: 'ban',\n\twrb: 'ban',\n\tforceroomban: 'ban',\n\tforceweekban: 'ban',\n\tweekroomban: 'ban',\n\tforcerb: 'ban',\n\troomban: 'ban',\n\tb: 'ban',\n\tban(target, room, user, connection, cmd) {\n\t\troom = this.requireRoom();\n\t\tif (!target) return this.parse('/help ban');\n\t\tthis.checkChat();\n\t\tconst week = ['wrb', 'wb'].includes(cmd) || cmd.includes('week');\n\n\t\tconst {targetUser, inputUsername, targetUsername, rest: reason} = this.splitUser(target);\n\t\tconst {publicReason, privateReason} = this.parseSpoiler(reason);\n\t\tif (!targetUser) return this.errorReply(`User '${targetUsername}' not found.`);\n\t\tif (reason.length > MAX_REASON_LENGTH) {\n\t\t\treturn this.errorReply(`The reason is too long. It cannot exceed ${MAX_REASON_LENGTH} characters.`);\n\t\t}\n\t\tthis.checkCan('ban', targetUser, room);\n\t\tif (targetUser.can('makeroom')) return this.errorReply(\"You are not allowed to ban upper staff members.\");\n\t\tif (Punishments.hasRoomPunishType(room, toID(targetUsername), 'BLACKLIST')) {\n\t\t\treturn this.errorReply(`This user is already blacklisted from ${room.roomid}.`);\n\t\t}\n\t\tconst name = targetUser.getLastName();\n\t\tconst userid = targetUser.getLastId();\n\t\tconst force = cmd.startsWith('force');\n\t\tif (targetUser.trusted) {\n\t\t\tif (!force) {\n\t\t\t\treturn this.sendReply(\n\t\t\t\t\t`${name} is a trusted user. If you are sure you would like to ban them, use /force${week ? 'week' : 'room'}ban.`\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (force) {\n\t\t\treturn this.errorReply(`Use /${week ? 'week' : 'room'}ban; ${name} is not a trusted user.`);\n\t\t}\n\t\tif (!reason && !week && Punishments.isRoomBanned(targetUser, room.roomid)) {\n\t\t\tconst problem = \" but was already banned\";\n\t\t\treturn this.privateModAction(`${name} would be banned by ${user.name} ${problem}.`);\n\t\t}\n\n\t\tif (targetUser.trusted && room.settings.isPrivate !== true && !room.settings.isPersonal) {\n\t\t\tMonitor.log(`[CrisisMonitor] Trusted user ${targetUser.name} ${(targetUser.trusted !== targetUser.id ? ` (${targetUser.trusted})` : ``)} was roombanned from ${room.roomid} by ${user.name}, and should probably be demoted.`);\n\t\t}\n\n\t\tif (targetUser.id in room.users || user.can('lock')) {\n\t\t\ttargetUser.popup(\n\t\t\t\t`|modal||html|

${Utils.escapeHTML(user.name)} has banned you from the room ${room.roomid} ` +\n\t\t\t\t`${(room.subRooms ? ` and its subrooms` : ``)}${week ? ' for a week' : ''}.` +\n\t\t\t\t`

${(publicReason ? `

Reason: ${Utils.escapeHTML(publicReason)}

` : ``)}` +\n\t\t\t\t`

To appeal the ban, PM the staff member that banned you${room.persist ? ` or a room owner. ` +\n\t\t\t\t`

` : `.

`}`\n\t\t\t);\n\t\t}\n\n\t\tthis.addModAction(`${name} was banned${week ? ' for a week' : ''} from ${room.title} by ${user.name}.${publicReason ? ` (${publicReason})` : ``}`);\n\n\t\tconst time = week ? Date.now() + 7 * 24 * 60 * 60 * 1000 : null;\n\t\tconst affected = Punishments.roomBan(room, targetUser, time, null, privateReason);\n\n\t\tif (!room.settings.isPrivate && room.persist) {\n\t\t\tconst acAccount = (targetUser.autoconfirmed !== userid && targetUser.autoconfirmed);\n\t\t\tlet displayMessage = '';\n\t\t\tif (affected.length > 1) {\n\t\t\t\tdisplayMessage = `${name}'s ${(acAccount ? ` ac account: ${acAccount}, ` : ``)} banned alts: ${affected.slice(1).map(curUser => curUser.getLastName()).join(\", \")}`;\n\t\t\t\tthis.privateModAction(displayMessage);\n\t\t\t} else if (acAccount) {\n\t\t\t\tdisplayMessage = `${name}'s ac account: ${acAccount}`;\n\t\t\t\tthis.privateModAction(displayMessage);\n\t\t\t}\n\t\t}\n\t\troom.hideText([\n\t\t\t...affected.map(u => u.id),\n\t\t\ttoID(inputUsername),\n\t\t]);\n\n\t\tif (room.settings.isPrivate !== true && room.persist) {\n\t\t\tthis.globalModlog(`${week ? 'WEEK' : ''}ROOMBAN`, targetUser, privateReason);\n\t\t} else {\n\t\t\tthis.modlog(`${week ? 'WEEK' : ''}ROOMBAN`, targetUser, privateReason);\n\t\t}\n\t\treturn true;\n\t},\n\tbanhelp: [\n\t\t`/ban [username], [reason] - Bans the user from the room you are in. Requires: @ # &`,\n\t\t`/weekban [username], [reason] - Bans the user from the room you are in for a week. Requires: @ # &`,\n\t],\n\n\tunroomban: 'unban',\n\troomunban: 'unban',\n\tunban(target, room, user, connection) {\n\t\troom = this.requireRoom();\n\t\tif (!target) return this.parse('/help unban');\n\t\tthis.checkCan('ban', null, room);\n\n\t\tconst name = Punishments.roomUnban(room, target);\n\n\t\tif (name) {\n\t\t\tthis.addModAction(`${name} was unbanned from ${room.title} by ${user.name}.`);\n\t\t\tif (room.settings.isPrivate !== true && room.persist) {\n\t\t\t\tthis.globalModlog(\"UNROOMBAN\", name);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.errorReply(`User '${target}' is not banned from this room.`);\n\t\t}\n\t},\n\tunbanhelp: [`/unban [username] - Unbans the user from the room you are in. Requires: @ # &`],\n\n\tforcelock: 'lock',\n\tforceweeklock: 'lock',\n\tforcemonthlock: 'lock',\n\tl: 'lock',\n\tipmute: 'lock',\n\twl: 'lock',\n\tweeklock: 'lock',\n\tmonthlock: 'lock',\n\tasync lock(target, room, user, connection, cmd) {\n\t\tconst week = cmd === 'wl' || cmd.includes('week');\n\t\tconst month = cmd.includes('month');\n\t\tconst force = cmd.includes('force');\n\n\t\tif (!target) {\n\t\t\tif (week) return this.parse('/help weeklock');\n\t\t\treturn this.parse('/help lock');\n\t\t}\n\n\t\tconst {targetUser, inputUsername, targetUsername, rest: reason} = this.splitUser(target);\n\t\tlet userid: ID = toID(targetUsername);\n\n\t\tif (!targetUser && !Punishments.search(userid).length && !force) {\n\t\t\treturn this.errorReply(\n\t\t\t\t`User '${targetUsername}' not found. Use \\`\\`/force${month ? 'month' : (week ? 'week' : '')}lock\\`\\` if you need to to lock them anyway.`\n\t\t\t);\n\t\t}\n\t\tif (reason.length > MAX_REASON_LENGTH) {\n\t\t\treturn this.errorReply(`The reason is too long. It cannot exceed ${MAX_REASON_LENGTH} characters.`);\n\t\t}\n\t\tthis.checkCan('lock', userid);\n\t\tif (month) this.checkCan('rangeban');\n\n\t\tlet name;\n\n\t\tif (targetUser) {\n\t\t\tname = targetUser.getLastName();\n\t\t\tuserid = targetUser.getLastId();\n\n\t\t\tif (targetUser.locked && !targetUser.locked.startsWith('#') && !week && !month) {\n\t\t\t\treturn this.privateModAction(`${name} would be locked by ${user.name} but was already locked.`);\n\t\t\t}\n\t\t} else {\n\t\t\tname = targetUsername;\n\t\t\tuserid = toID(targetUsername);\n\t\t}\n\n\t\tif (Users.isTrusted(userid)) {\n\t\t\tif (force) {\n\t\t\t\tconst from = runCrisisDemote(userid);\n\t\t\t\tMonitor.log(`[CrisisMonitor] ${name} was locked by ${user.name} and demoted from ${from.join(\", \")}.`);\n\t\t\t\tthis.globalModlog(\"CRISISDEMOTE\", targetUser, ` from ${from.join(\", \")}`);\n\t\t\t} else {\n\t\t\t\treturn this.sendReply(`${name} is a trusted user. If you are sure you would like to lock them use /force${month ? 'month' : (week ? 'week' : '')}lock.`);\n\t\t\t}\n\t\t} else if (force && targetUser) {\n\t\t\treturn this.errorReply(`Use /lock; ${name} is not a trusted user and is online.`);\n\t\t}\n\n\t\tconst {privateReason, publicReason} = this.parseSpoiler(reason);\n\n\n\t\t// Use default time for locks.\n\t\tconst duration = week ? Date.now() + 7 * 24 * 60 * 60 * 1000 : (month ? Date.now() + 30 * 24 * 60 * 60 * 1000 : null);\n\t\tlet affected = [];\n\n\t\tif (targetUser) {\n\t\t\tconst ignoreAlts = Punishments.isSharedIp(targetUser.latestIp);\n\t\t\taffected = await Punishments.lock(targetUser, duration, null, ignoreAlts, publicReason);\n\t\t} else {\n\t\t\taffected = await Punishments.lock(userid, duration, null, false, publicReason);\n\t\t}\n\n\t\tthis.globalModlog(\n\t\t\t(force ? `FORCE` : ``) + (week ? \"WEEKLOCK\" : (month ? \"MONTHLOCK\" : \"LOCK\")), targetUser || userid, privateReason\n\t\t);\n\n\t\tconst durationMsg = week ? ' for a week' : (month ? ' for a month' : '');\n\t\tthis.addGlobalModAction(`${name} was locked from talking${durationMsg} by ${user.name}.` + (publicReason ? ` (${publicReason})` : \"\"));\n\n\t\tif (room && !room.settings.isHelp) {\n\t\t\troom.hideText([\n\t\t\t\t...affected.map(u => u.id),\n\t\t\t\ttoID(inputUsername),\n\t\t\t]);\n\t\t}\n\n\t\tconst acAccount = (targetUser && targetUser.autoconfirmed !== userid && targetUser.autoconfirmed);\n\t\tlet displayMessage = '';\n\t\tif (affected.length > 1) {\n\t\t\tdisplayMessage = `${name}'s ${(acAccount ? ` ac account: ${acAccount}, ` : \"\")} locked alts: ${affected.slice(1).map((curUser: User) => curUser.getLastName()).join(\", \")}`;\n\t\t\tthis.privateModAction(displayMessage);\n\t\t} else if (acAccount) {\n\t\t\tdisplayMessage = `${name}'s ac account: ${acAccount}`;\n\t\t\tthis.privateModAction(displayMessage);\n\t\t}\n\n\t\tif (targetUser) {\n\t\t\tlet message = `|popup||html|${user.name} has locked you from talking in chats, battles, and PMing regular users${durationMsg}`;\n\t\t\tif (publicReason) message += `\\n\\nReason: ${publicReason}`;\n\n\t\t\tlet appeal = '';\n\t\t\tif (Chat.pages.help) {\n\t\t\t\tappeal += ``;\n\t\t\t} else if (Config.appealurl) {\n\t\t\t\tappeal += `appeal: ${Config.appealurl}`;\n\t\t\t}\n\n\t\t\tif (appeal) message += `\\n\\nIf you feel that your lock was unjustified, you can ${appeal}.`;\n\t\t\tmessage += `\\n\\nYour lock will expire in a few days.`;\n\t\t\ttargetUser.send(message);\n\n\t\t\tconst roomauth = Rooms.global.destroyPersonalRooms(userid);\n\t\t\tif (roomauth.length) {\n\t\t\t\tMonitor.log(`[CrisisMonitor] Locked user ${name} has public roomauth (${roomauth.join(', ')}), and should probably be demoted.`);\n\t\t\t}\n\t\t}\n\n\t\t// Automatically upload replays as evidence/reference to the punishment\n\t\tif (room?.battle) this.parse('/savereplay forpunishment');\n\t\treturn true;\n\t},\n\tlockhelp: [\n\t\t`/lock OR /l [username], [reason] - Locks the user from talking in all chats. Requires: % @ &`,\n\t\t`/weeklock OR /wl [username], [reason] - Same as /lock, but locks users for a week.`,\n\t\t`/lock OR /l [username], [reason] spoiler: [private reason] - Marks [private reason] in modlog only.`,\n\t],\n\n\tunlock(target, room, user) {\n\t\tif (!target) return this.parse('/help unlock');\n\t\tthis.checkCan('lock');\n\n\t\tconst targetUser = Users.get(target);\n\t\tif (targetUser?.namelocked) {\n\t\t\treturn this.errorReply(`User ${targetUser.name} is namelocked, not locked. Use /unnamelock to unnamelock them.`);\n\t\t}\n\t\tlet reason = '';\n\t\tif (targetUser?.locked && targetUser.locked.startsWith('#')) {\n\t\t\treason = ` (${targetUser.locked})`;\n\t\t}\n\n\t\tconst unlocked = Punishments.unlock(target);\n\n\t\tif (unlocked) {\n\t\t\tthis.addGlobalModAction(`${unlocked.join(\", \")} ${((unlocked.length > 1) ? \"were\" : \"was\")} unlocked by ${user.name}.${reason}`);\n\t\t\tif (!reason) this.globalModlog(\"UNLOCK\", toID(target));\n\t\t\tif (targetUser) targetUser.popup(`${user.name} has unlocked you.`);\n\t\t} else {\n\t\t\tthis.errorReply(`User '${target}' is not locked.`);\n\t\t}\n\t},\n\tunlockname(target, room, user) {\n\t\tif (!target) return this.parse('/help unlock');\n\t\tthis.checkCan('lock');\n\n\t\tconst userid = toID(target);\n\t\tif (userid.startsWith('guest')) {\n\t\t\treturn this.errorReply(`You cannot unlock the guest userid - provide their original username instead.`);\n\t\t}\n\t\tconst punishment = Punishments.userids.getByType(userid, 'LOCK') || Punishments.userids.getByType(userid, 'NAMELOCK');\n\t\tif (!punishment) return this.errorReply(\"This name isn't locked.\");\n\t\tif (punishment.id === userid || Users.get(userid)?.previousIDs.includes(punishment.id as ID)) {\n\t\t\treturn this.errorReply(`\"${userid}\" was specifically locked by a staff member (check the global modlog). Use /unlock if you really want to unlock this name.`);\n\t\t}\n\t\tPunishments.userids.delete(userid);\n\t\tPunishments.savePunishments();\n\n\t\tfor (const curUser of Users.findUsers([userid], [])) {\n\t\t\tconst locked = Punishments.hasPunishType(curUser.id, ['LOCK', 'NAMELOCK'], curUser.latestIp);\n\t\t\tif (curUser.locked && !curUser.locked.startsWith('#') && !locked) {\n\t\t\t\tcurUser.locked = null;\n\t\t\t\tcurUser.namelocked = null;\n\t\t\t\tcurUser.destroyPunishmentTimer();\n\t\t\t\tcurUser.updateIdentity();\n\t\t\t}\n\t\t}\n\n\t\tthis.addGlobalModAction(`The name '${target}' was unlocked by ${user.name}.`);\n\t\tthis.globalModlog(\"UNLOCKNAME\", userid);\n\t},\n\tunrangelock: 'unlockip',\n\trangeunlock: 'unlockip',\n\tunlockip(target, room, user) {\n\t\ttarget = target.trim();\n\t\tif (!target) return this.parse('/help unlock');\n\t\tthis.checkCan('globalban');\n\t\tconst range = target.endsWith('*');\n\t\tif (range) this.checkCan('rangeban');\n\n\t\tif (!(range ? IPTools.ipRangeRegex : IPTools.ipRegex).test(target)) {\n\t\t\treturn this.errorReply(\"Please enter a valid IP address.\");\n\t\t}\n\n\t\tconst punishment = Punishments.ips.get(target);\n\t\tif (!punishment) return this.errorReply(`${target} is not a locked/banned IP or IP range.`);\n\n\t\tPunishments.ips.delete(target);\n\t\tPunishments.savePunishments();\n\n\t\tfor (const curUser of Users.findUsers([], [target])) {\n\t\t\tif (\n\t\t\t\t(range ? curUser.locked === '#rangelock' : !curUser.locked?.startsWith('#')) &&\n\t\t\t\t!Punishments.getPunishType(curUser.id)\n\t\t\t) {\n\t\t\t\tcurUser.locked = null;\n\t\t\t\tif (curUser.namelocked) {\n\t\t\t\t\tcurUser.namelocked = null;\n\t\t\t\t\tcurUser.resetName();\n\t\t\t\t}\n\t\t\t\tcurUser.destroyPunishmentTimer();\n\t\t\t\tcurUser.updateIdentity();\n\t\t\t}\n\t\t}\n\n\t\tthis.privateGlobalModAction(`${user.name} unlocked the ${range ? \"IP range\" : \"IP\"}: ${target}`);\n\t\tthis.globalModlog(`UNLOCK${range ? 'RANGE' : 'IP'}`, null, null, target);\n\t},\n\tunlockiphelp: [`/unlockip [ip] - Unlocks a punished ip while leaving the original punishment intact. Requires: @ &`],\n\tunlocknamehelp: [`/unlockname [name] - Unlocks a punished alt, leaving the original lock intact. Requires: % @ &`],\n\tunlockhelp: [\n\t\t`/unlock [username] - Unlocks the user. Requires: % @ &`,\n\t\t`/unlockname [username] - Unlocks a punished alt while leaving the original punishment intact. Requires: % @ &`,\n\t\t`/unlockip [ip] - Unlocks a punished ip while leaving the original punishment intact. Requires: @ &`,\n\t],\n\n\tforceglobalban: 'globalban',\n\tgban: 'globalban',\n\tasync globalban(target, room, user, connection, cmd) {\n\t\tif (!target) return this.parse('/help globalban');\n\t\tconst force = cmd.includes('force');\n\n\t\tconst {targetUser, inputUsername, targetUsername, rest: reason} = this.splitUser(target);\n\t\tlet userid: ID = toID(targetUsername);\n\n\t\tif (!targetUser && !force) {\n\t\t\treturn this.errorReply(`User '${targetUsername}' not found. Use /forceglobalban to ban them anyway.`);\n\t\t}\n\t\tif (reason.length > MAX_REASON_LENGTH) {\n\t\t\treturn this.errorReply(`The reason is too long. It cannot exceed ${MAX_REASON_LENGTH} characters.`);\n\t\t}\n\t\tif (!reason && REQUIRE_REASONS) {\n\t\t\treturn this.errorReply(\"Global bans require a reason.\");\n\t\t}\n\t\tthis.checkCan('globalban', targetUser);\n\t\tlet name;\n\n\t\tif (targetUser) {\n\t\t\tname = targetUser.getLastName();\n\t\t\tuserid = targetUser.getLastId();\n\t\t} else {\n\t\t\tname = targetUsername;\n\t\t}\n\n\t\tif (Users.isTrusted(userid)) {\n\t\t\tif (force) {\n\t\t\t\tconst from = runCrisisDemote(userid);\n\t\t\t\tMonitor.log(`[CrisisMonitor] ${name} was globally banned by ${user.name} and demoted from ${from?.join(\", \")}.`);\n\t\t\t\tthis.globalModlog(\"CRISISDEMOTE\", targetUser, ` from ${from?.join(\", \")}`);\n\t\t\t} else {\n\t\t\t\treturn this.sendReply(`${name} is a trusted user. If you are sure you would like to ban them use /forceglobalban.`);\n\t\t\t}\n\t\t}\n\n\t\tconst roomauth = Rooms.global.destroyPersonalRooms(userid);\n\t\tif (roomauth.length) {\n\t\t\tMonitor.log(`[CrisisMonitor] Globally banned user ${name} has public roomauth (${roomauth.join(', ')}), and should probably be demoted.`);\n\t\t}\n\t\tconst {privateReason, publicReason} = this.parseSpoiler(reason);\n\t\ttargetUser?.popup(\n\t\t\t`|modal|${user.name} has globally banned you.${(publicReason ? `\\n\\nReason: ${publicReason}` : ``)} ` +\n\t\t\t`${(Config.appealurl ? `\\n\\nIf you feel that your ban was unjustified, you can appeal:\\n${Config.appealurl}` : ``)}` +\n\t\t\t`\\n\\nYour ban will expire in a few days.`\n\t\t);\n\n\t\tthis.addGlobalModAction(`${name} was globally banned by ${user.name}.${(publicReason ? ` (${publicReason})` : ``)}`);\n\n\t\tconst affected = await Punishments.ban(userid, null, null, false, publicReason);\n\t\tconst acAccount = (targetUser && targetUser.autoconfirmed !== userid && targetUser.autoconfirmed);\n\t\tlet displayMessage = '';\n\t\tif (affected.length > 1) {\n\t\t\tlet guests = affected.length - 1;\n\t\t\tconst affectedAlts = affected.slice(1)\n\t\t\t\t.map(curUser => curUser.getLastName())\n\t\t\t\t.filter(alt => !alt.startsWith('[Guest '));\n\t\t\tguests -= affectedAlts.length;\n\t\t\tdisplayMessage = `${name}'s ${(acAccount ? `ac account: ${acAccount}, ` : ``)} banned alts: ${affectedAlts.join(\", \")} ${(guests ? ` [${guests} guests]` : ``)}`;\n\t\t\tthis.privateModAction(displayMessage);\n\t\t\tfor (const id of affectedAlts) {\n\t\t\t\tthis.add(`|hidelines|unlink|${toID(id)}`);\n\t\t\t}\n\t\t} else if (acAccount) {\n\t\t\tdisplayMessage = `${name}'s ac account: ${acAccount}`;\n\t\t\tthis.privateModAction(displayMessage);\n\t\t}\n\n\t\troom?.hideText([\n\t\t\t...affected.map(u => u.id),\n\t\t\ttoID(inputUsername),\n\t\t]);\n\n\t\tthis.globalModlog(`${force ? `FORCE` : ''}BAN`, targetUser, privateReason);\n\t\treturn true;\n\t},\n\tglobalbanhelp: [\n\t\t`/globalban OR /gban [username], [reason] - Kick user from all rooms and ban user's IP address with reason. Requires: @ &`,\n\t\t`/globalban OR /gban [username], [reason] spoiler: [private reason] - Marks [private reason] in modlog only.`,\n\t],\n\n\tglobalunban: 'unglobalban',\n\tunglobalban(target, room, user) {\n\t\tif (!target) return this.parse(`/help unglobalban`);\n\t\tthis.checkCan('globalban');\n\n\t\tconst name = Punishments.unban(target);\n\n\t\tif (!name) {\n\t\t\treturn this.errorReply(`User '${target}' is not globally banned.`);\n\t\t}\n\n\t\tthis.addGlobalModAction(`${name} was globally unbanned by ${user.name}.`);\n\t\tthis.globalModlog(\"UNBAN\", target);\n\t},\n\tunglobalbanhelp: [`/unglobalban [username] - Unban a user. Requires: @ &`],\n\n\tderoomvoiceall(target, room, user) {\n\t\troom = this.requireRoom();\n\t\tthis.checkCan('editroom', null, room);\n\t\tif (!room.auth.size) return this.errorReply(\"Room does not have roomauth.\");\n\t\tif (!target) {\n\t\t\tuser.lastCommand = '/deroomvoiceall';\n\t\t\tthis.errorReply(\"THIS WILL DEROOMVOICE ALL ROOMVOICED USERS.\");\n\t\t\tthis.errorReply(\"To confirm, use: /deroomvoiceall confirm\");\n\t\t\treturn;\n\t\t}\n\t\tif (user.lastCommand !== '/deroomvoiceall' || target !== 'confirm') {\n\t\t\treturn this.parse('/help deroomvoiceall');\n\t\t}\n\t\tuser.lastCommand = '';\n\t\tlet count = 0;\n\t\tfor (const [userid, symbol] of room.auth) {\n\t\t\tif (symbol === '+') {\n\t\t\t\troom.auth.delete(userid);\n\t\t\t\tif (userid in room.users) room.users[userid].updateIdentity(room.roomid);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\tif (!count) {\n\t\t\treturn this.sendReply(\"(This room has zero roomvoices)\");\n\t\t}\n\t\troom.saveSettings();\n\t\tthis.addModAction(`All ${count} roomvoices have been cleared by ${user.name}.`);\n\t\tthis.modlog('DEROOMVOICEALL');\n\t},\n\tderoomvoiceallhelp: [`/deroomvoiceall - Devoice all roomvoiced users. Requires: # &`],\n\n\t// this is a separate command for two reasons\n\t// a - yearticketban is preferred over /ht yearban\n\t// b - it would be messy to switch\n\t// from both Punishments.punishRange and #punish in /ht ban\n\t// since this takes ips / userids\n\tasync yearticketban(target, room, user) {\n\t\tthis.checkCan('rangeban');\n\t\ttarget = target.trim();\n\t\tlet reason = '';\n\t\t[target, reason] = this.splitOne(target);\n\t\tlet isIP = false;\n\t\tlet descriptor = '';\n\t\tif (IPTools.ipRangeRegex.test(target)) {\n\t\t\tisIP = true;\n\t\t\tif (IPTools.ipRegex.test(target)) {\n\t\t\t\tdescriptor = 'the IP ';\n\t\t\t} else {\n\t\t\t\tdescriptor = 'the IP range ';\n\t\t\t}\n\t\t} else {\n\t\t\ttarget = toID(target);\n\t\t}\n\t\tif (!target) return this.parse(`/help yearticketban`);\n\t\tconst expireTime = Date.now() + 365 * 24 * 60 * 60 * 1000;\n\t\tif (isIP) {\n\t\t\tPunishments.punishRange(target, reason, expireTime, 'TICKETBAN');\n\t\t} else {\n\t\t\tawait Punishments.punish(target as ID, {\n\t\t\t\ttype: 'TICKETBAN',\n\t\t\t\tid: target as ID,\n\t\t\t\texpireTime,\n\t\t\t\treason,\n\t\t\t\trest: [],\n\t\t\t}, true);\n\t\t}\n\t\tthis.addGlobalModAction(\n\t\t\t`${user.name} banned ${descriptor}${target} from opening tickets for a year` +\n\t\t\t`${reason ? ` (${reason})` : \"\"}`\n\t\t);\n\t\tthis.globalModlog(\n\t\t\t'YEARTICKETBAN',\n\t\t\tisIP ? null : target,\n\t\t\treason,\n\t\t\tisIP ? target : undefined\n\t\t);\n\t},\n\tyearticketbanhelp: [\n\t\t`/yearticketban [IP/userid] - Ban an IP or a userid from opening tickets for a year. `,\n\t\t`Accepts wildcards to ban ranges. Requires: &`,\n\t],\n\n\trangeban: 'banip',\n\tyearbanip: 'banip',\n\tbanip(target, room, user, connection, cmd) {\n\t\tconst [ip, reason] = this.splitOne(target);\n\t\tif (!ip || !/^[0-9.]+(?:\\.\\*)?$/.test(ip)) return this.parse('/help banip');\n\t\tif (!reason) return this.errorReply(\"/banip requires a ban reason\");\n\n\t\tthis.checkCan('rangeban');\n\t\tconst ipDesc = `IP ${(ip.endsWith('*') ? `range ` : ``)}${ip}`;\n\n\t\tconst year = cmd.startsWith('year');\n\t\tconst time = year ? Date.now() + 365 * 24 * 60 * 60 * 1000 : null;\n\n\t\tconst curPunishment = Punishments.ipSearch(ip, 'BAN');\n\t\tif (curPunishment?.type === 'BAN' && !time) {\n\t\t\treturn this.errorReply(`The ${ipDesc} is already temporarily banned.`);\n\t\t}\n\t\tPunishments.punishRange(ip, reason, time, 'BAN');\n\n\t\tconst duration = year ? 'year' : 'hour';\n\t\tif (!this.room || this.room.roomid !== 'staff') {\n\t\t\tthis.sendReply(`You ${duration}-banned the ${ipDesc}.`);\n\t\t}\n\t\tthis.room = Rooms.get('staff') || null;\n\t\tthis.addGlobalModAction(\n\t\t\t`${user.name} ${duration}-banned the ${ipDesc}: ${reason}`\n\t\t);\n\t\tthis.globalModlog(\n\t\t\t`${year ? \"YEAR\" : \"\"}RANGEBAN`,\n\t\t\tnull,\n\t\t\t`${ip.endsWith('*') ? ip : `[${ip}]`}: ${reason}`\n\t\t);\n\t},\n\tbaniphelp: [\n\t\t`/banip [ip] OR /yearbanip [ip] - Globally bans this IP or IP range for an hour. Accepts wildcards to ban ranges.`,\n\t\t`Existing users on the IP will not be banned. Requires: &`,\n\t],\n\n\tunrangeban: 'unbanip',\n\tunbanip(target, room, user) {\n\t\ttarget = target.trim();\n\t\tif (!target) {\n\t\t\treturn this.parse('/help unbanip');\n\t\t}\n\t\tthis.checkCan('rangeban');\n\t\tif (!Punishments.ips.has(target)) {\n\t\t\treturn this.errorReply(`${target} is not a locked/banned IP or IP range.`);\n\t\t}\n\t\tPunishments.ips.delete(target);\n\n\t\tthis.addGlobalModAction(`${user.name} unbanned the ${(target.endsWith('*') ? \"IP range\" : \"IP\")}: ${target}`);\n\t\tthis.modlog('UNRANGEBAN', null, target);\n\t},\n\tunbaniphelp: [`/unbanip [ip] - Unbans. Accepts wildcards to ban ranges. Requires: &`],\n\n\tforceyearlockname: 'yearlockname',\n\tyearlockid: 'yearlockname',\n\tforceyearlockid: 'yearlockname',\n\tyearlockuserid: 'yearlockname',\n\tforceyearlockuserid: 'yearlockname',\n\tyearlockname(target, room, user) {\n\t\tthis.checkCan('rangeban');\n\t\tconst [targetUsername, rest] = Utils.splitFirst(target, ',').map(k => k.trim());\n\t\tconst targetUser = Users.get(targetUsername);\n\t\tconst targetUserid = toID(targetUsername);\n\t\tif (!targetUserid || targetUserid.length > 18) {\n\t\t\treturn this.errorReply(`Invalid userid.`);\n\t\t}\n\t\tconst force = this.cmd.includes('force');\n\t\tif (targetUser?.registered && !force) {\n\t\t\treturn this.errorReply(`That user is registered. Either permalock them normally or use /forceyearlockname.`);\n\t\t}\n\t\tconst punishment = {\n\t\t\ttype: 'YEARLOCK',\n\t\t\tid: targetUserid,\n\t\t\texpireTime: Date.now() + 365 * 24 * 60 * 60 * 1000,\n\t\t\treason: rest || \"\",\n\t\t};\n\t\tPunishments.userids.add(targetUserid, punishment);\n\t\tPunishments.savePunishments();\n\t\tthis.addGlobalModAction(`${user.name} locked the userid '${targetUserid}' for a year${rest ? ` (${rest})` : ''}.`);\n\t\tthis.globalModlog(`${force ? `FORCE` : ''}YEARLOCKNAME`, targetUserid, rest);\n\t\tif (targetUser) {\n\t\t\tChat.punishmentfilter(targetUser, punishment);\n\t\t\ttargetUser.locked = targetUserid;\n\t\t}\n\t},\n\trangelock: 'lockip',\n\tyearlockip: 'lockip',\n\tyearnamelockip: 'lockip',\n\tlockip(target, room, user, connection, cmd) {\n\t\tconst [ip, reason] = this.splitOne(target);\n\t\tif (!ip || !/^[0-9.]+(?:\\.\\*)?$/.test(ip)) return this.parse('/help lockip');\n\t\tif (!reason) return this.errorReply(\"/lockip requires a lock reason\");\n\n\t\tthis.checkCan('rangeban');\n\t\tconst ipDesc = ip.endsWith('*') ? `IP range ${ip}` : `IP ${ip}`;\n\n\t\tconst year = cmd.startsWith('year');\n\t\tconst curPunishment = Punishments.byWeight(Punishments.ipSearch(ip) || [])[0];\n\t\tif (!year && curPunishment && (curPunishment.type === 'BAN' || curPunishment.type === 'LOCK')) {\n\t\t\tconst punishDesc = curPunishment.type === 'BAN' ? `temporarily banned` : `temporarily locked`;\n\t\t\treturn this.errorReply(`The ${ipDesc} is already ${punishDesc}.`);\n\t\t}\n\n\t\tconst time = year ? Date.now() + 365 * 24 * 60 * 60 * 1000 : null;\n\t\tconst type = cmd.includes('name') ? 'NAMELOCK' : 'LOCK';\n\t\tPunishments.punishRange(ip, reason, time, type);\n\n\t\tthis.addGlobalModAction(`${user.name} ${year ? 'year' : 'hour'}-${type.toLowerCase()}ed the ${ipDesc}: ${reason}`);\n\t\tthis.globalModlog(\n\t\t\t`${year ? 'YEAR' : 'RANGE'}${type}`,\n\t\t\tnull,\n\t\t\t`${ip.endsWith('*') ? ip : `[${ip}]`}: ${reason}`,\n\t\t\tip.endsWith('*') ? `${ip.slice(0, -2)}` : ip\n\t\t);\n\t},\n\tlockiphelp: [\n\t\t`/lockip [ip] - Globally locks this IP or IP range for an hour. Accepts wildcards to ban ranges.`,\n\t\t`/yearlockip [ip] - Globally locks this IP or IP range for one year. Accepts wildcards to ban ranges.`,\n\t\t`/yearnamelockip [ip] - Namelocks this IP or IP range for one year. Accepts wildcards to ban ranges.`,\n\t\t`Existing users on the IP will not be banned. Requires: &`,\n\t],\n\n\t/*********************************************************\n\t * Moderating: Other\n\t *********************************************************/\n\n\tmn: 'modnote',\n\tmodnote(target, room, user, connection) {\n\t\troom = this.requireRoom();\n\t\tif (!target) return this.parse('/help modnote');\n\t\tthis.checkChat();\n\n\t\tif (target.length > MAX_REASON_LENGTH) {\n\t\t\treturn this.errorReply(`The note is too long. It cannot exceed ${MAX_REASON_LENGTH} characters.`);\n\t\t}\n\t\tthis.checkCan('receiveauthmessages', null, room);\n\t\ttarget = target.replace(/\\n/g, \"; \");\n\t\tlet targeted = /\\[([^\\]]+)\\]/.exec(target)?.[1] || null;\n\t\tif (!targeted) {\n\t\t\t// allow `name, note` and `name - note` syntax\n\t\t\ttargeted = target.split(/[,-]/)[0]?.trim() || \"\";\n\t\t\tif (!targeted || !(\n\t\t\t\tUsers.get(targeted) || Punishments.search(target).length || IPTools.ipRegex.test(targeted)\n\t\t\t) || toID(targeted) === toID(target)) {\n\t\t\t\ttargeted = null;\n\t\t\t}\n\t\t}\n\t\tlet targetUserid, targetIP;\n\n\t\tif (targeted) {\n\t\t\tif (IPTools.ipRegex.test(targeted)) {\n\t\t\t\ttargetIP = targeted;\n\t\t\t} else {\n\t\t\t\ttargetUserid = toID(targeted);\n\t\t\t}\n\t\t}\n\t\tif (\n\t\t\t['staff', 'upperstaff'].includes(room.roomid) ||\n\t\t\t(Rooms.Modlog.getSharedID(room.roomid) && user.can('modlog'))\n\t\t) {\n\t\t\tthis.globalModlog('NOTE', targetUserid || null, target, targetIP);\n\t\t} else {\n\t\t\tthis.modlog('NOTE', targetUserid || null, target);\n\t\t}\n\n\t\tthis.privateModAction(`${user.name} notes: ${target}`);\n\t},\n\tmodnotehelp: [`/modnote [note] - Adds a moderator note that can be read through modlog. Requires: % @ # &`],\n\n\tglobalpromote: 'promote',\n\tpromote(target, room, user, connection, cmd) {\n\t\tif (!target) return this.parse('/help promote');\n\n\t\tconst {targetUser, targetUsername, rest: nextGroupName} = this.splitUser(target, {exactName: true});\n\t\tconst userid = toID(targetUsername);\n\t\tconst name = targetUser?.name || targetUsername;\n\n\t\tif (!userid) return this.parse('/help promote');\n\n\t\tconst currentGroup = targetUser?.tempGroup || Users.globalAuth.get(userid);\n\t\tlet nextGroup = nextGroupName as GroupSymbol;\n\t\tif (nextGroupName === 'deauth') nextGroup = Users.Auth.defaultSymbol();\n\t\tif (!nextGroup) {\n\t\t\treturn this.errorReply(\"Please specify a group such as /globalvoice or /globaldeauth\");\n\t\t}\n\t\tif (!Config.groups[nextGroup]) {\n\t\t\treturn this.errorReply(`Group '${nextGroup}' does not exist.`);\n\t\t}\n\t\tif (!cmd.startsWith('global')) {\n\t\t\tlet groupid = Config.groups[nextGroup].id;\n\t\t\tif (!groupid && nextGroup === Users.Auth.defaultSymbol()) groupid = 'deauth' as ID;\n\t\t\tif (Config.groups[nextGroup].globalonly) return this.errorReply(`Did you mean \"/global${groupid}\"?`);\n\t\t\tif (Config.groups[nextGroup].roomonly) return this.errorReply(`Did you mean \"/room${groupid}\"?`);\n\t\t\treturn this.errorReply(`Did you mean \"/room${groupid}\" or \"/global${groupid}\"?`);\n\t\t}\n\t\tif (Config.groups[nextGroup].roomonly || Config.groups[nextGroup].battleonly) {\n\t\t\treturn this.errorReply(`Group '${nextGroup}' does not exist as a global rank.`);\n\t\t}\n\n\t\tconst groupName = Config.groups[nextGroup].name || \"regular user\";\n\t\tif (currentGroup === nextGroup) {\n\t\t\treturn this.errorReply(`User '${name}' is already a ${groupName}`);\n\t\t}\n\t\tif (!Users.Auth.hasPermission(user, 'promote', currentGroup)) {\n\t\t\tthis.errorReply(`/${cmd} - Access denied for promoting from ${currentGroup}`);\n\t\t\tthis.errorReply(`You can only promote to/from: ${Users.Auth.listJurisdiction(user, 'promote')}`);\n\t\t\treturn;\n\t\t}\n\t\tif (!Users.Auth.hasPermission(user, 'promote', nextGroup)) {\n\t\t\tthis.errorReply(`/${cmd} - Access denied for promoting to ${groupName}`);\n\t\t\tthis.errorReply(`You can only promote to/from: ${Users.Auth.listJurisdiction(user, 'promote')}`);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!Users.isUsernameKnown(userid)) {\n\t\t\treturn this.errorReply(`/globalpromote - WARNING: '${name}' is offline and unrecognized. The username might be misspelled (either by you or the person who told you) or unregistered. Use /forcepromote if you're sure you want to risk it.`);\n\t\t}\n\t\tif (targetUser && !targetUser.registered) {\n\t\t\treturn this.errorReply(`User '${name}' is unregistered, and so can't be promoted.`);\n\t\t}\n\t\tif (nextGroup === Users.Auth.defaultSymbol()) {\n\t\t\tUsers.globalAuth.delete(targetUser ? targetUser.id : userid);\n\t\t} else {\n\t\t\tUsers.globalAuth.set(targetUser ? targetUser.id : userid, nextGroup);\n\t\t}\n\t\tif (Users.Auth.getGroup(nextGroup).rank < Users.Auth.getGroup(currentGroup).rank) {\n\t\t\tthis.privateGlobalModAction(`${name} was demoted to Global ${groupName} by ${user.name}.`);\n\t\t\tthis.globalModlog(`GLOBAL ${groupName.toUpperCase()}`, userid, `(demote)`);\n\t\t\tif (targetUser) targetUser.popup(`You were demoted to Global ${groupName} by ${user.name}.`);\n\t\t} else {\n\t\t\tthis.addGlobalModAction(`${name} was promoted to Global ${groupName} by ${user.name}.`);\n\t\t\tthis.globalModlog(`GLOBAL ${groupName.toUpperCase()}`, userid);\n\t\t\tif (targetUser) targetUser.popup(`You were promoted to Global ${groupName} by ${user.name}.`);\n\t\t}\n\n\t\tif (targetUser) {\n\t\t\ttargetUser.updateIdentity();\n\t\t\tRooms.global.checkAutojoin(targetUser);\n\t\t\tif (targetUser.trusted && !Users.isTrusted(targetUser.id)) {\n\t\t\t\ttargetUser.trusted = '';\n\t\t\t}\n\t\t}\n\t},\n\tpromotehelp: [`/promote [username], [group] - Promotes the user to the specified group. Requires: &`],\n\n\tuntrustuser: 'trustuser',\n\tunconfirmuser: 'trustuser',\n\tconfirmuser: 'trustuser',\n\tforceconfirmuser: 'trustuser',\n\tforcetrustuser: 'trustuser',\n\ttrustuser(target, room, user, connection, cmd) {\n\t\tif (!target) return this.parse('/help trustuser');\n\t\tthis.checkCan('promote');\n\n\t\tconst force = cmd.includes('force');\n\t\tconst untrust = cmd.includes('un');\n\t\tconst {targetUser, targetUsername, rest} = this.splitUser(target, {exactName: true});\n\t\tif (rest) return this.errorReply(`This command does not support specifying a reason.`);\n\t\tconst userid = toID(targetUsername);\n\t\tconst name = targetUser?.name || targetUsername;\n\n\t\tconst currentGroup = Users.globalAuth.get(userid);\n\n\t\tif (untrust) {\n\t\t\tif (currentGroup !== Users.Auth.defaultSymbol()) {\n\t\t\t\treturn this.errorReply(`User '${name}' is trusted indirectly through global rank ${currentGroup}. Demote them from that rank to remove trusted status.`);\n\t\t\t}\n\t\t\tconst trustedSourceRooms = Rooms.global.chatRooms\n\t\t\t\t.filter(authRoom => authRoom.persist && authRoom.settings.isPrivate !== true && authRoom.auth.isStaff(userid))\n\t\t\t\t.map(authRoom => authRoom.auth.get(userid) + authRoom.roomid).join(' ');\n\t\t\tif (trustedSourceRooms.length && !Users.globalAuth.has(userid)) {\n\t\t\t\treturn this.errorReply(`User '${name}' is trusted indirectly through room ranks ${trustedSourceRooms}. Demote them from those ranks to remove trusted status.`);\n\t\t\t}\n\t\t\tif (!Users.globalAuth.has(userid)) return this.errorReply(`User '${name}' is not trusted.`);\n\n\t\t\tif (targetUser) {\n\t\t\t\ttargetUser.setGroup(Users.Auth.defaultSymbol());\n\t\t\t} else {\n\t\t\t\tUsers.globalAuth.delete(userid);\n\t\t\t}\n\n\t\t\tthis.privateGlobalModAction(`${name} was set to no longer be a trusted user by ${user.name}.`);\n\t\t\tthis.globalModlog('UNTRUSTUSER', userid);\n\t\t} else {\n\t\t\tif (!targetUser && !force) return this.errorReply(`User '${name}' is offline. Use /force${cmd} if you're sure.`);\n\t\t\tif (currentGroup) {\n\t\t\t\tif (Users.globalAuth.has(userid)) {\n\t\t\t\t\tif (currentGroup === Users.Auth.defaultSymbol()) return this.errorReply(`User '${name}' is already trusted.`);\n\t\t\t\t\treturn this.errorReply(`User '${name}' has a global rank higher than trusted.`);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (targetUser) {\n\t\t\t\ttargetUser.setGroup(Users.Auth.defaultSymbol(), true);\n\t\t\t} else {\n\t\t\t\tUsers.globalAuth.set(userid, Users.Auth.defaultSymbol());\n\t\t\t}\n\n\t\t\tthis.privateGlobalModAction(`${name} was set as a trusted user by ${user.name}.`);\n\t\t\tthis.globalModlog('TRUSTUSER', userid);\n\t\t}\n\t},\n\ttrustuserhelp: [\n\t\t`/trustuser [username] - Trusts the user (makes them immune to locks). Requires: &`,\n\t\t`/untrustuser [username] - Removes the trusted user status from the user. Requires: &`,\n\t],\n\n\tdesectionleader: 'sectionleader',\n\tsectionleader(target, room, user, connection, cmd) {\n\t\tthis.checkCan('gdeclare');\n\t\troom = this.requireRoom();\n\t\tconst demoting = cmd === 'desectionleader';\n\t\tif (!target || (target.split(',').length < 2 && !demoting)) return this.parse(`/help sectionleader`);\n\n\t\tconst {targetUser, targetUsername, rest: sectionid} = this.splitUser(target, {exactName: true});\n\t\tconst userid = toID(targetUsername);\n\t\tconst section = demoting ? Users.globalAuth.sectionLeaders.get(userid)! : room.validateSection(sectionid);\n\t\tconst name = targetUser ? targetUser.name : targetUsername;\n\t\tif (Users.globalAuth.sectionLeaders.has(targetUser?.id || userid) && !demoting) {\n\t\t\tthrow new Chat.ErrorMessage(`${name} is already a Section Leader of ${RoomSections.sectionNames[section]}.`);\n\t\t} else if (!Users.globalAuth.sectionLeaders.has(targetUser?.id || userid) && demoting) {\n\t\t\tthrow new Chat.ErrorMessage(`${name} is not a Section Leader.`);\n\t\t}\n\t\tconst staffRoom = Rooms.get('staff');\n\t\tif (!demoting) {\n\t\t\tUsers.globalAuth.setSection(userid, section);\n\t\t\tthis.addGlobalModAction(`${name} was appointed Section Leader of ${RoomSections.sectionNames[section]} by ${user.name}.`);\n\t\t\tthis.globalModlog(`SECTION LEADER`, userid, section);\n\t\t\tif (targetUser) {\n\t\t\t\t// do not use global /forcepromote\n\t\t\t\tif (!Users.globalAuth.atLeast(targetUser, Users.SECTIONLEADER_SYMBOL)) {\n\t\t\t\t\tthis.parse(`/globalsectionleader ${userid}`);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.sendReply(`User ${userid} is offline and unrecognized, and so can't be globally promoted.`);\n\t\t\t}\n\t\t\ttargetUser?.popup(`You were appointed Section Leader of ${RoomSections.sectionNames[section]} by ${user.name}.`);\n\t\t} else {\n\t\t\tconst group = Users.globalAuth.get(userid);\n\t\t\tUsers.globalAuth.deleteSection(userid);\n\t\t\tthis.privateGlobalModAction(`${name} was demoted from Section Leader of ${RoomSections.sectionNames[section]} by ${user.name}.`);\n\t\t\tif (group === ' ') this.sendReply(`They are also no longer manually trusted. If they should be, use '/trustuser'.`);\n\t\t\tthis.globalModlog(`DESECTION LEADER`, userid, section);\n\t\t\tif (staffRoom?.auth.getDirect(userid) as any === '\\u25B8') this.parse(`/msgroom staff,/roomdeauth ${userid}`);\n\t\t\ttargetUser?.popup(`You were demoted from Section Leader of ${RoomSections.sectionNames[section]} by ${user.name}.`);\n\t\t}\n\n\t\tif (targetUser) {\n\t\t\ttargetUser.updateIdentity();\n\t\t\tRooms.global.checkAutojoin(targetUser);\n\t\t\tif (targetUser.trusted && !Users.isTrusted(targetUser.id)) {\n\t\t\t\ttargetUser.trusted = '';\n\t\t\t}\n\t\t}\n\t},\n\tsectionleaderhelp: [\n\t\t`/sectionleader [target user], [sectionid] - Appoints [target user] Section Leader.`,\n\t\t`/desectionleader [target user] - Demotes [target user] from Section Leader.`,\n\t\t`Valid sections: ${RoomSections.sections.join(', ')}`,\n\t\t`If you want to change which section someone leads, demote them and then re-promote them in the desired section.`,\n\t\t`Requires: &`,\n\t],\n\n\tglobaldemote: 'demote',\n\tdemote(target) {\n\t\tif (!target) return this.parse('/help demote');\n\t\tthis.run('promote');\n\t},\n\tdemotehelp: [`/demote [username], [group] - Demotes the user to the specified group. Requires: &`],\n\n\tforcepromote(target, room, user, connection) {\n\t\t// warning: never document this command in /help\n\t\tthis.checkCan('forcepromote');\n\t\tconst {targetUsername, rest: nextGroupName} = this.splitUser(target, {exactName: true});\n\t\tlet name = this.filter(targetUsername);\n\t\tif (!name) return;\n\t\tname = name.slice(0, 18);\n\t\tconst nextGroup = nextGroupName as GroupSymbol;\n\t\tif (!Config.groups[nextGroup]) return this.errorReply(`Group '${nextGroup}' does not exist.`);\n\t\tif (Config.groups[nextGroup].roomonly || Config.groups[nextGroup].battleonly) {\n\t\t\treturn this.errorReply(`Group '${nextGroup}' does not exist as a global rank.`);\n\t\t}\n\n\t\tif (Users.isUsernameKnown(name)) {\n\t\t\treturn this.errorReply(\"/forcepromote - Don't forcepromote unless you have to.\");\n\t\t}\n\t\tUsers.globalAuth.set(name as ID, nextGroup);\n\n\t\tthis.addGlobalModAction(`${name} was promoted to Global ${(Config.groups[nextGroup].name || \"regular user\")} by ${user.name}.`);\n\t\tthis.globalModlog(`GLOBAL${(Config.groups[nextGroup].name || \"regular\").toUpperCase()}`, toID(name));\n\t},\n\n\tdevoice: 'deauth',\n\tdeauth(target, room, user) {\n\t\treturn this.parse(`/demote ${target}, deauth`);\n\t},\n\n\tdeglobalvoice: 'globaldeauth',\n\tdeglobalauth: 'globaldeauth',\n\tglobaldevoice: 'globaldeauth',\n\tglobaldeauth(target, room, user) {\n\t\treturn this.parse(`/globaldemote ${target}, deauth`);\n\t},\n\n\tderoomvoice: 'roomdeauth',\n\troomdevoice: 'roomdeauth',\n\tderoomauth: 'roomdeauth',\n\troomdeauth(target, room, user) {\n\t\treturn this.parse(`/roomdemote ${target}, deauth`);\n\t},\n\n\tdeclare(target, room, user) {\n\t\ttarget = target.trim();\n\t\tif (!target) return this.parse('/help declare');\n\t\troom = this.requireRoom();\n\t\tthis.checkCan('declare', null, room);\n\t\tthis.checkChat();\n\t\tif (target.length > 2000) return this.errorReply(\"Declares should not exceed 2000 characters.\");\n\n\t\tfor (const id in room.users) {\n\t\t\troom.users[id].sendTo(room, `|notify|${room.title} announcement!|${target}`);\n\t\t}\n\t\tthis.add(Utils.html`|raw|
${target}
`);\n\t\tthis.modlog('DECLARE', null, target);\n\t},\n\tdeclarehelp: [`/declare [message] - Anonymously announces a message. Requires: # * &`],\n\n\thtmldeclare(target, room, user) {\n\t\tif (!target) return this.parse('/help htmldeclare');\n\t\troom = this.requireRoom();\n\t\tthis.checkCan('declare', null, room);\n\t\tthis.checkChat();\n\t\tthis.checkHTML(target);\n\n\t\tfor (const u in room.users) {\n\t\t\tUsers.get(u)?.sendTo(\n\t\t\t\troom,\n\t\t\t\t`|notify|${room.title} announcement!|${Utils.stripHTML(target)}`\n\t\t\t);\n\t\t}\n\t\tthis.add(`|raw|
${target}
`);\n\t\tthis.modlog(`HTMLDECLARE`, null, target);\n\t},\n\thtmldeclarehelp: [`/htmldeclare [message] - Anonymously announces a message using safe HTML. Requires: # * &`],\n\n\tgdeclare: 'globaldeclare',\n\tglobaldeclare(target, room, user) {\n\t\tif (!target) return this.parse('/help globaldeclare');\n\t\tthis.checkCan('gdeclare');\n\t\tthis.checkHTML(target);\n\n\t\tfor (const u of Users.users.values()) {\n\t\t\tif (u.connected) u.send(`|pm|&|${u.tempGroup}${u.name}|/raw
${target}
`);\n\t\t}\n\t\tthis.globalModlog(`GLOBALDECLARE`, null, target);\n\t},\n\tglobaldeclarehelp: [`/globaldeclare [message] - Anonymously sends a private message to all the users on the site. Requires: &`],\n\n\tcdeclare: 'chatdeclare',\n\tchatdeclare(target, room, user) {\n\t\tif (!target) return this.parse('/help chatdeclare');\n\t\tthis.checkCan('gdeclare');\n\t\tthis.checkHTML(target);\n\n\t\tfor (const curRoom of Rooms.rooms.values()) {\n\t\t\tif (curRoom.type !== 'battle') {\n\t\t\t\tcurRoom.addRaw(`
${target}
`).update();\n\t\t\t}\n\t\t}\n\t\tthis.globalModlog(`CHATDECLARE`, null, target);\n\t},\n\tchatdeclarehelp: [`/cdeclare [message] - Anonymously announces a message to all chatrooms on the server. Requires: &`],\n\n\twall: 'announce',\n\tannounce(target, room, user) {\n\t\tif (!target) return this.parse('/help announce');\n\n\t\tif (room) this.checkCan('announce', null, room);\n\n\t\tthis.checkChat(target);\n\n\t\treturn `/announce ${target}`;\n\t},\n\tannouncehelp: [`/announce OR /wall [message] - Makes an announcement. Requires: % @ # &`],\n\n\tnotifyoffrank: 'notifyrank',\n\tnotifyrank(target, room, user, connection, cmd) {\n\t\troom = this.requireRoom();\n\t\tif (!target) return this.parse(`/help notifyrank`);\n\t\tthis.checkCan('addhtml', null, room);\n\t\tthis.checkChat();\n\t\tlet [rank, titleNotification] = this.splitOne(target);\n\t\tif (rank === 'all') rank = ` `;\n\t\tif (!(rank in Config.groups)) return this.errorReply(`Group '${rank}' does not exist.`);\n\t\tconst id = `${room.roomid}-rank-${(Config.groups[rank].id || `all`)}`;\n\t\tif (cmd === 'notifyoffrank') {\n\t\t\tif (rank === ' ') {\n\t\t\t\troom.send(`|tempnotifyoff|${id}`);\n\t\t\t} else {\n\t\t\t\troom.sendRankedUsers(`|tempnotifyoff|${id}`, rank as GroupSymbol);\n\t\t\t}\n\t\t} else {\n\t\t\tlet [title, notificationHighlight] = this.splitOne(titleNotification);\n\t\t\tif (!title) title = `${room.title} ${(Config.groups[rank].name ? `${Config.groups[rank].name}+ ` : ``)}message!`;\n\t\t\tif (!user.can('addhtml')) {\n\t\t\t\ttitle += ` (notification from ${user.name})`;\n\t\t\t}\n\t\t\tconst [notification, highlight] = this.splitOne(notificationHighlight);\n\t\t\tif (notification.length > 300) return this.errorReply(`Notifications should not exceed 300 characters.`);\n\t\t\tconst message = `|tempnotify|${id}|${title}|${notification}${(highlight ? `|${highlight}` : ``)}`;\n\t\t\tif (rank === ' ') {\n\t\t\t\troom.send(message);\n\t\t\t} else {\n\t\t\t\troom.sendRankedUsers(message, rank as GroupSymbol);\n\t\t\t}\n\t\t\tthis.modlog(`NOTIFYRANK`, null, target);\n\t\t}\n\t},\n\tnotifyrankhelp: [\n\t\t`/notifyrank [rank], [title], [message], [highlight] - Sends a notification to users who are [rank] or higher (and highlight on [highlight], if specified). Requires: # * &`,\n\t\t`/notifyoffrank [rank] - Closes the notification previously sent with /notifyrank [rank]. Requires: # * &`,\n\t],\n\n\tnotifyoffuser: 'notifyuser',\n\tnotifyuser(target, room, user, connection, cmd) {\n\t\troom = this.requireRoom();\n\t\tif (!target) return this.parse(`/help notifyuser`);\n\t\tthis.checkCan('addhtml', null, room);\n\t\tthis.checkChat();\n\t\tconst {targetUser, targetUsername, rest: titleNotification} = this.splitUser(target);\n\t\tif (!targetUser?.connected) return this.errorReply(`User '${targetUsername}' not found.`);\n\t\tconst id = `${room.roomid}-user-${toID(targetUsername)}`;\n\t\tif (cmd === 'notifyoffuser') {\n\t\t\troom.sendUser(targetUser, `|tempnotifyoff|${id}`);\n\t\t\tthis.sendReply(`Closed the notification previously sent to ${targetUser.name}.`);\n\t\t} else {\n\t\t\tlet [title, notification] = this.splitOne(titleNotification);\n\t\t\tif (!title) title = `${room.title} notification!`;\n\t\t\tif (!user.can('addhtml')) {\n\t\t\t\ttitle += ` (notification from ${user.name})`;\n\t\t\t}\n\t\t\tif (notification.length > 300) return this.errorReply(`Notifications should not exceed 300 characters.`);\n\t\t\tconst message = `|tempnotify|${id}|${title}|${notification}`;\n\t\t\troom.sendUser(targetUser, message);\n\t\t\tthis.sendReply(`Sent a notification to ${targetUser.name}.`);\n\t\t}\n\t},\n\tnotifyuserhelp: [\n\t\t`/notifyuser [username], [title], [message] - Sends a notification to [user]. Requires: # * &`,\n\t\t`/notifyoffuser [user] - Closes the notification previously sent with /notifyuser [user]. Requires: # * &`,\n\t],\n\n\tfr: 'forcerename',\n\tofr: 'forcerename',\n\tofflineforcerename: 'forcerename',\n\tforcerename(target, room, user) {\n\t\tif (!target) return this.parse('/help forcerename');\n\n\t\tconst {targetUser, targetUsername, rest: reason} = this.splitUser(target, {exactName: true});\n\t\tconst offline = this.cmd.startsWith('o');\n\t\tconst targetID = targetUser?.id || toID(targetUsername);\n\t\t// && !offline because maybe we're trying to disallow the name after they namechanged\n\t\tif (!targetUser && !offline) {\n\t\t\tconst {targetUser: targetUserInexact, inputUsername} = this.splitUser(target);\n\t\t\tif (targetUserInexact) {\n\t\t\t\treturn this.errorReply(`User has already changed their name to '${targetUserInexact.name}'.`);\n\t\t\t}\n\t\t\treturn this.errorReply(`User '${inputUsername}' not found. (use /offlineforcerename to rename anyway.)`);\n\t\t}\n\t\tif (Punishments.namefilterwhitelist.has(targetID)) {\n\t\t\tthis.errorReply(`That name is blocked from being forcerenamed.`);\n\t\t\tif (user.can('bypassall')) {\n\t\t\t\tthis.errorReply(`Use /noforcerename remove to remove it from the list if you wish to rename it.`);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tthis.checkCan('forcerename', targetID);\n\t\tconst {publicReason, privateReason} = this.parseSpoiler(reason);\n\n\t\tMonitor.forceRenames.set(targetID, false);\n\n\t\tlet forceRenameMessage;\n\t\tif (targetUser?.connected) {\n\t\t\tforceRenameMessage = `was forced to choose a new name by ${user.name}${(publicReason ? `: ${publicReason}` : ``)}`;\n\t\t\tthis.globalModlog('FORCERENAME', targetUser, reason);\n\t\t\tLadders.cancelSearches(targetUser);\n\t\t\ttargetUser.send(`|nametaken||${user.name} considers your name inappropriate${(publicReason ? `: ${publicReason}` : ``)}`);\n\t\t} else {\n\t\t\tforceRenameMessage = `was forced to choose a new name by ${user.name} while offline${(publicReason ? `: ${publicReason}` : ``)}`;\n\t\t\tthis.globalModlog('FORCERENAME OFFLINE', targetUser, privateReason);\n\t\t}\n\t\tMonitor.forceRenames.set(targetID, false);\n\n\t\tif (room?.roomid !== 'staff') {\n\t\t\tif (room?.roomid.startsWith('help-')) {\n\t\t\t\tthis.addModAction(`${targetUser?.name || targetID} ${forceRenameMessage}`);\n\t\t\t} else {\n\t\t\t\tthis.privateModAction(`${targetUser?.name || targetID} ${forceRenameMessage}`);\n\t\t\t}\n\t\t}\n\t\tconst roomMessage = this.pmTarget ? `` :\n\t\t\troom && room.roomid !== 'staff' ? `\u00AB${room.roomid}\u00BB ` :\n\t\t\t'';\n\t\tconst rankMessage = targetUser?.getAccountStatusString() || \"\";\n\t\tRooms.global.notifyRooms(\n\t\t\t['staff'],\n\t\t\t`|html|${roomMessage}` + Utils.html`${targetUser?.name || targetID} ${rankMessage} ${forceRenameMessage}`\n\t\t);\n\n\t\ttargetUser?.resetName(true);\n\t\treturn true;\n\t},\n\tforcerenamehelp: [\n\t\t`/forcerename OR /fr [username], [reason] - Forcibly change a user's name and shows them the [reason]. Requires: % @ &`,\n\t\t`/allowname [username] - Unmarks a forcerenamed username, stopping staff from being notified when it is used. Requires % @ &`,\n\t],\n\n\tnfr: 'noforcerename',\n\tnoforcerename: {\n\t\tadd(target, room, user) {\n\t\t\tconst [targetUsername, rest] = Utils.splitFirst(target, ',').map(f => f.trim());\n\t\t\tconst targetId = toID(targetUsername);\n\t\t\tif (!targetId) return this.parse('/help noforcerename');\n\t\t\tthis.checkCan('bypassall');\n\t\t\tif (!Punishments.whitelistName(targetId, user.name)) {\n\t\t\t\treturn this.errorReply(`${targetUsername} is already on the noforcerename list.`);\n\t\t\t}\n\t\t\tthis.addGlobalModAction(`${user.name} added the name ${targetId} to the no forcerename list.${rest ? ` (${rest})` : ''}`);\n\t\t\tthis.globalModlog('NOFORCERENAME', targetId, rest);\n\t\t},\n\t\tremove(target, room, user) {\n\t\t\tconst {targetUsername, rest} = this.splitUser(target);\n\t\t\tconst targetId = toID(targetUsername);\n\t\t\tif (!targetId) return this.parse('/help noforcerename');\n\t\t\tthis.checkCan('bypassall');\n\t\t\tif (!Punishments.namefilterwhitelist.has(targetId)) {\n\t\t\t\treturn this.errorReply(`${targetUsername} is not on the noforcerename list.`);\n\t\t\t}\n\t\t\tPunishments.unwhitelistName(targetId);\n\t\t\tthis.addGlobalModAction(`${user.name} removed ${targetId} from the no forcerename list.${rest ? ` (${rest})` : ''}`);\n\t\t\tthis.globalModlog('UNNOFORCERENAME', targetId, rest);\n\t\t},\n\t},\n\tnoforcerenamehelp: [\n\t\t`/noforcerename add OR /nfr add [username] - Adds [username] to the list of users who can't be forcerenamed by staff.`,\n\t\t`/noforcerename remove OR /nfr remove [username] - Removes [username] from the list of users who can't be forcerenamed by staff.`,\n\t],\n\n\tforceclearstatus(target, room, user) {\n\t\tconst {targetUser, rest: reason} = this.requireUser(target, {allowOffline: true});\n\t\tthis.checkCan('forcerename', targetUser);\n\n\t\tif (!targetUser.userMessage) return this.errorReply(this.tr`${targetUser.name} does not have a status set.`);\n\n\t\tconst displayReason = reason ? `: ${reason}` : ``;\n\t\tthis.privateGlobalModAction(this.tr`${targetUser.name}'s status \"${targetUser.userMessage}\" was cleared by ${user.name}${displayReason}.`);\n\t\tthis.globalModlog('CLEARSTATUS', targetUser, ` from \"${targetUser.userMessage}\"${displayReason}`);\n\t\ttargetUser.clearStatus();\n\t\ttargetUser.popup(`${user.name} has cleared your status message for being inappropriate${displayReason || '.'}`);\n\t},\n\n\tnl: 'namelock',\n\tforcenamelock: 'namelock',\n\tweeknamelock: 'namelock',\n\twnl: 'namelock',\n\tfwnl: 'namelock',\n\tforceweeknamelock: 'namelock',\n\tasync namelock(target, room, user, connection, cmd) {\n\t\tif (!target) return this.parse('/help namelock');\n\t\tconst week = cmd.includes('w');\n\t\tconst force = cmd.includes('f');\n\n\t\tconst {targetUser, inputUsername, targetUsername, rest: reason} = this.splitUser(target);\n\t\tconst userid = toID(targetUsername);\n\n\t\tif (!targetUser && !force) {\n\t\t\treturn this.errorReply(\n\t\t\t\t`User '${targetUsername}' not found. Use \\`\\`/force${week ? 'week' : ''}namelock\\`\\` if you need to namelock them anyway.`\n\t\t\t);\n\t\t}\n\t\tif (targetUser && targetUser.id !== toID(inputUsername) && !force) {\n\t\t\treturn this.errorReply(`${inputUsername} has already changed their name to ${targetUser.name}. To namelock anyway, use /force${week ? 'week' : ''}namelock.`);\n\t\t}\n\t\tthis.checkCan('forcerename', userid);\n\t\tif (targetUser?.namelocked && !week) {\n\t\t\treturn this.errorReply(`User '${targetUser.name}' is already namelocked.`);\n\t\t}\n\t\tif (!force && !week) {\n\t\t\tconst existingPunishments = Punishments.search(userid);\n\t\t\tfor (const [,, punishment] of existingPunishments) {\n\t\t\t\tif (punishment.type === 'LOCK' && (punishment.expireTime - Date.now()) > (2 * DAY)) {\n\t\t\t\t\tthis.errorReply(`User '${userid}' is already normally locked for more than 2 days.`);\n\t\t\t\t\tthis.errorReply(`Use /weeknamelock to namelock them instead, so you don't decrease the existing punishment.`);\n\t\t\t\t\treturn this.errorReply(`If you really need to override this, use /forcenamelock.`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst {privateReason, publicReason} = this.parseSpoiler(reason);\n\t\tconst reasonText = publicReason ? ` (${publicReason})` : `.`;\n\t\tthis.privateGlobalModAction(`${targetUser?.name || userid} was ${week ? 'week' : ''}namelocked by ${user.name}${reasonText}`);\n\t\tthis.globalModlog(`${force ? `FORCE` : ``}${week ? 'WEEK' : \"\"}NAMELOCK`, targetUser || userid, privateReason);\n\n\t\tconst roomauth = Rooms.global.destroyPersonalRooms(userid);\n\t\tif (roomauth.length) {\n\t\t\tMonitor.log(`[CrisisMonitor] Namelocked user ${userid} has public roomauth (${roomauth.join(', ')}), and should probably be demoted.`);\n\t\t}\n\t\tif (targetUser) {\n\t\t\tLadders.cancelSearches(targetUser);\n\t\t\ttargetUser.popup(`|modal|${user.name} has locked your name and you can't change names anymore${reasonText}`);\n\t\t}\n\t\tconst duration = week ? 7 * 24 * 60 * 60 * 1000 : 48 * 60 * 60 * 1000;\n\t\tawait Punishments.namelock(userid, Date.now() + duration, null, false, publicReason);\n\t\t// Automatically upload replays as evidence/reference to the punishment\n\t\tif (room?.battle) this.parse('/savereplay forpunishment');\n\t\tMonitor.forceRenames.set(userid, false);\n\t\tif (connection.openPages) {\n\t\t\t// this hardcode is necessary because when /namelock and /uspage are send together in one button\n\t\t\t// the uspage output is sent before the user's name is reset\n\t\t\t// so it takes two clicks, which is bad behavior\n\t\t\tfor (const page of connection.openPages) {\n\t\t\t\tif (page.includes('usersearch-')) {\n\t\t\t\t\tthis.refreshPage(page);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t},\n\tnamelockhelp: [`/namelock OR /nl [user], [reason] - Name locks a [user] and shows the [reason]. Requires: % @ &`],\n\n\tunl: 'unnamelock',\n\tunnamelock(target, room, user) {\n\t\tif (!target) return this.parse('/help unnamelock');\n\t\tthis.checkCan('forcerename');\n\n\t\tconst targetUser = Users.get(target);\n\t\tlet reason = '';\n\t\tif (targetUser?.namelocked) {\n\t\t\treason = ` (${targetUser.namelocked})`;\n\t\t}\n\n\t\tconst unlocked = Punishments.unnamelock(target);\n\n\t\tif (!unlocked) {\n\t\t\treturn this.errorReply(`User '${target}' is not namelocked.`);\n\t\t}\n\n\t\tthis.addGlobalModAction(`${unlocked} was unnamelocked by ${user.name}.${reason}`);\n\t\tif (!reason) this.globalModlog(\"UNNAMELOCK\", toID(target));\n\t\tif (targetUser) targetUser.popup(`${user.name} has unnamelocked you.`);\n\t},\n\tunnamelockhelp: [`/unnamelock [username] - Unnamelocks the user. Requires: % @ &`],\n\n\thidetextalts: 'hidetext',\n\thidealttext: 'hidetext',\n\thidealtstext: 'hidetext',\n\thtext: 'hidetext',\n\tforcehidetext: 'hidetext',\n\thidelines: 'hidetext',\n\thlines: 'hidetext',\n\tcleartext: 'hidetext',\n\tctext: 'hidetext',\n\tclearaltstext: 'hidetext',\n\tclearlines: 'hidetext',\n\tforcecleartext: 'hidetext',\n\thidetext(target, room, user, connection, cmd) {\n\t\tif (!target) return this.parse(`/help hidetext`);\n\t\troom = this.requireRoom();\n\t\tconst hasLineCount = cmd.includes('lines');\n\t\tconst hideRevealButton = cmd.includes('clear') || cmd === 'ctext';\n\t\tlet {targetUser, inputUsername, targetUsername: name, rest: reason} = this.splitUser(target);\n\t\tlet lineCount = 0;\n\t\tif (/^[0-9]+\\s*(,|$)/.test(reason)) {\n\t\t\tif (hasLineCount) {\n\t\t\t\tlet lineCountString;\n\t\t\t\t[lineCountString, reason] = Utils.splitFirst(reason, ',').map(p => p.trim());\n\t\t\t\tlineCount = parseInt(lineCountString);\n\t\t\t} else if (!cmd.includes('force')) {\n\t\t\t\treturn this.errorReply(`Your reason was a number; use /hidelines if you wanted to clear a specific number of lines, or /forcehidetext if you really wanted your reason to be a number.`);\n\t\t\t}\n\t\t}\n\t\tconst showAlts = cmd.includes('alt');\n\t\tif (!lineCount && hasLineCount) {\n\t\t\treturn this.errorReply(`You must specify a number of messages to clear. To clear all messages, use /hidetext.`);\n\t\t}\n\t\tif (reason.length > MAX_REASON_LENGTH) {\n\t\t\treturn this.errorReply(`The reason is too long. It cannot exceed ${MAX_REASON_LENGTH} characters.`);\n\t\t}\n\n\t\tif (!targetUser && !room.log.hasUsername(name)) {\n\t\t\treturn this.errorReply(`User ${name} not found or has no roomlogs.`);\n\t\t}\n\t\tif (lineCount && showAlts) {\n\t\t\treturn this.errorReply(`You can't specify a line count when using /hidealtstext.`);\n\t\t}\n\t\tconst userid = toID(inputUsername);\n\n\t\tthis.checkCan('mute', null, room);\n\n\t\t// if the user hiding their own text, it would clear the \"cleared\" message,\n\t\t// so we can't attribute it in that case\n\t\t// and sending the message after `|unlink|` puts the \"show lines\" button in the wrong place\n\t\tconst sender = user === targetUser ? null : user;\n\n\t\tlet message = '';\n\t\tif (targetUser && showAlts) {\n\t\t\tmessage = `${name}'s alts messages were cleared from ${room.title} by ${user.name}.${(reason ? ` (${reason})` : ``)}`;\n\t\t\troom.sendByUser(sender, message);\n\t\t\tthis.modlog('HIDEALTSTEXT', targetUser, reason, {noip: 1});\n\t\t\troom.hideText([\n\t\t\t\tuserid,\n\t\t\t\t...targetUser.previousIDs,\n\t\t\t\t...targetUser.getAltUsers(true).map((curUser: User) => curUser.getLastId()),\n\t\t\t] as ID[]);\n\t\t} else {\n\t\t\tif (lineCount > 0) {\n\t\t\t\tmessage = `${lineCount} of ${name}'s messages were cleared from ${room.title} by ${user.name}.${(reason ? ` (${reason})` : ``)}`;\n\t\t\t\troom.sendByUser(sender, message);\n\t\t\t} else {\n\t\t\t\tmessage = `${name}'s messages were cleared from ${room.title} by ${user.name}.${(reason ? ` (${reason})` : ``)}`;\n\t\t\t\troom.sendByUser(sender, message);\n\t\t\t}\n\t\t\tthis.modlog('HIDETEXT', targetUser || userid, reason, {noip: 1, noalts: 1});\n\t\t\troom.hideText([userid], lineCount, hideRevealButton);\n\t\t\tthis.roomlog(`|c|${user.getIdentity()}|/log ${message}`);\n\t\t}\n\t},\n\thidetexthelp: [\n\t\t`/hidetext [username], [optional reason] - Removes a user's messages from chat, with an optional reason. Requires: % @ # &`,\n\t\t`/hidealtstext [username], [optional reason] - Removes a user's messages and their alternate accounts' messages from the chat, with an optional reason. Requires: % @ # &`,\n\t\t`/hidelines [username], [number], [optional reason] - Removes the [number] most recent messages from a user, with an optional reason. Requires: % @ # &`,\n\t\t`Use /cleartext, /clearaltstext, and /clearlines to remove messages without displaying a button to reveal them.`,\n\t],\n\n\tab: 'blacklist',\n\tbl: 'blacklist',\n\tforceblacklist: 'blacklist',\n\tforcebl: 'blacklist',\n\tpermanentblacklist: 'blacklist',\n\tpermablacklist: 'blacklist',\n\tpermabl: 'blacklist',\n\tblacklist(target, room, user, connection, cmd) {\n\t\troom = this.requireRoom();\n\t\tif (!target) return this.parse('/help blacklist');\n\t\tthis.checkChat();\n\t\tif (toID(target) === 'show') return this.errorReply(`You're looking for /showbl`);\n\n\t\tconst {targetUser, targetUsername, rest: reason} = this.splitUser(target);\n\t\tif (!targetUser) {\n\t\t\tthis.errorReply(`User ${targetUsername} not found.`);\n\t\t\treturn this.errorReply(`If you want to blacklist an offline account by name (not IP), consider /blacklistname`);\n\t\t}\n\t\tthis.checkCan('editroom', targetUser, room);\n\t\tif (!room.persist) {\n\t\t\treturn this.errorReply(`This room is not going to last long enough for a blacklist to matter - just ban the user`);\n\t\t}\n\t\tconst punishment = Punishments.isRoomBanned(targetUser, room.roomid);\n\t\tif (punishment && punishment.type === 'BLACKLIST') {\n\t\t\treturn this.errorReply(`This user is already blacklisted from this room.`);\n\t\t}\n\t\tconst force = cmd === 'forceblacklist' || cmd === 'forcebl';\n\t\tif (targetUser.trusted) {\n\t\t\tif (!force) {\n\t\t\t\treturn this.sendReply(\n\t\t\t\t\t`${targetUser.name} is a trusted user. If you are sure you would like to blacklist them use /forceblacklist.`\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (force) {\n\t\t\treturn this.errorReply(`Use /blacklist; ${targetUser.name} is not a trusted user.`);\n\t\t}\n\t\tif (!reason && REQUIRE_REASONS) {\n\t\t\treturn this.errorReply(`Blacklists require a reason.`);\n\t\t}\n\t\tif (reason.length > MAX_REASON_LENGTH) {\n\t\t\treturn this.errorReply(`The reason is too long. It cannot exceed ${MAX_REASON_LENGTH} characters.`);\n\t\t}\n\t\tconst name = targetUser.getLastName();\n\t\tconst userid = targetUser.getLastId();\n\n\t\tif (targetUser.trusted && room.settings.isPrivate !== true) {\n\t\t\tMonitor.log(`[CrisisMonitor] Trusted user ${targetUser.name}${targetUser.trusted !== targetUser.id ? ` (${targetUser.trusted})` : ''} was blacklisted from ${room.roomid} by ${user.name}, and should probably be demoted.`);\n\t\t}\n\n\t\tif (targetUser.id in room.users || user.can('lock')) {\n\t\t\ttargetUser.popup(\n\t\t\t\t`|modal||html|

${Utils.escapeHTML(user.name)} has blacklisted you from the room ${room.roomid}${(room.subRooms ? ` and its subrooms` : '')}. Reason: ${Utils.escapeHTML(reason)}

` +\n\t\t\t\t`

To appeal the ban, PM the staff member that blacklisted you${room.persist ? ` or a room owner.

` : `.

`}`\n\t\t\t);\n\t\t}\n\n\n\t\tconst expireTime = cmd.includes('perma') ? Date.now() + (10 * 365 * 24 * 60 * 60 * 1000) : null;\n\t\tconst action = expireTime ? 'PERMABLACKLIST' : 'BLACKLIST';\n\n\t\tthis.privateModAction(\n\t\t\t`${name} was blacklisted from ${room.title} by ${user.name}${expireTime ? ' for ten years' : ''}.` +\n\t\t\t`${reason ? ` (${reason})` : ''}`\n\t\t);\n\n\t\tconst affected = Punishments.roomBlacklist(room, targetUser, expireTime, null, reason);\n\n\t\tif (!room.settings.isPrivate && room.persist) {\n\t\t\tconst acAccount = (targetUser.autoconfirmed !== userid && targetUser.autoconfirmed);\n\t\t\tlet displayMessage = '';\n\t\t\tif (affected.length > 1) {\n\t\t\t\tdisplayMessage = `${name}'s ${(acAccount ? ` ac account: ${acAccount},` : '')} blacklisted alts: ${affected.slice(1).map(curUser => curUser.getLastName()).join(\", \")}`;\n\t\t\t\tthis.privateModAction(displayMessage);\n\t\t\t} else if (acAccount) {\n\t\t\t\tdisplayMessage = `${name}'s ac account: ${acAccount}`;\n\t\t\t\tthis.privateModAction(displayMessage);\n\t\t\t}\n\t\t}\n\n\t\tif (!room.settings.isPrivate && room.persist) {\n\t\t\tthis.globalModlog(action, targetUser, reason);\n\t\t} else {\n\t\t\t// Room modlog only\n\t\t\tthis.modlog(action, targetUser, reason);\n\t\t}\n\t\treturn true;\n\t},\n\tblacklisthelp: [\n\t\t`/blacklist [username], [reason] - Blacklists the user from the room you are in for a year. Requires: # &`,\n\t\t`/permablacklist OR /permabl - blacklist a user for 10 years. Requires: # &`,\n\t\t`/unblacklist [username] - Unblacklists the user from the room you are in. Requires: # &`,\n\t\t`/showblacklist OR /showbl - show a list of blacklisted users in the room. Requires: % @ # &`,\n\t\t`/expiringblacklists OR /expiringbls - show a list of blacklisted users from the room whose blacklists are expiring in 3 months or less. Requires: % @ # &`,\n\t],\n\n\tforcebattleban: 'battleban',\n\tasync battleban(target, room, user, connection, cmd) {\n\t\troom = this.requireRoom();\n\t\tif (!target) return this.parse(`/help battleban`);\n\n\t\tconst {targetUser, targetUsername, rest: reason} = this.splitUser(target);\n\t\tif (!targetUser) return this.errorReply(`User ${targetUsername} not found.`);\n\t\tif (target.length > MAX_REASON_LENGTH) {\n\t\t\treturn this.errorReply(`The reason is too long. It cannot exceed ${MAX_REASON_LENGTH} characters.`);\n\t\t}\n\t\tif (!reason) {\n\t\t\treturn this.errorReply(`Battle bans require a reason.`);\n\t\t}\n\t\tconst includesUrl = reason.includes(`.${Config.routes.root}/`); // lgtm [js/incomplete-url-substring-sanitization]\n\t\tif (!room.battle && !includesUrl && cmd !== 'forcebattleban') {\n\t\t\t return this.errorReply(`Battle bans require a battle replay if used outside of a battle; if the battle has expired, use /forcebattleban.`);\n\t\t}\n\t\tif (!user.can('rangeban', targetUser)) {\n\t\t\tthis.errorReply(`Battlebans have been deprecated. Alternatives:`);\n\t\t\tthis.errorReply(`- timerstalling and bragging about it: lock`);\n\t\t\tthis.errorReply(`- other timerstalling: they're not timerstalling, leave them alone`);\n\t\t\tthis.errorReply(`- bad nicknames: lock, locks prevent nicknames from appearing; you should always have been locking for this`);\n\t\t\tthis.errorReply(`- ladder cheating: gban, get a moderator if necessary`);\n\t\t\tthis.errorReply(`- serious ladder cheating: permaban, get an administrator`);\n\t\t\tthis.errorReply(`- other: get an administrator`);\n\t\t\treturn;\n\t\t}\n\t\tif (Punishments.isBattleBanned(targetUser)) {\n\t\t\treturn this.errorReply(`User '${targetUser.name}' is already banned from battling.`);\n\t\t}\n\t\tthis.privateGlobalModAction(`${targetUser.name} was banned from starting new battles by ${user.name} (${reason})`);\n\n\t\tif (targetUser.trusted) {\n\t\t\tMonitor.log(`[CrisisMonitor] Trusted user ${targetUser.name} was banned from battling by ${user.name}, and should probably be demoted.`);\n\t\t}\n\n\t\tthis.globalModlog(\"BATTLEBAN\", targetUser, reason);\n\t\tLadders.cancelSearches(targetUser);\n\t\tawait Punishments.battleban(targetUser, null, null, reason);\n\t\ttargetUser.popup(`|modal|${user.name} has prevented you from starting new battles for 2 days (${reason})`);\n\n\t\t// Automatically upload replays as evidence/reference to the punishment\n\t\tif (room.battle) this.parse('/savereplay forpunishment');\n\t\treturn true;\n\t},\n\tbattlebanhelp: [\n\t\t`/battleban [username], [reason] - [DEPRECATED]`,\n\t\t`Prevents the user from starting new battles for 2 days and shows them the [reason]. Requires: &`,\n\t],\n\n\tunbattleban(target, room, user) {\n\t\tif (!target) return this.parse('/help unbattleban');\n\t\tthis.checkCan('lock');\n\n\t\tconst targetUser = Users.get(target);\n\t\tconst unbanned = Punishments.unbattleban(target);\n\n\t\tif (unbanned) {\n\t\t\tthis.addModAction(`${unbanned} was allowed to battle again by ${user.name}.`);\n\t\t\tthis.globalModlog(\"UNBATTLEBAN\", toID(target));\n\t\t\tif (targetUser) targetUser.popup(`${user.name} has allowed you to battle again.`);\n\t\t} else {\n\t\t\tthis.errorReply(`User ${target} is not banned from battling.`);\n\t\t}\n\t},\n\tunbattlebanhelp: [`/unbattleban [username] - [DEPRECATED] Allows a user to battle again. Requires: % @ &`],\n\n\tmonthgroupchatban: 'groupchatban',\n\tmonthgcban: 'groupchatban',\n\tgcban: 'groupchatban',\n\tasync groupchatban(target, room, user, connection, cmd) {\n\t\troom = this.requireRoom();\n\t\tif (!target) return this.parse(`/help groupchatban`);\n\t\tif (!user.can('rangeban')) {\n\t\t\treturn this.errorReply(\n\t\t\t\t`/groupchatban has been deprecated.\\n` +\n\t\t\t\t`For future groupchat misuse, lock the creator, it will take away their trusted status and their ability to make groupchats.`\n\t\t\t);\n\t\t}\n\n\t\tconst {targetUser, targetUsername, rest: reason} = this.splitUser(target);\n\t\tif (!targetUser) return this.errorReply(`User ${targetUsername} not found.`);\n\t\tif (target.length > MAX_REASON_LENGTH) {\n\t\t\treturn this.errorReply(`The reason is too long. It cannot exceed ${MAX_REASON_LENGTH} characters.`);\n\t\t}\n\n\t\tconst isMonth = cmd.startsWith('month');\n\n\t\tif (!isMonth && Punishments.isGroupchatBanned(targetUser)) {\n\t\t\treturn this.errorReply(`User '${targetUser.name}' is already banned from using groupchats.`);\n\t\t}\n\n\t\tconst reasonText = reason ? `: ${reason}` : ``;\n\t\tthis.privateGlobalModAction(`${targetUser.name} was banned from using groupchats for a ${isMonth ? 'month' : 'week'} by ${user.name}${reasonText}.`);\n\n\t\tif (targetUser.trusted) {\n\t\t\tMonitor.log(`[CrisisMonitor] Trusted user ${targetUser.name} was banned from using groupchats by ${user.name}, and should probably be demoted.`);\n\t\t}\n\n\t\tconst createdGroupchats = await Punishments.groupchatBan(\n\t\t\ttargetUser, (isMonth ? Date.now() + 30 * DAY : null), null, reason\n\t\t);\n\t\ttargetUser.popup(`|modal|${user.name} has banned you from using groupchats for a ${isMonth ? 'month' : 'week'}${reasonText}`);\n\t\tthis.globalModlog(\"GROUPCHATBAN\", targetUser, ` by ${user.id}${reasonText}`);\n\n\t\tfor (const roomid of createdGroupchats) {\n\t\t\tconst targetRoom = Rooms.get(roomid);\n\t\t\tif (!targetRoom) continue;\n\t\t\tconst participants = targetRoom.warnParticipants?.(\n\t\t\t\t`This groupchat (${targetRoom.title}) has been deleted due to inappropriate conduct by its creator, ${targetUser.name}.` +\n\t\t\t\t` Do not attempt to recreate it, or you may be punished.${reason ? ` (reason: ${reason})` : ``}`\n\t\t\t);\n\n\t\t\tif (participants) {\n\t\t\t\tconst modlogEntry = {\n\t\t\t\t\taction: 'NOTE',\n\t\t\t\t\tloggedBy: user.id,\n\t\t\t\t\tisGlobal: true,\n\t\t\t\t\tnote: `participants in ${roomid} (creator: ${targetUser.id}): ${participants.join(', ')}`,\n\t\t\t\t};\n\t\t\t\ttargetRoom.modlog(modlogEntry);\n\t\t\t}\n\n\t\t\ttargetRoom.destroy();\n\t\t}\n\t},\n\tgroupchatbanhelp: [\n\t\t`/groupchatban [user], [optional reason]`,\n\t\t`/monthgroupchatban [user], [optional reason]`,\n\t\t`Bans the user from joining or creating groupchats for a week (or month). Requires: % @ &`,\n\t],\n\n\tungcban: 'ungroupchatban',\n\tgcunban: 'ungroupchatban',\n\tgroucphatunban: 'ungroupchatban',\n\tungroupchatban(target, room, user) {\n\t\tif (!target) return this.parse('/help ungroupchatban');\n\t\tthis.checkCan('lock');\n\n\t\tconst targetUser = Users.get(target);\n\t\tconst unbanned = Punishments.groupchatUnban(targetUser || toID(target));\n\n\t\tif (unbanned) {\n\t\t\tthis.addGlobalModAction(`${unbanned} was ungroupchatbanned by ${user.name}.`);\n\t\t\tthis.globalModlog(\"UNGROUPCHATBAN\", toID(target), ` by ${user.id}`);\n\t\t\tif (targetUser) targetUser.popup(`${user.name} has allowed you to use groupchats again.`);\n\t\t} else {\n\t\t\tthis.errorReply(`User ${target} is not banned from using groupchats.`);\n\t\t}\n\t},\n\tungroupchatbanhelp: [`/ungroupchatban [user] - Allows a groupchatbanned user to use groupchats again. Requires: % @ &`],\n\n\tnameblacklist: 'blacklistname',\n\tpermablacklistname: 'blacklistname',\n\tblacklistname(target, room, user) {\n\t\troom = this.requireRoom();\n\t\tif (!target) return this.parse('/help blacklistname');\n\t\tthis.checkChat();\n\t\tthis.checkCan('editroom', null, room);\n\t\tif (!room.persist) {\n\t\t\treturn this.errorReply(\"This room is not going to last long enough for a blacklist to matter - just ban the user\");\n\t\t}\n\n\t\tconst [targetStr, reason] = target.split('|').map(val => val.trim());\n\t\tif (!targetStr || (!reason && REQUIRE_REASONS)) {\n\t\t\treturn this.errorReply(\"Usage: /blacklistname name1, name2, ... | reason\");\n\t\t}\n\n\t\tconst targets = targetStr.split(',').map(s => toID(s));\n\n\t\tconst duplicates = targets.filter(userid => (\n\t\t\t// can be asserted, room should always exist\n\t\t\tPunishments.roomUserids.nestedGetByType(room!.roomid, userid, 'BLACKLIST')\n\t\t));\n\t\tif (duplicates.length) {\n\t\t\treturn this.errorReply(`[${duplicates.join(', ')}] ${Chat.plural(duplicates, \"are\", \"is\")} already blacklisted.`);\n\t\t}\n\t\tconst expireTime = this.cmd.includes('perma') ? Date.now() + (10 * 365 * 24 * 60 * 60 * 1000) : null;\n\t\tconst action = expireTime ? 'PERMANAMEBLACKLIST' : 'NAMEBLACKLIST';\n\n\t\tfor (const userid of targets) {\n\t\t\tif (!userid) return this.errorReply(`User '${userid}' is not a valid userid.`);\n\t\t\tif (!Users.Auth.hasPermission(user, 'ban', room.auth.get(userid), room)) {\n\t\t\t\treturn this.errorReply(`/blacklistname - Access denied: ${userid} is of equal or higher authority than you.`);\n\t\t\t}\n\n\t\t\tPunishments.roomBlacklist(room, userid, expireTime, null, reason);\n\n\t\t\tconst trusted = Users.isTrusted(userid);\n\t\t\tif (trusted && room.settings.isPrivate !== true) {\n\t\t\t\tMonitor.log(`[CrisisMonitor] Trusted user ${userid}${(trusted !== userid ? ` (${trusted})` : ``)} was nameblacklisted from ${room.roomid} by ${user.name}, and should probably be demoted.`);\n\t\t\t}\n\t\t\tif (!room.settings.isPrivate && room.persist) {\n\t\t\t\tthis.globalModlog(action, userid, reason);\n\t\t\t}\n\t\t}\n\n\t\tthis.privateModAction(\n\t\t\t`${targets.join(', ')}${Chat.plural(targets, \" were\", \" was\")} nameblacklisted from ${room.title} by ${user.name}` +\n\t\t\t`${expireTime ? ' for ten years' : ''}.`\n\t\t);\n\t\treturn true;\n\t},\n\tblacklistnamehelp: [\n\t\t`/blacklistname OR /nameblacklist [name1, name2, etc.] | reason - Blacklists all name(s) from the room you are in for a year. Requires: # &`,\n\t\t`/permablacklistname [name1, name2, etc.] | reason - Blacklists all name(s) from the room you are in for 10 years. Requires: # &`,\n\t],\n\n\tunab: 'unblacklist',\n\tunblacklist(target, room, user) {\n\t\troom = this.requireRoom();\n\t\tif (!target) return this.parse('/help unblacklist');\n\t\tthis.checkCan('editroom', null, room);\n\n\t\tconst name = Punishments.roomUnblacklist(room, target);\n\n\t\tif (name) {\n\t\t\tthis.privateModAction(`${name} was unblacklisted by ${user.name}.`);\n\t\t\tif (!room.settings.isPrivate && room.persist) {\n\t\t\t\tthis.globalModlog(\"UNBLACKLIST\", name);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.errorReply(`User '${target}' is not blacklisted.`);\n\t\t}\n\t},\n\tunblacklisthelp: [`/unblacklist [username] - Unblacklists the user from the room you are in. Requires: # &`],\n\n\tunblacklistall(target, room, user) {\n\t\troom = this.requireRoom();\n\t\tthis.checkCan('editroom', null, room);\n\n\t\tif (!target) {\n\t\t\tuser.lastCommand = '/unblacklistall';\n\t\t\tthis.errorReply(\"THIS WILL UNBLACKLIST ALL BLACKLISTED USERS IN THIS ROOM.\");\n\t\t\tthis.errorReply(\"To confirm, use: /unblacklistall confirm\");\n\t\t\treturn;\n\t\t}\n\t\tif (user.lastCommand !== '/unblacklistall' || target !== 'confirm') {\n\t\t\treturn this.parse('/help unblacklistall');\n\t\t}\n\t\tuser.lastCommand = '';\n\t\tconst unblacklisted = Punishments.roomUnblacklistAll(room);\n\t\tif (!unblacklisted) return this.errorReply(\"No users are currently blacklisted in this room to unblacklist.\");\n\t\tthis.addModAction(`All blacklists in this room have been lifted by ${user.name}.`);\n\t\tthis.modlog('UNBLACKLISTALL');\n\t\tthis.roomlog(`Unblacklisted users: ${unblacklisted.join(', ')}`);\n\t},\n\tunblacklistallhelp: [`/unblacklistall - Unblacklists all blacklisted users in the current room. Requires: # &`],\n\n\texpiringbls: 'showblacklist',\n\texpiringblacklists: 'showblacklist',\n\tblacklists: 'showblacklist',\n\tshowbl: 'showblacklist',\n\tshowblacklist(target, room, user, connection, cmd) {\n\t\tif (target) room = Rooms.search(target)!;\n\t\tif (!room) return this.errorReply(`The room \"${target}\" was not found.`);\n\t\tthis.checkCan('mute', null, room);\n\t\tconst SOON_EXPIRING_TIME = 3 * 30 * 24 * 60 * 60 * 1000; // 3 months\n\n\t\tif (!room.persist) return this.errorReply(\"This room does not support blacklists.\");\n\n\t\tconst roomUserids = Punishments.roomUserids.get(room.roomid);\n\t\tif (!roomUserids || roomUserids.size === 0) {\n\t\t\treturn this.sendReply(\"This room has no blacklisted users.\");\n\t\t}\n\t\tconst blMap = new Map();\n\t\tlet ips = '';\n\n\t\tfor (const [userid, punishmentList] of roomUserids) {\n\t\t\tfor (const punishment of punishmentList) {\n\t\t\t\tconst {type, id, expireTime} = punishment;\n\t\t\t\tif (type === 'BLACKLIST') {\n\t\t\t\t\tif (!blMap.has(id)) blMap.set(id, [expireTime]);\n\t\t\t\t\tif (id !== userid) blMap.get(id)!.push(userid);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (user.can('ip')) {\n\t\t\tconst roomIps = Punishments.roomIps.get(room.roomid);\n\n\t\t\tif (roomIps) {\n\t\t\t\tips = '/ips';\n\t\t\t\tfor (const [ip, punishments] of roomIps) {\n\t\t\t\t\tfor (const punishment of punishments) {\n\t\t\t\t\t\tconst {type, id} = punishment;\n\t\t\t\t\t\tif (type === 'BLACKLIST') {\n\t\t\t\t\t\t\tif (!blMap.has(id)) blMap.set(id, []);\n\t\t\t\t\t\t\tblMap.get(id)!.push(ip);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst soonExpiring = (cmd === 'expiringblacklists' || cmd === 'expiringbls');\n\t\tlet buf = Utils.html`Blacklist for ${room.title}${soonExpiring ? ` (expiring within 3 months)` : ''}:
`;\n\n\t\tfor (const [userid, data] of blMap) {\n\t\t\tconst [expireTime, ...alts] = data;\n\t\t\tif (soonExpiring && expireTime > Date.now() + SOON_EXPIRING_TIME) continue;\n\t\t\tconst expiresIn = new Date(expireTime).getTime() - Date.now();\n\t\t\tconst expiresDays = Math.round(expiresIn / 1000 / 60 / 60 / 24);\n\t\t\tbuf += `- ${userid}, for ${Chat.count(expiresDays, \"days\")}`;\n\t\t\tif (alts.length) buf += `, alts${ips}: ${alts.join(', ')}`;\n\t\t\tbuf += `
`;\n\t\t}\n\n\t\tthis.sendReplyBox(buf);\n\t},\n\tshowblacklisthelp: [\n\t\t`/showblacklist OR /showbl - show a list of blacklisted users in the room. Requires: % @ # &`,\n\t\t`/expiringblacklists OR /expiringbls - show a list of blacklisted users from the room whose blacklists are expiring in 3 months or less. Requires: % @ # &`,\n\t],\n};\n"], "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,iBAAoB;AACpB,2BAAwC;AAXxC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA,MAAM,oBAAoB;AAC1B,MAAM,cAAc,IAAI,KAAK;AAC7B,MAAM,kBAAkB,KAAK,KAAK;AAClC,MAAM,MAAM,KAAK,KAAK,KAAK;AAG3B,MAAM,kBAAkB;AAajB,SAAS,WACf,UACA,MACA,QACA,QACA,UACA,OACC;AACD,QAAM,aAAa,MAAM,SAAS,MAAM;AACxC,aAAW,YAAY;AACvB,MAAI,CAAC;AAAU;AAEf,MAAI,OAAO,SAAS,IAAI;AACvB,UAAM,IAAI,KAAK,aAAa,SAAS,sDAAsD;AAAA,EAC5F;AACA,MAAI,CAAC,cAAc,CAAC,MAAM,gBAAgB,MAAM,KAAK,CAAC,OAAO;AAC5D,UAAM,IAAI,KAAK,aAAa,SAAS,kEAAkE;AAAA,EACxG;AACA,MAAI,cAAc,CAAC,WAAW,YAAY;AACzC,UAAM,IAAI,KAAK,aAAa,SAAS,sDAAsD;AAAA,EAC5F;AAEA,MAAI,gBAA2C,KAAK,KAAK,UAAU,MAAM;AACzE,MAAI,KAAK,KAAK,IAAI,MAAM,KAAK,kBAAkB,MAAM,KAAK,cAAc,GAAG;AAC1E,oBAAgB;AAAA,EACjB;AACA,QAAM,eAAe,MAAM,KAAK,SAAS,aAAa;AACtD,QAAM,mBAAmB,aAAa,QAAQ;AAE9C,QAAM,YAAY,OAAO,OAAO,MAAM;AAEtC,MAAI,kBAAkB,QAAQ;AAC7B,UAAM,IAAI,KAAK,aAAa,SAAS,0BAA0B,WAAW,QAAQ,UAAU,8B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