Jofthomas's picture
Jofthomas HF staff
Upload 4781 files
5c2ed06 verified
{
"version": 3,
"sources": ["../../../server/chat-plugins/auction.ts"],
"sourcesContent": ["/**\n * Chat plugin to run auctions for team tournaments.\n *\n * Based on the original Scrappie auction system\n * https://github.com/Hidden50/Pokemon-Showdown-Node-Bot/blob/master/commands/base-auctions.js\n * @author Karthik\n */\nimport { Net, Utils } from '../../lib';\n\ninterface Player {\n\tid: ID;\n\tname: string;\n\tteam?: Team;\n\tprice: number;\n\ttiersPlayed: string[];\n\ttiersNotPlayed: string[];\n}\n\ninterface Manager {\n\tid: ID;\n\tteam: Team;\n}\n\nclass Team {\n\tid: ID;\n\tname: string;\n\tplayers: Player[];\n\tcredits: number;\n\tsuspended: boolean;\n\tprivate auction: Auction;\n\tconstructor(name: string, auction: Auction) {\n\t\tthis.id = toID(name);\n\t\tthis.name = name;\n\t\tthis.players = [];\n\t\tthis.credits = auction.startingCredits;\n\t\tthis.suspended = false;\n\t\tthis.auction = auction;\n\t}\n\n\tgetManagers() {\n\t\treturn [...this.auction.managers.values()]\n\t\t\t.filter(m => m.team === this)\n\t\t\t.map(m => Users.getExact(m.id)?.name || m.id);\n\t}\n\n\taddPlayer(player: Player, price = 0) {\n\t\tplayer.team?.removePlayer(player);\n\t\tthis.players.push(player);\n\t\tthis.credits -= price;\n\t\tplayer.team = this;\n\t\tplayer.price = price;\n\t}\n\n\tremovePlayer(player: Player) {\n\t\tconst pIndex = this.players.indexOf(player);\n\t\tif (pIndex === -1) return;\n\t\tthis.players.splice(pIndex, 1);\n\t\tdelete player.team;\n\t\tplayer.price = 0;\n\t}\n\n\tisSuspended() {\n\t\treturn this.suspended || (\n\t\t\tthis.auction.type === 'snake' ?\n\t\t\t\tthis.players.length >= this.auction.minPlayers :\n\t\t\t\t(\n\t\t\t\t\tthis.credits < this.auction.minBid ||\n\t\t\t\t\t(this.auction.maxPlayers && this.players.length >= this.auction.maxPlayers)\n\t\t\t\t)\n\t\t);\n\t}\n\n\tmaxBid(credits = this.credits) {\n\t\treturn credits + this.auction.minBid * Math.min(0, this.players.length - this.auction.minPlayers + 1);\n\t}\n}\n\nfunction parseCredits(amount: string) {\n\tlet credits = Number(amount.replace(',', '.'));\n\tif (Math.abs(credits) < 500) credits *= 1000;\n\tif (!credits || credits % 500 !== 0) {\n\t\tthrow new Chat.ErrorMessage(`The amount of credits must be a multiple of 500.`);\n\t}\n\treturn credits;\n}\n\nexport class Auction extends Rooms.SimpleRoomGame {\n\toverride readonly gameid = 'auction' as ID;\n\towners = new Set<ID>();\n\tteams = new Map<string, Team>();\n\tmanagers = new Map<string, Manager>();\n\tauctionPlayers = new Map<string, Player>();\n\n\tstartingCredits: number;\n\tminBid = 3000;\n\tminPlayers = 10;\n\tmaxPlayers = 0;\n\ttype: 'auction' | 'blind' | 'snake' = 'auction';\n\n\tlastQueue: Team[] | null = null;\n\tqueue: Team[] = [];\n\tnomTimer: NodeJS.Timeout = null!;\n\tnomTimeLimit = 0;\n\tnomTimeRemaining = 0;\n\tbidTimer: NodeJS.Timeout = null!;\n\tbidTimeLimit = 10;\n\tbidTimeRemaining = 10;\n\tnominatingTeam: Team = null!;\n\tnominatedPlayer: Player = null!;\n\thighestBidder: Team = null!;\n\thighestBid = 0;\n\t/** Used for blind mode */\n\tbidsPlaced = new Map<Team, number>();\n\tstate: 'setup' | 'nom' | 'bid' = 'setup';\n\tconstructor(room: Room, startingCredits = 100000) {\n\t\tsuper(room);\n\t\tthis.title = 'Auction';\n\t\tthis.startingCredits = startingCredits;\n\t}\n\n\tsendMessage(message: string) {\n\t\tthis.room.add(`|c|~|${message}`).update();\n\t}\n\n\tsendHTMLBox(htmlContent: string) {\n\t\tthis.room.add(`|html|<div class=\"infobox\">${htmlContent}</div>`).update();\n\t}\n\n\tcheckOwner(user: User) {\n\t\tif (!this.owners.has(user.id) && !Users.Auth.hasPermission(user, 'declare', null, this.room)) {\n\t\t\tthrow new Chat.ErrorMessage(`You must be an auction owner to use this command.`);\n\t\t}\n\t}\n\n\taddOwners(users: string[]) {\n\t\tfor (const name of users) {\n\t\t\tconst user = Users.getExact(name);\n\t\t\tif (!user) throw new Chat.ErrorMessage(`User \"${name}\" not found.`);\n\t\t\tif (this.owners.has(user.id)) throw new Chat.ErrorMessage(`${user.name} is already an auction owner.`);\n\t\t\tthis.owners.add(user.id);\n\t\t}\n\t}\n\n\tremoveOwners(users: string[]) {\n\t\tfor (const name of users) {\n\t\t\tconst id = toID(name);\n\t\t\tif (!this.owners.has(id)) throw new Chat.ErrorMessage(`User \"${name}\" is not an auction owner.`);\n\t\t\tthis.owners.delete(id);\n\t\t}\n\t}\n\n\tgenerateUsernameList(players: (string | Player)[], max = players.length, clickable = false) {\n\t\tlet buf = `<span style=\"font-size: 85%\">`;\n\t\tbuf += players.slice(0, max).map(p => {\n\t\t\tif (typeof p === 'object') {\n\t\t\t\treturn `<username ${clickable ? ' class=\"username\"' : ''}>${Utils.escapeHTML(p.name)}</username>`;\n\t\t\t}\n\t\t\treturn `<username${clickable ? ' class=\"username\"' : ''}>${Utils.escapeHTML(p)}</username>`;\n\t\t}).join(', ');\n\t\tif (players.length > max) {\n\t\t\tbuf += ` <span title=\"${players.slice(max).map(p => Utils.escapeHTML(typeof p === 'object' ? p.name : p)).join(', ')}\">(+${players.length - max})</span>`;\n\t\t}\n\t\tbuf += `</span>`;\n\t\treturn buf;\n\t}\n\n\tgeneratePriceList() {\n\t\tconst players = Utils.sortBy(this.getDraftedPlayers(), p => -p.price);\n\t\tlet buf = '';\n\t\tlet smogonExport = '';\n\n\t\tfor (const team of this.teams.values()) {\n\t\t\tlet table = `<table>`;\n\t\t\tfor (const player of players.filter(p => p.team === team)) {\n\t\t\t\ttable += Utils.html`<tr><td>${player.name}</td><td>${player.price}</td></tr>`;\n\t\t\t}\n\t\t\ttable += `</table>`;\n\t\t\tbuf += `<details><summary>${Utils.escapeHTML(team.name)}</summary>${table}</details><br/>`;\n\t\t\tif (this.ended) smogonExport += `[SPOILER=\"${team.name}\"]${table.replace(/<(.*?)>/g, '[$1]')}[/SPOILER]`;\n\t\t}\n\n\t\tlet table = `<table>`;\n\t\tfor (const player of players) {\n\t\t\ttable += Utils.html`<tr><td>${player.name}</td><td>${player.price}</td><td>${player.team!.name}</td></tr>`;\n\t\t}\n\t\ttable += `</table>`;\n\t\tbuf += `<details><summary>All</summary>${table}</details><br/>`;\n\t\tif (this.ended) {\n\t\t\tsmogonExport += `[SPOILER=\"All\"]${table.replace(/<(.*?)>/g, '[$1]')}[/SPOILER]`;\n\t\t\tbuf += Utils.html`<copytext value=\"${smogonExport}\">Copy Smogon Export</copytext>`;\n\t\t}\n\n\t\treturn buf;\n\t}\n\n\tgenerateAuctionTable() {\n\t\tconst queue = this.queue.filter(team => !team.isSuspended());\n\t\tlet buf = `<div class=\"ladder pad\"><table style=\"width: 100%\"><tr>${!this.ended ? `<th colspan=2>Order</th>` : ''}<th>Team</th>${this.type !== 'snake' ? `<th>Credits</th>` : ''}<th style=\"width: 100%\">Players</th></tr>`;\n\t\tfor (const team of this.teams.values()) {\n\t\t\tbuf += `<tr>`;\n\t\t\tif (!this.ended) {\n\t\t\t\tlet i1 = queue.indexOf(team) + 1;\n\t\t\t\tlet i2 = queue.lastIndexOf(team) + 1;\n\t\t\t\tif (i1 > queue.length / 2) {\n\t\t\t\t\t[i1, i2] = [i2, i1];\n\t\t\t\t}\n\t\t\t\tbuf += `<td align=\"center\" style=\"width: 15px\">${i1 || '-'}</td><td align=\"center\" style=\"width: 15px\">${i2 || '-'}</td>`;\n\t\t\t}\n\t\t\tbuf += `<td style=\"white-space: nowrap\"><strong>${Utils.escapeHTML(team.name)}</strong><br/>${this.generateUsernameList(team.getManagers(), 2, true)}</td>`;\n\t\t\tif (this.type !== 'snake') {\n\t\t\t\tbuf += `<td style=\"white-space: nowrap\">${team.credits.toLocaleString()}${team.maxBid() >= this.minBid ? `<br/><span style=\"font-size: 90%\">Max bid: ${team.maxBid().toLocaleString()}</span>` : ''}</td>`;\n\t\t\t}\n\t\t\tbuf += `<td title=\"${team.players.map(p => Utils.escapeHTML(p.name)).join(', ')}\"><div style=\"min-height: 32px${!this.ended ? `; height: 32px; overflow: hidden; resize: vertical` : ''}\"><span style=\"float: right\">${team.players.length}</span>${this.generateUsernameList(team.players)}</div></td>`;\n\t\t\tbuf += `</tr>`;\n\t\t}\n\t\tbuf += `</table></div>`;\n\n\t\tconst players = Utils.sortBy(this.getUndraftedPlayers(), p => p.name);\n\t\tconst tierArrays = new Map<string, Player[]>();\n\t\tfor (const player of players) {\n\t\t\tfor (const tier of player.tiersPlayed) {\n\t\t\t\tif (!tierArrays.has(tier)) tierArrays.set(tier, []);\n\t\t\t\ttierArrays.get(tier)!.push(player);\n\t\t\t}\n\t\t}\n\t\tconst sortedTiers = [...tierArrays.keys()].sort();\n\t\tif (sortedTiers.length) {\n\t\t\tbuf += `<details><summary>Remaining Players (${players.length})</summary>`;\n\t\t\tbuf += `<details><summary>All</summary>${this.generateUsernameList(players)}</details>`;\n\t\t\tbuf += `<details><summary>Tiers</summary><ul style=\"list-style-type: none\">`;\n\t\t\tfor (const tier of sortedTiers) {\n\t\t\t\tconst tierPlayers = tierArrays.get(tier)!;\n\t\t\t\tbuf += `<li><details><summary>${Utils.escapeHTML(tier)} (${tierPlayers.length})</summary>${this.generateUsernameList(tierPlayers)}</details></li>`;\n\t\t\t}\n\t\t\tbuf += `</ul></details></details>`;\n\t\t} else {\n\t\t\tbuf += `<details><summary>Remaining Players (${players.length})</summary>${this.generateUsernameList(players)}</details>`;\n\t\t}\n\t\tbuf += `<details><summary>Auction Settings</summary>`;\n\t\tbuf += `- Minimum bid: <b>${this.minBid.toLocaleString()}</b><br/>`;\n\t\tbuf += `- Minimum players per team: <b>${this.minPlayers}</b><br/>`;\n\t\tif (this.type !== 'snake') buf += `- Maximum players per team: <b>${this.maxPlayers || 'N/A'}</b><br/>`;\n\t\tbuf += `- Nom timer: <b>${this.nomTimeLimit ? `${this.nomTimeLimit}s` : 'Off'}</b><br/>`;\n\t\tif (this.type !== 'snake') buf += `- Bid timer: <b>${this.bidTimeLimit}s</b><br/>`;\n\t\tbuf += `- Auction type: <b>${this.type}</b><br/>`;\n\t\tbuf += `</details>`;\n\t\treturn buf;\n\t}\n\n\tsendBidInfo() {\n\t\tif (this.type === 'blind') return;\n\t\tlet buf = `<div class=\"infobox\">`;\n\t\tbuf += Utils.html`Player: <username>${this.nominatedPlayer.name}</username> `;\n\t\tbuf += `Top bid: <b>${this.highestBid}</b> `;\n\t\tbuf += Utils.html`Top bidder: <b>${this.highestBidder.name}</b><br/>`;\n\t\tbuf += Utils.html`Tiers Played: <b>${this.nominatedPlayer.tiersPlayed.length ? `${this.nominatedPlayer.tiersPlayed.join(', ')}` : 'N/A'}</b><br/>`;\n\t\tbuf += Utils.html`Tiers Not Played: <b>${this.nominatedPlayer.tiersNotPlayed.length ? `${this.nominatedPlayer.tiersNotPlayed.join(', ')}` : 'N/A'}</b>`;\n\t\tbuf += `</div>`;\n\t\tthis.room.add(`|uhtml|bid-${this.nominatedPlayer.id}|${buf}`).update();\n\t}\n\n\tsendTimer(change = false, nom = false) {\n\t\tlet buf = `<div class=\"infobox message-error\">`;\n\t\tbuf += `<i class=\"fa fa-hourglass-start\"></i> ${Chat.toDurationString((nom ? this.nomTimeRemaining : this.bidTimeRemaining) * 1000, { hhmmss: true }).slice(1)}`;\n\t\tbuf += `</div>`;\n\t\tthis.room.add(`|uhtml${change ? 'change' : ''}|timer|${buf}`).update();\n\t}\n\n\tsetMinBid(amount: number) {\n\t\tif (this.state !== 'setup') {\n\t\t\tthrow new Chat.ErrorMessage(`The minimum bid cannot be changed after the auction has started.`);\n\t\t}\n\t\tif (amount > 500000) throw new Chat.ErrorMessage(`The minimum bid must not exceed 500,000.`);\n\t\tthis.minBid = amount;\n\t}\n\n\tsetMinPlayers(amount: number) {\n\t\tif (this.state !== 'setup') {\n\t\t\tthrow new Chat.ErrorMessage(`The minimum number of players cannot be changed after the auction has started.`);\n\t\t}\n\t\tif (!amount || amount > 30) {\n\t\t\tthrow new Chat.ErrorMessage(`The minimum number of players must be between 1 and 30.`);\n\t\t}\n\t\tthis.minPlayers = amount;\n\t}\n\n\tsetMaxPlayers(amount: number) {\n\t\tif (this.type === 'snake') throw new Chat.ErrorMessage(`You only need to set minplayers for snake drafts.`);\n\t\tif (this.state !== 'setup') {\n\t\t\tthrow new Chat.ErrorMessage(`The maximum number of players cannot be changed after the auction has started.`);\n\t\t}\n\t\tthis.maxPlayers = amount;\n\t}\n\n\tsetNomTimeLimit(seconds: number) {\n\t\tif (this.state !== 'setup') {\n\t\t\tthrow new Chat.ErrorMessage(`The nomination time limit cannot be changed after the auction has started.`);\n\t\t}\n\t\tif (isNaN(seconds) || (seconds && (seconds < 7 || seconds > 300))) {\n\t\t\tthrow new Chat.ErrorMessage(`The nomination time limit must be between 7 and 300 seconds.`);\n\t\t}\n\t\tthis.nomTimeLimit = this.nomTimeRemaining = seconds;\n\t}\n\n\tsetBidTimeLimit(seconds: number) {\n\t\tif (this.state !== 'setup') {\n\t\t\tthrow new Chat.ErrorMessage(`The bid time limit cannot be changed after the auction has started.`);\n\t\t}\n\t\tif (!seconds || seconds < 7 || seconds > 120) {\n\t\t\tthrow new Chat.ErrorMessage(`The bid time limit must be between 7 and 120 seconds.`);\n\t\t}\n\t\tthis.bidTimeLimit = this.bidTimeRemaining = seconds;\n\t}\n\n\tsetType(auctionType: string) {\n\t\tif (this.state !== 'setup') {\n\t\t\tthrow new Chat.ErrorMessage(`The auction type cannot be changed after the auction has started.`);\n\t\t}\n\t\tif (!['auction', 'blind', 'snake'].includes(toID(auctionType))) {\n\t\t\tthrow new Chat.ErrorMessage(`Invalid auction type \"${auctionType}\". Valid types are \"auction\", \"blind\", and \"snake\".`);\n\t\t}\n\t\tthis.type = toID(auctionType) as 'auction' | 'blind' | 'snake';\n\t\tthis.nomTimeLimit = this.nomTimeRemaining = this.type === 'snake' ? 60 : 0;\n\t\tthis.bidTimeLimit = this.bidTimeRemaining = this.type === 'blind' ? 30 : 10;\n\t}\n\n\tgetUndraftedPlayers() {\n\t\treturn [...this.auctionPlayers.values()].filter(p => !p.team);\n\t}\n\n\tgetDraftedPlayers() {\n\t\treturn [...this.auctionPlayers.values()].filter(p => p.team);\n\t}\n\n\timportPlayers(data: string) {\n\t\tif (this.state !== 'setup') {\n\t\t\tthrow new Chat.ErrorMessage(`Player lists cannot be imported after the auction has started.`);\n\t\t}\n\t\tconst rows = data.replace('\\r', '').split('\\n');\n\t\tconst tierNames = rows.shift()!.split('\\t').slice(1);\n\t\tif (tierNames.some(tier => tier.length > 30)) {\n\t\t\tthrow new Chat.ErrorMessage(`Tier names must be 30 characters or less.`);\n\t\t}\n\n\t\tconst playerList = new Map<string, Player>();\n\t\tfor (const row of rows) {\n\t\t\tconst tiersPlayed = [];\n\t\t\tconst tiersNotPlayed = [];\n\t\t\tconst [name, ...tierData] = row.split('\\t');\n\t\t\tfor (let i = 0; i < tierData.length; i++) {\n\t\t\t\tswitch (tierData[i].trim().toLowerCase()) {\n\t\t\t\tcase 'y':\n\t\t\t\t\tif (!tierNames[i]) throw new Chat.ErrorMessage(`Invalid tier data found in the pastebin.`);\n\t\t\t\t\ttiersPlayed.push(tierNames[i]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'n':\n\t\t\t\t\tif (!tierNames[i]) throw new Chat.ErrorMessage(`Invalid tier data found in the pastebin.`);\n\t\t\t\t\ttiersNotPlayed.push(tierNames[i]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (name.length > 25) throw new Chat.ErrorMessage(`Player names must be 25 characters or less.`);\n\t\t\tconst player: Player = {\n\t\t\t\tid: toID(name),\n\t\t\t\tname: name.trim(),\n\t\t\t\tprice: 0,\n\t\t\t\ttiersPlayed,\n\t\t\t\ttiersNotPlayed,\n\t\t\t};\n\t\t\tplayerList.set(player.id, player);\n\t\t}\n\t\tthis.auctionPlayers = playerList;\n\t}\n\n\taddAuctionPlayer(name: string, tiersPlayed: string[], tiersNotPlayed: string[]) {\n\t\tif (this.state === 'bid') throw new Chat.ErrorMessage(`Players cannot be added during a nomination.`);\n\t\tif (name.length > 25) throw new Chat.ErrorMessage(`Player names must be 25 characters or less.`);\n\t\tif (tiersPlayed.some(tier => tier.length > 30) || tiersNotPlayed.some(tier => tier.length > 30)) {\n\t\t\tthrow new Chat.ErrorMessage(`Tier names must be 30 characters or less.`);\n\t\t}\n\t\tconst player: Player = {\n\t\t\tid: toID(name),\n\t\t\tname,\n\t\t\tprice: 0,\n\t\t\ttiersPlayed,\n\t\t\ttiersNotPlayed,\n\t\t};\n\t\tthis.auctionPlayers.set(player.id, player);\n\t\treturn player;\n\t}\n\n\tremoveAuctionPlayer(name: string) {\n\t\tif (this.state === 'bid') throw new Chat.ErrorMessage(`Players cannot be removed during a nomination.`);\n\t\tconst player = this.auctionPlayers.get(toID(name));\n\t\tif (!player) throw new Chat.ErrorMessage(`Player \"${name}\" not found.`);\n\t\tplayer.team?.removePlayer(player);\n\t\tthis.auctionPlayers.delete(player.id);\n\t\tif (this.state !== 'setup' && !this.getUndraftedPlayers().length) {\n\t\t\tthis.end('The auction has ended because there are no players remaining in the draft pool.');\n\t\t}\n\t\treturn player;\n\t}\n\n\tassignPlayer(name: string, teamName?: string) {\n\t\tif (this.state === 'bid') throw new Chat.ErrorMessage(`Players cannot be assigned during a nomination.`);\n\t\tconst player = this.auctionPlayers.get(toID(name));\n\t\tif (!player) throw new Chat.ErrorMessage(`Player \"${name}\" not found.`);\n\t\tif (teamName) {\n\t\t\tconst team = this.teams.get(toID(teamName));\n\t\t\tif (!team) throw new Chat.ErrorMessage(`Team \"${teamName}\" not found.`);\n\t\t\tteam.addPlayer(player);\n\t\t\tif (!this.getUndraftedPlayers().length) {\n\t\t\t\treturn this.end('The auction has ended because there are no players remaining in the draft pool.');\n\t\t\t}\n\t\t} else {\n\t\t\tplayer.team?.removePlayer(player);\n\t\t}\n\t}\n\n\taddTeam(name: string) {\n\t\tif (this.state !== 'setup') throw new Chat.ErrorMessage(`Teams cannot be added after the auction has started.`);\n\t\tif (name.length > 40) throw new Chat.ErrorMessage(`Team names must be 40 characters or less.`);\n\t\tconst team = new Team(name, this);\n\t\tthis.teams.set(team.id, team);\n\t\tconst teams = [...this.teams.values()];\n\t\tthis.queue = teams.concat(teams.slice().reverse());\n\t\treturn team;\n\t}\n\n\tremoveTeam(name: string) {\n\t\tif (this.state !== 'setup') throw new Chat.ErrorMessage(`Teams cannot be removed after the auction has started.`);\n\t\tconst team = this.teams.get(toID(name));\n\t\tif (!team) throw new Chat.ErrorMessage(`Team \"${name}\" not found.`);\n\t\tthis.queue = this.queue.filter(t => t !== team);\n\t\tthis.teams.delete(team.id);\n\t\treturn team;\n\t}\n\n\tsuspendTeam(name: string) {\n\t\tif (this.state === 'bid') throw new Chat.ErrorMessage(`Teams cannot be suspended during a nomination.`);\n\t\tconst team = this.teams.get(toID(name));\n\t\tif (!team) throw new Chat.ErrorMessage(`Team \"${name}\" not found.`);\n\t\tif (team.suspended) throw new Chat.ErrorMessage(`Team ${name} is already suspended.`);\n\t\tif (this.nominatingTeam === team) throw new Chat.ErrorMessage(`The nominating team cannot be suspended.`);\n\t\tteam.suspended = true;\n\t\treturn team;\n\t}\n\n\tunsuspendTeam(name: string) {\n\t\tif (this.state === 'bid') throw new Chat.ErrorMessage(`Teams cannot be unsuspended during a nomination.`);\n\t\tconst team = this.teams.get(toID(name));\n\t\tif (!team) throw new Chat.ErrorMessage(`Team \"${name}\" not found.`);\n\t\tif (!team.suspended) throw new Chat.ErrorMessage(`Team ${name} is not suspended.`);\n\t\tteam.suspended = false;\n\t\treturn team;\n\t}\n\n\taddManagers(teamName: string, users: string[]) {\n\t\tconst team = this.teams.get(toID(teamName));\n\t\tif (!team) throw new Chat.ErrorMessage(`Team \"${teamName}\" not found.`);\n\t\tconst problemUsers = users.filter(user => !toID(user) || toID(user).length > 18);\n\t\tif (problemUsers.length) {\n\t\t\tthrow new Chat.ErrorMessage(`Invalid usernames: ${problemUsers.join(', ')}`);\n\t\t}\n\t\tfor (const id of users.map(toID)) {\n\t\t\tconst manager = this.managers.get(id);\n\t\t\tif (!manager) {\n\t\t\t\tthis.managers.set(id, { id, team });\n\t\t\t} else {\n\t\t\t\tmanager.team = team;\n\t\t\t}\n\t\t}\n\t\treturn team;\n\t}\n\n\tremoveManagers(users: string[]) {\n\t\tconst problemUsers = users.filter(user => !this.managers.has(toID(user)));\n\t\tif (problemUsers.length) {\n\t\t\tthrow new Chat.ErrorMessage(`Invalid managers: ${problemUsers.join(', ')}`);\n\t\t}\n\t\tfor (const id of users.map(toID)) {\n\t\t\tthis.managers.delete(id);\n\t\t}\n\t}\n\n\taddCreditsToTeam(teamName: string, amount: number) {\n\t\tif (this.type === 'snake') throw new Chat.ErrorMessage(`Snake draft does not support credits.`);\n\t\tif (this.state === 'bid') throw new Chat.ErrorMessage(`Credits cannot be changed during a nomination.`);\n\t\tconst team = this.teams.get(toID(teamName));\n\t\tif (!team) throw new Chat.ErrorMessage(`Team \"${teamName}\" not found.`);\n\t\tconst newCredits = team.credits + amount;\n\t\tif (newCredits <= 0 || newCredits > 10000000) {\n\t\t\tthrow new Chat.ErrorMessage(`A team must have between 0 and 10,000,000 credits.`);\n\t\t}\n\t\tif (team.maxBid(newCredits) < this.minBid) {\n\t\t\tthrow new Chat.ErrorMessage(`A team must have enough credits to draft the minimum amount of players.`);\n\t\t}\n\t\tteam.credits = newCredits;\n\t\treturn team;\n\t}\n\n\tstart() {\n\t\tif (this.state !== 'setup') throw new Chat.ErrorMessage(`The auction has already started.`);\n\t\tif (this.teams.size < 2) throw new Chat.ErrorMessage(`The auction needs at least 2 teams to start.`);\n\t\tconst problemTeams = [...this.teams.values()].filter(t => t.maxBid() < this.minBid).map(t => t.name);\n\t\tif (problemTeams.length) {\n\t\t\tthrow new Chat.ErrorMessage(`The following teams do not have enough credits to draft the minimum amount of players: ${problemTeams.join(', ')}`);\n\t\t}\n\t\tthis.next();\n\t}\n\n\treset() {\n\t\tconst teams = [...this.teams.values()];\n\t\tfor (const team of teams) {\n\t\t\tteam.credits = this.startingCredits;\n\t\t\tteam.suspended = false;\n\t\t\tfor (const player of team.players) {\n\t\t\t\tdelete player.team;\n\t\t\t\tplayer.price = 0;\n\t\t\t}\n\t\t\tteam.players = [];\n\t\t}\n\t\tthis.lastQueue = null;\n\t\tthis.queue = teams.concat(teams.slice().reverse());\n\t\tthis.clearNomTimer();\n\t\tthis.clearBidTimer();\n\t\tthis.state = 'setup';\n\t\tthis.sendHTMLBox(this.generateAuctionTable());\n\t}\n\n\tnext() {\n\t\tthis.state = 'nom';\n\t\tif (!this.queue.filter(team => !team.isSuspended()).length) {\n\t\t\treturn this.end('The auction has ended because there are no teams remaining that can draft players.');\n\t\t}\n\t\tif (!this.getUndraftedPlayers().length) {\n\t\t\treturn this.end('The auction has ended because there are no players remaining in the draft pool.');\n\t\t}\n\t\tdo {\n\t\t\tthis.nominatingTeam = this.queue.shift()!;\n\t\t\tthis.queue.push(this.nominatingTeam);\n\t\t} while (this.nominatingTeam.isSuspended());\n\t\tthis.sendHTMLBox(this.generateAuctionTable());\n\t\tthis.sendMessage(`/html It is now <b>${Utils.escapeHTML(this.nominatingTeam.name)}</b>'s turn to nominate a player. Managers: ${this.nominatingTeam.getManagers().map(m => `<username class=\"username\">${Utils.escapeHTML(m)}</username>`).join(' ')}`);\n\t\tthis.startNomTimer();\n\t}\n\n\tnominate(user: User, target: string) {\n\t\tif (this.state !== 'nom') throw new Chat.ErrorMessage(`You cannot nominate players right now.`);\n\t\tconst manager = this.managers.get(user.id);\n\t\tif (!manager || manager.team !== this.nominatingTeam) this.checkOwner(user);\n\n\t\t// For undo\n\t\tthis.lastQueue = this.queue.slice();\n\t\tthis.lastQueue.unshift(this.lastQueue.pop()!);\n\n\t\tconst player = this.auctionPlayers.get(toID(target));\n\t\tif (!player) throw new Chat.ErrorMessage(`${target} is not a valid player.`);\n\t\tif (player.team) throw new Chat.ErrorMessage(`${player.name} has already been drafted.`);\n\t\tthis.clearNomTimer();\n\t\tthis.nominatedPlayer = player;\n\t\tif (this.type === 'snake') {\n\t\t\tthis.sendMessage(Utils.html`/html <b>${this.nominatingTeam.name}</b> drafted <username>${this.nominatedPlayer.name}</username>!`);\n\t\t\tthis.nominatingTeam.addPlayer(this.nominatedPlayer);\n\t\t\tthis.next();\n\t\t} else {\n\t\t\tthis.state = 'bid';\n\t\t\tthis.highestBid = this.minBid;\n\t\t\tthis.highestBidder = this.nominatingTeam;\n\t\t\tthis.sendMessage(Utils.html`/html <username class=\"username\">${user.name}</username> from team <b>${this.nominatingTeam.name}</b> has nominated <username>${player.name}</username> for auction!`);\n\t\t\tconst notifyMsg = Utils.html`|notify|${this.room.title} Auction|${player.name} has been nominated!`;\n\t\t\tfor (const currManager of this.managers.values()) {\n\t\t\t\tif (currManager.team === this.nominatingTeam) continue;\n\t\t\t\tconst curUser = Users.getExact(currManager.id);\n\t\t\t\tcurUser?.sendTo(this.room, notifyMsg);\n\t\t\t\tcurUser?.sendTo(this.room,\n\t\t\t\t\t`|raw|Send a message with the amount you want to bid (e.g. <code>.5</code> or <code>5</code> will place a bid of <b>5000</b>)!`);\n\t\t\t}\n\t\t\tthis.sendBidInfo();\n\t\t\tthis.startBidTimer();\n\t\t}\n\t}\n\n\tbid(user: User, bid: number) {\n\t\tif (this.state !== 'bid') throw new Chat.ErrorMessage(`There are no players up for auction right now.`);\n\t\tconst team = this.managers.get(user.id)?.team;\n\t\tif (!team) throw new Chat.ErrorMessage(`Only managers can bid on players.`);\n\t\tif (team.isSuspended()) throw new Chat.ErrorMessage(`Your team is suspended and cannot place bids.`);\n\n\t\tif (bid > team.maxBid()) throw new Chat.ErrorMessage(`Your team cannot afford to bid that much.`);\n\n\t\tif (this.type === 'blind') {\n\t\t\tif (this.bidsPlaced.has(team)) throw new Chat.ErrorMessage(`Your team has already placed a bid.`);\n\t\t\tif (bid <= this.minBid) throw new Chat.ErrorMessage(`Your bid must be higher than the minimum bid.`);\n\n\t\t\tconst msg = `|c:|${Math.floor(Date.now() / 1000)}|&|/html Your team placed a bid of <b>${bid}</b> on <username>${Utils.escapeHTML(this.nominatedPlayer.name)}</username>.`;\n\t\t\tfor (const manager of this.managers.values()) {\n\t\t\t\tif (manager.team !== team) continue;\n\t\t\t\tUsers.getExact(manager.id)?.sendTo(this.room, msg);\n\t\t\t}\n\n\t\t\tif (bid > this.highestBid) {\n\t\t\t\tthis.highestBid = bid;\n\t\t\t\tthis.highestBidder = team;\n\t\t\t}\n\t\t\tthis.bidsPlaced.set(team, bid);\n\t\t\tif (this.bidsPlaced.size === this.teams.size) {\n\t\t\t\tthis.finishCurrentNom();\n\t\t\t}\n\t\t} else {\n\t\t\tif (bid <= this.highestBid) throw new Chat.ErrorMessage(`Your bid must be higher than the current bid.`);\n\t\t\tthis.highestBid = bid;\n\t\t\tthis.highestBidder = team;\n\t\t\t// this.sendMessage(Utils.html`/html <username class=\"username\">${user.name}</username>[${team.name}]: <b>${bid}</b>`);\n\t\t\tthis.sendBidInfo();\n\t\t\tthis.startBidTimer();\n\t\t}\n\t}\n\n\tonChatMessage(message: string, user: User) {\n\t\tif (this.state !== 'bid' || this.type !== 'blind') return;\n\t\tif (message.startsWith('.')) message = message.slice(1);\n\t\tif (Number(message.replace(',', '.'))) {\n\t\t\tthis.bid(user, parseCredits(message));\n\t\t\treturn '';\n\t\t}\n\t}\n\n\tonLogMessage(message: string, user: User) {\n\t\tif (this.state !== 'bid' || this.type === 'blind') return;\n\t\tif (message.startsWith('.')) message = message.slice(1);\n\t\tif (Number(message.replace(',', '.'))) {\n\t\t\tthis.room.update();\n\t\t\ttry {\n\t\t\t\tthis.bid(user, parseCredits(message));\n\t\t\t} catch (e) {\n\t\t\t\tif (e instanceof Chat.ErrorMessage) {\n\t\t\t\t\tuser.sendTo(this.room, Utils.html`|raw|<span class=\"message-error\">${e.message}</span>`);\n\t\t\t\t} else {\n\t\t\t\t\tuser.sendTo(this.room, `|raw|<span class=\"message-error\">An unexpected error occurred while placing your bid.</span>`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tskipNom() {\n\t\tif (this.state !== 'nom') throw new Chat.ErrorMessage(`Nominations cannot be skipped right now.`);\n\t\tthis.nominatedPlayer = null!;\n\t\tthis.sendMessage(`**${this.nominatingTeam.name}**'s nomination turn has been skipped!`);\n\t\tthis.clearNomTimer();\n\t\tthis.next();\n\t}\n\n\tfinishCurrentNom() {\n\t\tif (this.type === 'blind') {\n\t\t\tlet buf = `<div class=\"ladder pad\"><table><tr><th>Team</th><th>Bid</th></tr>`;\n\t\t\tif (!this.bidsPlaced.has(this.nominatingTeam)) {\n\t\t\t\tbuf += Utils.html`<tr><td>${this.nominatingTeam.name}</td><td>${this.minBid}</td></tr>`;\n\t\t\t}\n\t\t\tfor (const [team, bid] of this.bidsPlaced) {\n\t\t\t\tbuf += Utils.html`<tr><td>${team.name}</td><td>${bid}</td></tr>`;\n\t\t\t}\n\t\t\tbuf += `</table></div>`;\n\t\t\tthis.sendHTMLBox(buf);\n\t\t\tthis.bidsPlaced.clear();\n\t\t}\n\t\tthis.sendMessage(Utils.html`/html <b>${this.highestBidder.name}</b> bought <username>${this.nominatedPlayer.name}</username> for <b>${this.highestBid}</b> credits!`);\n\t\tthis.highestBidder.addPlayer(this.nominatedPlayer, this.highestBid);\n\t\tthis.clearBidTimer();\n\t\tthis.next();\n\t}\n\n\tundoLastNom() {\n\t\tif (this.state !== 'nom') throw new Chat.ErrorMessage(`Nominations cannot be undone right now.`);\n\t\tif (!this.lastQueue) throw new Chat.ErrorMessage(`Only one nomination can be undone at a time.`);\n\t\tthis.queue = this.lastQueue;\n\t\tthis.lastQueue = null;\n\t\tif (this.nominatedPlayer) {\n\t\t\tthis.highestBidder.removePlayer(this.nominatedPlayer);\n\t\t\tthis.highestBidder.credits += this.highestBid;\n\t\t}\n\t\tthis.next();\n\t}\n\n\tclearNomTimer() {\n\t\tclearInterval(this.nomTimer);\n\t\tthis.nomTimeRemaining = this.nomTimeLimit;\n\t\tthis.room.add('|uhtmlchange|timer|');\n\t}\n\n\tstartNomTimer() {\n\t\tif (!this.nomTimeLimit) return;\n\t\tthis.clearNomTimer();\n\t\tthis.sendTimer(false, true);\n\t\tthis.nomTimer = setInterval(() => this.pokeNomTimer(), 1000);\n\t}\n\n\tclearBidTimer() {\n\t\tclearInterval(this.bidTimer);\n\t\tthis.bidTimeRemaining = this.bidTimeLimit;\n\t\tthis.room.add('|uhtmlchange|timer|');\n\t}\n\n\tstartBidTimer() {\n\t\tif (!this.bidTimeLimit) return;\n\t\tthis.clearBidTimer();\n\t\tthis.sendTimer();\n\t\tthis.bidTimer = setInterval(() => this.pokeBidTimer(), 1000);\n\t}\n\n\tpokeNomTimer() {\n\t\tthis.nomTimeRemaining--;\n\t\tif (!this.nomTimeRemaining) {\n\t\t\tthis.skipNom();\n\t\t} else {\n\t\t\tthis.sendTimer(true, true);\n\t\t\tif (this.nomTimeRemaining % 30 === 0 || [20, 10, 5].includes(this.nomTimeRemaining)) {\n\t\t\t\tthis.sendMessage(`/html <span class=\"message-error\">${this.nomTimeRemaining} seconds left!</span>`);\n\t\t\t}\n\t\t}\n\t}\n\n\tpokeBidTimer() {\n\t\tthis.bidTimeRemaining--;\n\t\tif (!this.bidTimeRemaining) {\n\t\t\tthis.finishCurrentNom();\n\t\t} else {\n\t\t\tthis.sendTimer(true);\n\t\t\tif (this.bidTimeRemaining % 30 === 0 || [20, 10, 5].includes(this.bidTimeRemaining)) {\n\t\t\t\tthis.sendMessage(`/html <span class=\"message-error\">${this.bidTimeRemaining} seconds left!</span>`);\n\t\t\t}\n\t\t}\n\t}\n\n\tend(message?: string) {\n\t\tthis.setEnded();\n\t\tthis.sendHTMLBox(this.generateAuctionTable());\n\t\tthis.sendHTMLBox(this.generatePriceList());\n\t\tif (message) this.sendMessage(message);\n\t\tthis.destroy();\n\t}\n\n\tdestroy() {\n\t\tthis.clearNomTimer();\n\t\tthis.clearBidTimer();\n\t\tsuper.destroy();\n\t}\n}\n\nexport const commands: Chat.ChatCommands = {\n\tauction: {\n\t\tcreate(target, room, user) {\n\t\t\troom = this.requireRoom();\n\t\t\tthis.checkCan('minigame', null, room);\n\t\t\tif (room.game) return this.errorReply(`There is already a game of ${room.game.title} in progress in this room.`);\n\t\t\tif (room.settings.auctionDisabled) return this.errorReply('Auctions are currently disabled in this room.');\n\n\t\t\tlet startingCredits;\n\t\t\tif (target) {\n\t\t\t\tstartingCredits = parseCredits(target);\n\t\t\t\tif (startingCredits < 10000 || startingCredits > 10000000) {\n\t\t\t\t\treturn this.errorReply(`Starting credits must be between 10,000 and 10,000,000.`);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst auction = new Auction(room, startingCredits);\n\t\t\tauction.addOwners([user.id]);\n\t\t\troom.game = auction;\n\t\t\tthis.addModAction(`An auction was created by ${user.name}.`);\n\t\t\tthis.modlog(`AUCTION CREATE`);\n\t\t},\n\t\tcreatehelp: [\n\t\t\t`/auction create [startingcredits] - Creates an auction. Requires: % @ # ~`,\n\t\t],\n\t\tstart(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tauction.start();\n\t\t\tthis.addModAction(`The auction was started by ${user.name}.`);\n\t\t\tthis.modlog(`AUCTION START`);\n\t\t},\n\t\treset(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tauction.reset();\n\t\t\tthis.addModAction(`The auction was reset by ${user.name}.`);\n\t\t\tthis.modlog(`AUCTION RESET`);\n\t\t},\n\t\tdelete: 'end',\n\t\tstop: 'end',\n\t\tend(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tauction.end();\n\t\t\tthis.addModAction(`The auction was ended by ${user.name}.`);\n\t\t\tthis.modlog('AUCTION END');\n\t\t},\n\t\tinfo: 'display',\n\t\tdisplay(target, room, user) {\n\t\t\tthis.runBroadcast();\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tthis.sendReplyBox(auction.generateAuctionTable());\n\t\t},\n\t\tpricelist(target, room, user) {\n\t\t\tthis.runBroadcast();\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tthis.sendReplyBox(auction.generatePriceList());\n\t\t},\n\t\tminbid(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tif (!target) return this.parse('/help auction minbid');\n\t\t\tconst amount = parseCredits(target);\n\t\t\tauction.setMinBid(amount);\n\t\t\tthis.addModAction(`${user.name} set the minimum bid to ${amount}.`);\n\t\t\tthis.modlog('AUCTION MINBID', null, `${amount}`);\n\t\t},\n\t\tminbidhelp: [\n\t\t\t`/auction minbid [amount] - Sets the minimum bid. Requires: # ~ auction owner`,\n\t\t],\n\t\tminplayers(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tif (!target) return this.parse('/help auction minplayers');\n\t\t\tconst amount = parseInt(target);\n\t\t\tauction.setMinPlayers(amount);\n\t\t\tthis.addModAction(`${user.name} set the minimum number of players to ${amount}.`);\n\t\t},\n\t\tminplayershelp: [\n\t\t\t`/auction minplayers [amount] - Sets the minimum number of players. Requires: # ~ auction owner`,\n\t\t],\n\t\tmaxplayers(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tif (!target) return this.parse('/help auction maxplayers');\n\t\t\tconst amount = parseInt(target);\n\t\t\tauction.setMaxPlayers(amount);\n\t\t\tthis.addModAction(`${user.name} set the maximum number of players to ${amount}.`);\n\t\t},\n\t\tmaxplayershelp: [\n\t\t\t`/auction maxplayers [amount] - Sets the maximum number of players. Requires: # ~ auction owner`,\n\t\t],\n\t\tnomtimer(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tif (!target) return this.parse('/help auction nomtimer');\n\t\t\tconst seconds = this.meansNo(target) ? 0 : parseInt(target);\n\t\t\tauction.setNomTimeLimit(seconds);\n\t\t\tthis.addModAction(`${user.name} set the nomination timer to ${seconds} seconds.`);\n\t\t},\n\t\tnomtimerhelp: [\n\t\t\t`/auction nomtimer [seconds/off] - Sets the nomination timer to [seconds] seconds or disables it. Requires: # ~ auction owner`,\n\t\t],\n\t\tbidtimer(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tif (!target) return this.parse('/help auction settimer');\n\t\t\tconst seconds = parseInt(target);\n\t\t\tauction.setBidTimeLimit(seconds);\n\t\t\tthis.addModAction(`${user.name} set the bid timer to ${seconds} seconds.`);\n\t\t},\n\t\tbidtimerhelp: [\n\t\t\t`/auction timer [seconds] - Sets the bid timer to [seconds] seconds. Requires: # ~ auction owner`,\n\t\t],\n\t\tsettype(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tif (!target) return this.parse('/help auction settype');\n\t\t\tauction.setType(target);\n\t\t\tthis.addModAction(`${user.name} set the auction type to ${toID(target)}.`);\n\t\t},\n\t\tsettypehelp: [\n\t\t\t`/auction settype [auction|blind|snake] - Sets the auction type. Requires: # ~ auction owner`,\n\t\t\t`- auction: Standard auction with credits and bidding.`,\n\t\t\t`- blind: Same as auction, but bids are hidden until the end of the nomination.`,\n\t\t\t`- snake: Standard snake draft with no credits or bidding.`,\n\t\t],\n\t\taddowner: 'addowners',\n\t\taddowners(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tconst owners = target.split(',').map(x => x.trim());\n\t\t\tif (!owners.length) return this.parse('/help auction addowners');\n\t\t\tauction.addOwners(owners);\n\t\t\tthis.addModAction(`${user.name} added ${Chat.toListString(owners.map(o => Users.getExact(o)!.name))} as auction owner${Chat.plural(owners.length)}.`);\n\t\t},\n\t\taddownershelp: [\n\t\t\t`/auction addowners [user1], [user2], ... - Adds users as auction owners. Requires: # ~ auction owner`,\n\t\t],\n\t\tremoveowner: 'removeowners',\n\t\tremoveowners(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tconst owners = target.split(',').map(x => x.trim());\n\t\t\tif (!owners.length) return this.parse('/help auction removeowners');\n\t\t\tauction.removeOwners(owners);\n\t\t\tthis.addModAction(`${user.name} removed ${Chat.toListString(owners.map(o => Users.getExact(o)?.name || o))} as auction owner${Chat.plural(owners.length)}.`);\n\t\t},\n\t\tremoveownershelp: [\n\t\t\t`/auction removeowners [user1], [user2], ... - Removes users as auction owners. Requires: # ~ auction owner`,\n\t\t],\n\t\tasync importplayers(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tif (!target) return this.parse('/help auction importplayers');\n\t\t\tif (!/^https?:\\/\\/pastebin\\.com\\/[a-zA-Z0-9]+$/.test(target)) {\n\t\t\t\treturn this.errorReply('Invalid pastebin URL.');\n\t\t\t}\n\t\t\tlet data = '';\n\t\t\ttry {\n\t\t\t\tdata = await Net(`https://pastebin.com/raw/${target.split('/').pop()}`).get();\n\t\t\t} catch {}\n\t\t\tif (!data) return this.errorReply('Error fetching data from pastebin.');\n\n\t\t\tauction.importPlayers(data);\n\t\t\tthis.addModAction(`${user.name} imported the player list from ${target}.`);\n\t\t},\n\t\timportplayershelp: [\n\t\t\t`/auction importplayers [pastebin url] - Imports a list of players from a pastebin. Requires: # ~ auction owner`,\n\t\t\t`The pastebin should be a list of tab-separated values with the first row containing tier names and subsequent rows containing the player names and either a 'y' or an 'n' in the column corresponding to the tier they prefer or do not play respectively.`,\n\t\t\t`See https://pastebin.com/jPTbJBva for an example.`,\n\t\t],\n\t\taddplayer(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tconst [playedPart, notPlayedPart] = target.split(\";\");\n\t\t\tconst tiersPlayed = playedPart.split(\",\").map(item => item.trim());\n\t\t\tconst tiersNotPlayed = notPlayedPart ? notPlayedPart.split(\",\").map(item => item.trim()) : [];\n\t\t\tconst name = tiersPlayed.shift();\n\n\t\t\tif (!name) return this.parse('/help auction addplayer');\n\t\t\tconst player = auction.addAuctionPlayer(name, tiersPlayed, tiersNotPlayed);\n\t\t\tthis.addModAction(`${user.name} added player ${player.name} to the auction.`);\n\t\t},\n\t\taddplayerhelp: [\n\t\t\t`/auction addplayer [name], [tierPlayed1], [tierPlayed2], ... ; [tierNotPlayed1], [tierNotPlayed2], ... - Adds a player to the auction. Requires: # ~ auction owner`,\n\t\t],\n\t\tremoveplayer(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tif (!target) return this.parse('/help auction removeplayer');\n\t\t\tconst player = auction.removeAuctionPlayer(target);\n\t\t\tthis.addModAction(`${user.name} removed player ${player.name} from the auction.`);\n\t\t},\n\t\tremoveplayerhelp: [\n\t\t\t`/auction removeplayer [name] - Removes a player from the auction. Requires: # ~ auction owner`,\n\t\t],\n\t\tassignplayer(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tconst [player, team] = target.split(',').map(x => x.trim());\n\t\t\tif (!player) return this.parse('/help auction assignplayer');\n\t\t\tif (team) {\n\t\t\t\tauction.assignPlayer(player, team);\n\t\t\t\tthis.addModAction(`${user.name} assigned player ${player} to team ${team}.`);\n\t\t\t} else {\n\t\t\t\tauction.assignPlayer(player);\n\t\t\t\tthis.sendReply(`${user.name} returned player ${player} to the draft pool.`);\n\t\t\t}\n\t\t},\n\t\tassignplayerhelp: [\n\t\t\t`/auction assignplayer [player], [team] - Assigns a player to a team. If team is blank, returns player to draft pool. Requires: # ~ auction owner`,\n\t\t],\n\t\taddteam(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tconst [name, ...managerNames] = target.split(',').map(x => x.trim());\n\t\t\tif (!name) return this.parse('/help auction addteam');\n\t\t\tconst team = auction.addTeam(name);\n\t\t\tthis.addModAction(`${user.name} added team ${team.name} to the auction.`);\n\t\t\tauction.addManagers(team.name, managerNames);\n\t\t},\n\t\taddteamhelp: [\n\t\t\t`/auction addteam [name], [manager1], [manager2], ... - Adds a team to the auction. Requires: # ~ auction owner`,\n\t\t],\n\t\tremoveteam(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tif (!target) return this.parse('/help auction removeteam');\n\t\t\tconst team = auction.removeTeam(target);\n\t\t\tthis.addModAction(`${user.name} removed team ${team.name} from the auction.`);\n\t\t},\n\t\tremoveteamhelp: [\n\t\t\t`/auction removeteam [team] - Removes a team from the auction. Requires: # ~ auction owner`,\n\t\t],\n\t\tsuspendteam(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tif (!target) return this.parse('/help auction suspendteam');\n\t\t\tconst team = auction.suspendTeam(target);\n\t\t\tthis.addModAction(`${user.name} suspended team ${team.name}.`);\n\t\t},\n\t\tsuspendteamhelp: [\n\t\t\t`/auction suspendteam [team] - Suspends a team from the auction. Requires: # ~ auction owner`,\n\t\t\t`Suspended teams have their nomination turns skipped and are not allowed to place bids.`,\n\t\t],\n\t\tunsuspendteam(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tif (!target) return this.parse('/help auction unsuspendteam');\n\t\t\tconst team = auction.unsuspendTeam(target);\n\t\t\tthis.addModAction(`${user.name} unsuspended team ${team.name}.`);\n\t\t},\n\t\tunsuspendteamhelp: [\n\t\t\t`/auction unsuspendteam [team] - Unsuspends a team from the auction. Requires: # ~ auction owner`,\n\t\t],\n\t\taddmanager: 'addmanagers',\n\t\taddmanagers(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tconst [teamName, ...managerNames] = target.split(',').map(x => x.trim());\n\t\t\tif (!teamName || !managerNames.length) return this.parse('/help auction addmanagers');\n\t\t\tconst team = auction.addManagers(teamName, managerNames);\n\t\t\tconst managers = managerNames.map(m => Users.getExact(m)?.name || toID(m));\n\t\t\tthis.addModAction(`${user.name} added ${Chat.toListString(managers)} as manager${Chat.plural(managers.length)} for team ${team.name}.`);\n\t\t},\n\t\taddmanagershelp: [\n\t\t\t`/auction addmanagers [team], [user1], [user2], ... - Adds users as managers to a team. Requires: # ~ auction owner`,\n\t\t],\n\t\tremovemanager: 'removemanagers',\n\t\tremovemanagers(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tif (!target) return this.parse('/help auction removemanagers');\n\t\t\tconst managerNames = target.split(',').map(x => x.trim());\n\t\t\tauction.removeManagers(managerNames);\n\t\t\tconst managers = managerNames.map(m => Users.getExact(m)?.name || toID(m));\n\t\t\tthis.addModAction(`${user.name} removed ${Chat.toListString(managers)} as manager${Chat.plural(managers.length)}.`);\n\t\t},\n\t\tremovemanagershelp: [\n\t\t\t`/auction removemanagers [user1], [user2], ... - Removes users as managers. Requires: # ~ auction owner`,\n\t\t],\n\t\taddcredits(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tconst [teamName, amount] = target.split(',').map(x => x.trim());\n\t\t\tif (!teamName || !amount) return this.parse('/help auction addcredits');\n\t\t\tconst credits = parseCredits(amount);\n\t\t\tconst team = auction.addCreditsToTeam(teamName, credits);\n\t\t\tthis.addModAction(`${user.name} ${credits < 0 ? 'removed' : 'added'} ${Math.abs(credits)} credits ${credits < 0 ? 'from' : 'to'} team ${team.name}.`);\n\t\t},\n\t\taddcreditshelp: [\n\t\t\t`/auction addcredits [team], [amount] - Adds credits to a team. Requires: # ~ auction owner`,\n\t\t],\n\t\tnom: 'nominate',\n\t\tnominate(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tif (!target) return this.parse('/help auction nominate');\n\t\t\tauction.nominate(user, target);\n\t\t},\n\t\tnominatehelp: [\n\t\t\t`/auction nominate OR /nom [player] - Nominates a player for auction.`,\n\t\t],\n\t\tskip: 'skipnom',\n\t\tskipnom(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tauction.skipNom();\n\t\t\tthis.addModAction(`${user.name} skipped the previous nomination.`);\n\t\t},\n\t\tundo(target, room, user) {\n\t\t\tconst auction = this.requireGame(Auction);\n\t\t\tauction.checkOwner(user);\n\n\t\t\tauction.undoLastNom();\n\t\t\tthis.addModAction(`${user.name} undid the last nomination.`);\n\t\t},\n\t\tdisable(target, room) {\n\t\t\troom = this.requireRoom();\n\t\t\tthis.checkCan('gamemanagement', null, room);\n\t\t\tif (room.settings.auctionDisabled) {\n\t\t\t\treturn this.errorReply('Auctions are already disabled.');\n\t\t\t}\n\t\t\troom.settings.auctionDisabled = true;\n\t\t\troom.saveSettings();\n\t\t\tthis.sendReply('Auctions have been disabled for this room.');\n\t\t},\n\t\tenable(target, room) {\n\t\t\troom = this.requireRoom();\n\t\t\tthis.checkCan('gamemanagement', null, room);\n\t\t\tif (!room.settings.auctionDisabled) {\n\t\t\t\treturn this.errorReply('Auctions are already enabled.');\n\t\t\t}\n\t\t\tdelete room.settings.auctionDisabled;\n\t\t\troom.saveSettings();\n\t\t\tthis.sendReply('Auctions have been enabled for this room.');\n\t\t},\n\t\tongoing: 'running',\n\t\trunning() {\n\t\t\tif (!this.runBroadcast()) return;\n\t\t\tconst runningAuctions = [...Rooms.rooms.values()].filter(r => r.getGame(Auction)).map(r => r.title);\n\t\t\tthis.sendReply(`Running auctions: ${runningAuctions.join(', ') || 'None'}`);\n\t\t},\n\t\t'': 'help',\n\t\thelp() {\n\t\t\tthis.parse('/help auction');\n\t\t},\n\t},\n\tauctionhelp() {\n\t\tif (!this.runBroadcast()) return;\n\t\tthis.sendReplyBox(\n\t\t\t`Auction commands<br/>` +\n\t\t\t`- create [startingcredits]: Creates an auction.<br/>` +\n\t\t\t`- start: Starts the auction.<br/>` +\n\t\t\t`- reset: Resets the auction.<br/>` +\n\t\t\t`- end: Ends the auction.<br/>` +\n\t\t\t`- running: Shows a list of rooms with running auctions.<br/>` +\n\t\t\t`- display: Displays the current state of the auction.<br/>` +\n\t\t\t`- pricelist: Displays the current prices of players by team.<br/>` +\n\t\t\t`- nom [player]: Nominates a player for auction.<br/>` +\n\t\t\t`You may use /nom directly without the /auction prefix.<br/>` +\n\t\t\t`During the bidding phase, all numbers that are sent in the chat will be treated as bids.<br/><br/>` +\n\t\t\t`<details class=\"readmore\"><summary>Configuration Commands</summary>` +\n\t\t\t`- minbid [amount]: Sets the minimum bid.<br/>` +\n\t\t\t`- minplayers [amount]: Sets the minimum number of players.<br/>` +\n\t\t\t`- nomtimer [seconds]: Sets the nomination timer to [seconds] seconds.<br/>` +\n\t\t\t`- bidtimer [seconds]: Sets the bid timer to [seconds] seconds.<br/>` +\n\t\t\t`- settype [auction|blind|snake]: Sets the auction type.<br/>` +\n\t\t\t`- addowners [user1], [user2], ...: Adds users as auction owners.<br/>` +\n\t\t\t`- removeowners [user1], [user2], ...: Removes users as auction owners.<br/>` +\n\t\t\t`- importplayers [pastebin url]: Imports a list of players from a pastebin.<br/>` +\n\t\t\t`- addplayer [name], [tier1], [tier2], ...: Adds a player to the auction.<br/>` +\n\t\t\t`- removeplayer [name]: Removes a player from the auction.<br/>` +\n\t\t\t`- assignplayer [player], [team]: Assigns a player to a team. If team is blank, returns player to draft pool.<br/>` +\n\t\t\t`- addteam [name], [manager1], [manager2], ...: Adds a team to the auction.<br/>` +\n\t\t\t`- removeteam [name]: Removes the given team from the auction.<br/>` +\n\t\t\t`- suspendteam [name]: Suspends the given team from the auction.<br/>` +\n\t\t\t`- unsuspendteam [name]: Unsuspends the given team from the auction.<br/>` +\n\t\t\t`- addmanagers [team], [user1], [user2], ...: Adds users as managers to a team.<br/>` +\n\t\t\t`- removemanagers [user1], [user2], ...: Removes users as managers..<br/>` +\n\t\t\t`- addcredits [team], [amount]: Adds credits to a team.<br/>` +\n\t\t\t`- skipnom: Skips the current nomination.<br/>` +\n\t\t\t`- undo: Undoes the last nomination.<br/>` +\n\t\t\t`- [enable/disable]: Enables or disables auctions from being started in a room.<br/>` +\n\t\t\t`</details>`\n\t\t);\n\t},\n\tnom(target) {\n\t\tthis.parse(`/auction nominate ${target}`);\n\t},\n\tbid() {\n\t\tthis.errorReply(`/bid is no longer supported. Send the amount by itself in the chat to place your bid.`);\n\t},\n\toverpay() {\n\t\tthis.requireGame(Auction);\n\t\tthis.checkChat();\n\t\treturn '/announce OVERPAY!';\n\t},\n};\n\nexport const roomSettings: Chat.SettingsHandler = room => ({\n\tlabel: \"Auction\",\n\tpermission: 'editroom',\n\toptions: [\n\t\t[`disabled`, room.settings.auctionDisabled || 'auction disable'],\n\t\t[`enabled`, !room.settings.auctionDisabled || 'auction enable'],\n\t],\n});\n"],
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,iBAA2B;AAgB3B,MAAM,KAAK;AAAA,EAOV,YAAY,MAAc,SAAkB;AAC3C,SAAK,KAAK,KAAK,IAAI;AACnB,SAAK,OAAO;AACZ,SAAK,UAAU,CAAC;AAChB,SAAK,UAAU,QAAQ;AACvB,SAAK,YAAY;AACjB,SAAK,UAAU;AAAA,EAChB;AAAA,EAEA,cAAc;AACb,WAAO,CAAC,GAAG,KAAK,QAAQ,SAAS,OAAO,CAAC,EACvC,OAAO,OAAK,EAAE,SAAS,IAAI,EAC3B,IAAI,OAAK,MAAM,SAAS,EAAE,EAAE,GAAG,QAAQ,EAAE,EAAE;AAAA,EAC9C;AAAA,EAEA,UAAU,QAAgB,QAAQ,GAAG;AACpC,WAAO,MAAM,aAAa,MAAM;AAChC,SAAK,QAAQ,KA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