{ "version": 3, "sources": ["../../../../server/chat-plugins/wifi.tsx"], "sourcesContent": ["/**\r\n * Wi-Fi chat-plugin. Only works in a room with id 'wifi'\r\n * Handles giveaways in the formats: question, lottery, gts\r\n * Written by Kris and bumbadadabum, based on the original plugin as written by Codelegend, SilverTactic, DanielCranham\r\n */\r\n\r\nimport {FS, Utils} from '../../lib';\r\n\r\nPunishments.addRoomPunishmentType({\r\n\ttype: 'GIVEAWAYBAN',\r\n\tdesc: 'banned from giveaways',\r\n});\r\n\r\nconst BAN_DURATION = 7 * 24 * 60 * 60 * 1000;\r\nconst RECENT_THRESHOLD = 30 * 24 * 60 * 60 * 1000;\r\n\r\nconst DATA_FILE = 'config/chat-plugins/wifi.json';\r\n\r\ntype Game = 'SwSh' | 'BDSP' | 'SV';\r\n\r\ninterface GiveawayData {\r\n\ttargetUserID: string;\r\n\tot: string;\r\n\ttid: string;\r\n\tgame: Game;\r\n\tprize: PokemonSet;\r\n\tivs: string[];\r\n\tball: string;\r\n\textraInfo: string;\r\n\t/** Staff handling it. */\r\n\tclaimed?: ID;\r\n}\r\n\r\ninterface QuestionGiveawayData extends GiveawayData {\r\n\tquestion: string;\r\n\tanswers: string[];\r\n}\r\n\r\ninterface LotteryGiveawayData extends GiveawayData {\r\n\twinners: number;\r\n}\r\n\r\ninterface WifiData {\r\n\twhitelist: string[];\r\n\tstats: {[k: string]: number[]};\r\n\tstoredGiveaways: {question: QuestionGiveawayData[], lottery: LotteryGiveawayData[]};\r\n\tsubmittedGiveaways: {question: QuestionGiveawayData[], lottery: LotteryGiveawayData[]};\r\n}\r\n\r\nconst defaults: WifiData = {\r\n\twhitelist: [],\r\n\tstats: {},\r\n\tstoredGiveaways: {\r\n\t\tquestion: [],\r\n\t\tlottery: [],\r\n\t},\r\n\tsubmittedGiveaways: {\r\n\t\tquestion: [],\r\n\t\tlottery: [],\r\n\t},\r\n};\r\n\r\nexport let wifiData: WifiData = (() => {\r\n\ttry {\r\n\t\treturn JSON.parse(FS(DATA_FILE).readSync());\r\n\t} catch (e: any) {\r\n\t\tif (e.code !== 'ENOENT') throw e;\r\n\t\treturn defaults;\r\n\t}\r\n})();\r\n\r\nfunction saveData() {\r\n\tFS(DATA_FILE).writeUpdate(() => JSON.stringify(wifiData));\r\n}\r\n\r\n// Convert old file type\r\nif (!wifiData.stats && !wifiData.storedGiveaways && !wifiData.submittedGiveaways) {\r\n\t// we cast under the assumption that it's the old file format\r\n\tconst stats = {...wifiData} as unknown as {[k: string]: number[]};\r\n\twifiData = {...defaults, stats};\r\n\tsaveData();\r\n}\r\n// ensure the whitelist exists for those who might have the conversion above but not the stats\r\nif (!wifiData.whitelist) wifiData.whitelist = [];\r\n\r\nconst statNames = [\"HP\", \"Atk\", \"Def\", \"SpA\", \"SpD\", \"Spe\"];\r\n\r\nconst gameName: {[k in Game]: string} = {\r\n\tSwSh: 'Sword/Shield',\r\n\tBDSP: 'Brilliant Diamond/Shining Pearl',\r\n\tSV: 'Scarlet/Violet',\r\n};\r\nconst gameidToGame: {[k: string]: Game} = {\r\n\tswsh: 'SwSh',\r\n\tbdsp: 'BDSP',\r\n\tsv: 'SV',\r\n};\r\n\r\nclass Giveaway extends Rooms.SimpleRoomGame {\r\n\tgaNumber: number;\r\n\thost: User;\r\n\tgiver: User;\r\n\troom: Room;\r\n\tot: string;\r\n\ttid: string;\r\n\tgame: Game;\r\n\tivs: string[];\r\n\tprize: PokemonSet;\r\n\tphase: string;\r\n\tball: string;\r\n\textraInfo: string;\r\n\t/**\r\n\t * IP:userid\r\n\t */\r\n\tjoined: Map;\r\n\ttimer: NodeJS.Timer | null;\r\n\tpokemonID: ID;\r\n\tsprite: Chat.VNode;\r\n\r\n\tconstructor(\r\n\t\thost: User, giver: User, room: Room, ot: string, tid: string, ivs: string[],\r\n\t\tprize: PokemonSet, game: Game = 'SV', ball: string, extraInfo: string\r\n\t) {\r\n\t\t// Make into a sub-game if the gts ever opens up again\r\n\t\tsuper(room);\r\n\t\tthis.gaNumber = room.nextGameNumber();\r\n\t\tthis.host = host;\r\n\t\tthis.giver = giver;\r\n\t\tthis.room = room;\r\n\t\tthis.ot = ot;\r\n\t\tthis.tid = tid;\r\n\t\tthis.ball = ball;\r\n\t\tthis.extraInfo = extraInfo;\r\n\t\tthis.game = game;\r\n\t\tthis.ivs = ivs;\r\n\t\tthis.prize = prize;\r\n\t\tthis.phase = 'pending';\r\n\r\n\t\tthis.joined = new Map();\r\n\r\n\t\tthis.timer = null;\r\n\r\n\t\t[this.pokemonID, this.sprite] = Giveaway.getSprite(prize);\r\n\t}\r\n\r\n\tdestroy() {\r\n\t\tthis.clearTimer();\r\n\t\tsuper.destroy();\r\n\t}\r\n\r\n\tgenerateReminder(joined?: boolean): string | Chat.VNode;\r\n\tgenerateReminder() {\r\n\t\treturn '';\r\n\t}\r\n\r\n\tgetStyle() {\r\n\t\tconst css: {[k: string]: string | {[k: string]: string}} = {class: \"broadcast-blue\"};\r\n\t\tif (this.game === 'BDSP') css.style = {background: '#aa66a9', color: '#fff'};\r\n\t\tif (this.game === 'SV') css.style = {background: '#CD5C5C', color: '#fff'};\r\n\t\treturn css;\r\n\t}\r\n\r\n\tsendToUser(user: User, content: string | Chat.VNode) {\r\n\t\tuser.sendTo(\r\n\t\t\tthis.room,\r\n\t\t\tChat.html`|uhtmlchange|giveaway${this.gaNumber}${this.phase}|${
{content}
}`\r\n\t\t);\r\n\t}\r\n\r\n\tsend(content: string | Chat.VNode, isStart = false) {\r\n\t\tthis.room.add(Chat.html`|uhtml|giveaway${this.gaNumber}${this.phase}|${
{content}
}`);\r\n\t\tif (isStart) this.room.add(`|c:|${Math.floor(Date.now() / 1000)}|&|It's ${this.game} giveaway time!`);\r\n\t\tthis.room.update();\r\n\t}\r\n\r\n\tchangeUhtml(content: string | Chat.VNode) {\r\n\t\tthis.room.uhtmlchange(`giveaway${this.gaNumber}${this.phase}`, Chat.html`${
{content}
}`);\r\n\t\tthis.room.update();\r\n\t}\r\n\r\n\tclearTimer() {\r\n\t\tif (this.timer) {\r\n\t\t\tclearTimeout(this.timer);\r\n\t\t\tthis.timer = null;\r\n\t\t}\r\n\t}\r\n\r\n\tcheckJoined(user: User) {\r\n\t\tfor (const [ip, id] of this.joined) {\r\n\t\t\tif (user.latestIp === ip && !Config.noipchecks) return ip;\r\n\t\t\tif (user.previousIDs.includes(id)) return id;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tkickUser(user: User) {\r\n\t\tfor (const [ip, id] of this.joined) {\r\n\t\t\tif (user.latestIp === ip && !Config.noipchecks || user.previousIDs.includes(id)) {\r\n\t\t\t\tthis.sendToUser(user, this.generateReminder());\r\n\t\t\t\tthis.joined.delete(ip);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tcheckExcluded(user: User) {\r\n\t\treturn (\r\n\t\t\tuser === this.giver ||\r\n\t\t\t!Config.noipchecks && this.giver.ips.includes(user.latestIp) ||\r\n\t\t\tthis.giver.previousIDs.includes(toID(user))\r\n\t\t);\r\n\t}\r\n\r\n\tstatic checkCanCreate(context: Chat.CommandContext, targetUser: User, type: string) {\r\n\t\tconst user = context.user;\r\n\t\tconst isCreate = type === 'create';\r\n\t\tconst isForSelf = targetUser.id === user.id;\r\n\t\tif (wifiData.whitelist.includes(user.id) && isCreate && isForSelf) {\r\n\t\t\t// it being true doesn't matter here, it's just clearer that the user _is_ allowed\r\n\t\t\t// and it ensures execution stops here so the creation can proceed\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (isCreate && !(isForSelf && user.can('show', null, context.room!))) {\r\n\t\t\tcontext.checkCan('warn', null, context.room!);\r\n\t\t}\r\n\t\tif (!user.can('warn', null, context.room!) && !isCreate && !isForSelf) {\r\n\t\t\tthrow new Chat.ErrorMessage(`You can't ${type} giveways for other users.`);\r\n\t\t}\r\n\t}\r\n\r\n\tstatic checkBanned(room: Room, user: User) {\r\n\t\treturn Punishments.hasRoomPunishType(room, toID(user), 'GIVEAWAYBAN');\r\n\t}\r\n\r\n\tstatic ban(room: Room, user: User, reason: string) {\r\n\t\tPunishments.roomPunish(room, user, {\r\n\t\t\ttype: 'GIVEAWAYBAN',\r\n\t\t\tid: toID(user),\r\n\t\t\texpireTime: Date.now() + BAN_DURATION,\r\n\t\t\treason,\r\n\t\t});\r\n\t}\r\n\r\n\tstatic unban(room: Room, user: User) {\r\n\t\tPunishments.roomUnpunish(room, user.id, 'GIVEAWAYBAN', false);\r\n\t}\r\n\r\n\tstatic getSprite(set: PokemonSet): [ID, Chat.VNode] {\r\n\t\tconst species = Dex.species.get(set.species);\r\n\t\tlet spriteid = species.spriteid;\r\n\t\tif (species.cosmeticFormes) {\r\n\t\t\tfor (const forme of species.cosmeticFormes.map(toID)) {\r\n\t\t\t\tif (toID(set.species).includes(forme)) {\r\n\t\t\t\t\tspriteid += '-' + forme.slice(species.baseSpecies.length);\r\n\t\t\t\t\tbreak; // We don't want to end up with deerling-summer-spring\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!spriteid.includes('-') && species.forme) { // for stuff like unown letters\r\n\t\t\tspriteid += '-' + toID(species.forme);\r\n\t\t}\r\n\t\tconst shiny = set.shiny ? '-shiny' : '';\r\n\r\n\t\tconst validFemale = [\r\n\t\t\t'abomasnow', 'aipom', 'ambipom', 'beautifly', 'bibarel', 'bidoof', 'blaziken', 'buizel', 'cacturne', 'camerupt', 'combee',\r\n\t\t\t'combusken', 'croagunk', 'donphan', 'dustox', 'finneon', 'floatzel', 'frillish', 'gabite', 'garchomp', 'gible', 'girafarig',\r\n\t\t\t'gligar', 'golbat', 'gulpin', 'heracross', 'hippopotas', 'hippowdon', 'houndoom', 'indeedee', 'jellicent', 'kerfluffle', 'kitsunoh',\r\n\t\t\t'kricketot', 'kricketune', 'ledian', 'ledyba', 'ludicolo', 'lumineon', 'luxio', 'luxray', 'magikarp', 'mamoswine', 'medicham',\r\n\t\t\t'meditite', 'meganium', 'meowstic', 'milotic', 'murkrow', 'nidoran', 'numel', 'nuzleaf', 'octillery', 'pachirisu', 'pikachu',\r\n\t\t\t'pikachu-starter', 'piloswine', 'politoed', 'protowatt', 'pyroar', 'quagsire', 'raticate', 'rattata', 'relicanth', 'rhydon',\r\n\t\t\t'rhyperior', 'roselia', 'roserade', 'rotom', 'scizor', 'scyther', 'shiftry', 'shinx', 'sneasel', 'snover', 'staraptor', 'staravia',\r\n\t\t\t'starly', 'steelix', 'sudowoodo', 'swalot', 'tangrowth', 'torchic', 'toxicroak', 'unfezant', 'unown', 'ursaring', 'voodoom',\r\n\t\t\t'weavile', 'wobbuffet', 'wooper', 'xatu', 'zubat',\r\n\t\t];\r\n\t\tif (set.gender === 'F' && validFemale.includes(species.id)) spriteid += '-f';\r\n\t\treturn [\r\n\t\t\tspecies.id,\r\n\t\t\t,\r\n\t\t];\r\n\t}\r\n\r\n\tstatic updateStats(pokemonIDs: Set) {\r\n\t\tfor (const mon of pokemonIDs) {\r\n\t\t\tif (!wifiData.stats[mon]) wifiData.stats[mon] = [];\r\n\t\t\twifiData.stats[mon].push(Date.now());\r\n\t\t}\r\n\t\tsaveData();\r\n\t}\r\n\r\n\t// Wi-Fi uses special IV syntax to show hyper trained IVs\r\n\tstatic convertIVs(setObj: PokemonSet, ivs: string[]) {\r\n\t\tlet set = Teams.exportSet(setObj);\r\n\t\tlet ivsStr = '';\r\n\t\tif (ivs.length) {\r\n\t\t\tconst convertedIVs = {hp: '31', atk: '31', def: '31', spa: '31', spd: '31', spe: '31'};\r\n\t\t\tfor (const [i, iv] of ivs.entries()) {\r\n\t\t\t\tconst numStr = iv.trim().split(' ')[0];\r\n\t\t\t\tconst statName = statNames[i];\r\n\t\t\t\tconvertedIVs[toID(statName) as StatID] = numStr;\r\n\t\t\t}\r\n\t\t\tconst array = Object.keys(convertedIVs).map((x, i) => `${convertedIVs[x as StatID]} ${statNames[i]}`);\r\n\t\t\tivsStr = `IVs: ${array.join(' / ')} `;\r\n\t\t}\r\n\t\tif (ivsStr) {\r\n\t\t\tif (/\\nivs:/i.test(set)) {\r\n\t\t\t\tconst arr = set.split('\\n');\r\n\t\t\t\tconst index = arr.findIndex(x => /^ivs:/i.test(x));\r\n\t\t\t\tarr[index] = ivsStr;\r\n\t\t\t\tset = arr.join('\\n');\r\n\t\t\t} else if (/nature\\n/i.test(set)) {\r\n\t\t\t\tconst arr = set.split('\\n');\r\n\t\t\t\tconst index = arr.findIndex(x => /nature$/i.test(x));\r\n\t\t\t\tarr.splice(index + 1, 0, ivsStr);\r\n\t\t\t\tset = arr.join('\\n');\r\n\t\t\t} else {\r\n\t\t\t\tset += `\\n${ivsStr}`;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn set;\r\n\t}\r\n\r\n\tgenerateWindow(rightSide: Chat.VNode | string): Chat.VNode {\r\n\t\tconst set = Giveaway.convertIVs(this.prize, this.ivs);\r\n\t\treturn
\r\n\t\t\t

It's {this.game} giveaway time!

\r\n\t\t\tGiveaway started by {this.host.name}\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t{!!this.extraInfo?.trim().length && \r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t
\r\n\t\t\t\t\t\tGiver: {this.giver.name}
\r\n\t\t\t\t\t\tOT: {this.ot}, TID: {this.tid}\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t {this.sprite}
\r\n\t\t\t\t\t\t{set}\r\n\t\t\t\t\t
{rightSide}
\r\n\t\t\t\t\t\tExtra Information
\r\n\t\t\t\t\t\t{this.extraInfo.trim().replace(/
/g, '\\n')}
\r\n\t\t\t\t\t
\r\n\t\t\t

\r\n\t\t\t\tNote: You must have a Switch, Pokémon {gameName[this.game]}, {}\r\n\t\t\t\tand Nintendo Switch Online to receive the prize. {}\r\n\t\t\t\tDo not join if you are currently unable to trade. Do not enter if you have already won this exact Pokémon, {}\r\n\t\t\t\tunless it is explicitly allowed.\r\n\t\t\t

\r\n\t\t
;\r\n\t}\r\n}\r\n\r\nexport class QuestionGiveaway extends Giveaway {\r\n\ttype: string;\r\n\tquestion: string;\r\n\tanswers: string[];\r\n\t/** userid: number of guesses */\r\n\tanswered: Utils.Multiset;\r\n\twinner: User | null;\r\n\r\n\tconstructor(\r\n\t\thost: User, giver: User, room: Room, ot: string, tid: string, game: Game, ivs: string[],\r\n\t\tprize: PokemonSet, question: string, answers: string[], ball: string, extraInfo: string\r\n\t) {\r\n\t\tsuper(host, giver, room, ot, tid, ivs, prize, game, ball, extraInfo);\r\n\t\tthis.type = 'question';\r\n\t\tthis.phase = 'pending';\r\n\r\n\t\tthis.question = question;\r\n\t\tthis.answers = QuestionGiveaway.sanitizeAnswers(answers);\r\n\t\tthis.answered = new Utils.Multiset();\r\n\t\tthis.winner = null;\r\n\t\tthis.send(this.generateWindow('The question will be displayed in one minute! Use /guess to answer.'), true);\r\n\r\n\t\tthis.timer = setTimeout(() => this.start(), 1000 * 60);\r\n\t}\r\n\r\n\tstatic splitTarget(\r\n\t\ttarget: string, sep = '|', context: Chat.CommandContext,\r\n\t\tuser: User, type: 'create' | 'store' | 'submit'\r\n\t) {\r\n\t\tlet [\r\n\t\t\tgiver, ot, tid, game, question, answers, ivs, ball, extraInfo, ...prize\r\n\t\t] = target.split(sep).map(param => param.trim());\r\n\t\tif (!(giver && ot && tid && prize?.length && question && answers?.split(',').length)) {\r\n\t\t\tcontext.parse(`/help giveaway`);\r\n\t\t\tthrow new Chat.Interruption();\r\n\t\t}\r\n\t\tconst targetUser = Users.get(giver);\r\n\t\tif (!targetUser?.connected) throw new Chat.ErrorMessage(`User '${giver}' is not online.`);\r\n\r\n\t\tGiveaway.checkCanCreate(context, targetUser, type);\r\n\r\n\t\tif (!!ivs && ivs.split('/').length !== 6) {\r\n\t\t\tthrow new Chat.ErrorMessage(`If you provide IVs, they must be provided for all stats.`);\r\n\t\t}\r\n\t\tif (!game) game = 'SV';\r\n\t\tgame = gameidToGame[toID(game)] || game as Game;\r\n\t\tif (!game || !['SV', 'BDSP', 'SwSh'].includes(game)) {\r\n\t\t\tthrow new Chat.ErrorMessage(`The game must be \"SV,\" \"BDSP,\" or \"SwSh\".`);\r\n\t\t}\r\n\t\tif (!ball) ball = 'pokeball';\r\n\t\tif (!toID(ball).endsWith('ball')) ball = toID(ball) + 'ball';\r\n\t\tif (!Dex.items.get(ball).isPokeball) {\r\n\t\t\tthrow new Chat.ErrorMessage(`${Dex.items.get(ball).name} is not a Pok\\u00e9 Ball.`);\r\n\t\t}\r\n\t\ttid = toID(tid);\r\n\t\tif (isNaN(parseInt(tid)) || tid.length < 5 || tid.length > 6) throw new Chat.ErrorMessage(\"Invalid TID\");\r\n\t\tif (!targetUser.autoconfirmed) {\r\n\t\t\tthrow new Chat.ErrorMessage(`User '${targetUser.name}' needs to be autoconfirmed to give something away.`);\r\n\t\t}\r\n\t\tif (Giveaway.checkBanned(context.room!, targetUser)) {\r\n\t\t\tthrow new Chat.ErrorMessage(`User '${targetUser.name}' is giveaway banned.`);\r\n\t\t}\r\n\t\treturn {\r\n\t\t\ttargetUser, ot, tid, game: game as Game, question, answers: answers.split(','),\r\n\t\t\tivs: ivs.split('/'), ball, extraInfo, prize: prize.join('|'),\r\n\t\t};\r\n\t}\r\n\r\n\tgenerateQuestion() {\r\n\t\treturn this.generateWindow(<>\r\n\t\t\t

Giveaway Question: {this.question}

\r\n\t\t\t

use /guess to answer.

\r\n\t\t);\r\n\t}\r\n\r\n\tstart() {\r\n\t\tthis.changeUhtml(

\r\n\t\t\tThe giveaway has started! Scroll down to see the question.\r\n\t\t

);\r\n\t\tthis.phase = 'started';\r\n\t\tthis.send(this.generateQuestion());\r\n\t\tthis.timer = setTimeout(() => this.end(false), 1000 * 60 * 5);\r\n\t}\r\n\r\n\tchoose(user: User, guess: string) {\r\n\t\tif (this.phase !== 'started') return user.sendTo(this.room, \"The giveaway has not started yet.\");\r\n\r\n\t\tif (this.checkJoined(user) && ![...this.joined.values()].includes(user.id)) {\r\n\t\t\treturn user.sendTo(this.room, \"You have already joined the giveaway.\");\r\n\t\t}\r\n\t\tif (Giveaway.checkBanned(this.room, user)) return user.sendTo(this.room, \"You are banned from entering giveaways.\");\r\n\t\tif (this.checkExcluded(user)) return user.sendTo(this.room, \"You are disallowed from entering the giveaway.\");\r\n\r\n\t\tif ((this.answered.get(user.id) ?? 0) >= 3) {\r\n\t\t\treturn user.sendTo(\r\n\t\t\t\tthis.room,\r\n\t\t\t\t\"You have already guessed three times. You cannot guess anymore in this.giveaway.\"\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tconst sanitized = toID(guess);\r\n\r\n\t\tfor (const answer of this.answers.map(toID)) {\r\n\t\t\tif (answer === sanitized) {\r\n\t\t\t\tthis.winner = user;\r\n\t\t\t\tthis.clearTimer();\r\n\t\t\t\treturn this.end(false);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.joined.set(user.latestIp, user.id);\r\n\t\tthis.answered.add(user.id);\r\n\t\tif ((this.answered.get(user.id) ?? 0) >= 3) {\r\n\t\t\tuser.sendTo(\r\n\t\t\t\tthis.room,\r\n\t\t\t\t`Your guess '${guess}' is wrong. You have used up all of your guesses. Better luck next time!`\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\tuser.sendTo(this.room, `Your guess '${guess}' is wrong. Try again!`);\r\n\t\t}\r\n\t}\r\n\r\n\tchange(value: string, user: User, answer = false) {\r\n\t\tif (user.id !== this.host.id) return user.sendTo(this.room, \"Only the host can edit the giveaway.\");\r\n\t\tif (this.phase !== 'pending') {\r\n\t\t\treturn user.sendTo(this.room, \"You cannot change the question or answer once the giveaway has started.\");\r\n\t\t}\r\n\t\tif (!answer) {\r\n\t\t\tthis.question = value;\r\n\t\t\treturn user.sendTo(this.room, `The question has been changed to ${value}.`);\r\n\t\t}\r\n\t\tconst ans = QuestionGiveaway.sanitizeAnswers(value.split(',').map(val => val.trim()));\r\n\t\tif (!ans.length) {\r\n\t\t\treturn user.sendTo(this.room, \"You must specify at least one answer and it must not contain any special characters.\");\r\n\t\t}\r\n\t\tthis.answers = ans;\r\n\t\tuser.sendTo(this.room, `The answer${Chat.plural(ans, \"s have\", \"has\")} been changed to ${ans.join(', ')}.`);\r\n\t}\r\n\r\n\tend(force: boolean) {\r\n\t\tconst style = {textAlign: 'center', fontSize: '13pt', fontWeight: 'bold'};\r\n\t\tif (force) {\r\n\t\t\tthis.clearTimer();\r\n\t\t\tthis.changeUhtml(

The giveaway was forcibly ended.

);\r\n\t\t\tthis.room.send(\"The giveaway was forcibly ended.\");\r\n\t\t} else {\r\n\t\t\tif (!this.winner) {\r\n\t\t\t\tthis.changeUhtml(

The giveaway was forcibly ended.

);\r\n\t\t\t\tthis.room.send(\"The giveaway has been forcibly ended as no one has answered the question.\");\r\n\t\t\t} else {\r\n\t\t\t\tthis.changeUhtml(

The giveaway has ended! Scroll down to see the answer.

);\r\n\t\t\t\tthis.phase = 'ended';\r\n\t\t\t\tthis.clearTimer();\r\n\t\t\t\tthis.room.modlog({\r\n\t\t\t\t\taction: 'GIVEAWAY WIN',\r\n\t\t\t\t\tuserid: this.winner.id,\r\n\t\t\t\t\tnote: `${this.giver.name}'s giveaway for a \"${this.prize.species}\" (OT: ${this.ot} TID: ${this.tid} Nature: ${this.prize.nature} Ball: ${this.ball}${this.extraInfo ? ` Other box info: ${this.extraInfo}` : ''})`,\r\n\t\t\t\t});\r\n\t\t\t\tthis.send(this.generateWindow(<>\r\n\t\t\t\t\t

\r\n\t\t\t\t\t\t{this.winner.name} won the giveaway! Congratulations!\r\n\t\t\t\t\t

\r\n\t\t\t\t\t

\r\n\t\t\t\t\t\t{this.question}
\r\n\t\t\t\t\t\tCorrect answer{Chat.plural(this.answers)}: {this.answers.join(', ')}\r\n\t\t\t\t\t

\r\n\t\t\t\t));\r\n\t\t\t\tthis.winner.sendTo(\r\n\t\t\t\t\tthis.room,\r\n\t\t\t\t\t`|raw|You have won the giveaway. PM ${Utils.escapeHTML(this.giver.name)} to claim your prize!`\r\n\t\t\t\t);\r\n\t\t\t\tif (this.winner.connected) {\r\n\t\t\t\t\tthis.winner.popup(`You have won the giveaway. PM **${this.giver.name}** to claim your prize!`);\r\n\t\t\t\t}\r\n\t\t\t\tif (this.giver.connected) this.giver.popup(`${this.winner.name} has won your question giveaway!`);\r\n\t\t\t\tGiveaway.updateStats(new Set([this.pokemonID]));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.destroy();\r\n\t}\r\n\r\n\tstatic sanitize(str: string) {\r\n\t\treturn str.toLowerCase().replace(/[^a-z0-9 .-]+/ig, \"\").trim();\r\n\t}\r\n\r\n\tstatic sanitizeAnswers(answers: string[]) {\r\n\t\treturn answers.map(\r\n\t\t\tval => QuestionGiveaway.sanitize(val)\r\n\t\t).filter(\r\n\t\t\t(val, index, array) => toID(val).length && array.indexOf(val) === index\r\n\t\t);\r\n\t}\r\n\r\n\tcheckExcluded(user: User) {\r\n\t\tif (user === this.host) return true;\r\n\t\tif (this.host.ips.includes(user.latestIp) && !Config.noipchecks) return true;\r\n\t\tif (this.host.previousIDs.includes(toID(user))) return true;\r\n\t\treturn super.checkExcluded(user);\r\n\t}\r\n}\r\n\r\nexport class LotteryGiveaway extends Giveaway {\r\n\ttype: string;\r\n\twinners: User[];\r\n\tmaxWinners: number;\r\n\r\n\tconstructor(\r\n\t\thost: User, giver: User, room: Room, ot: string, tid: string, ivs: string[],\r\n\t\tgame: Game, prize: PokemonSet, winners: number, ball: string, extraInfo: string\r\n\t) {\r\n\t\tsuper(host, giver, room, ot, tid, ivs, prize, game, ball, extraInfo);\r\n\r\n\t\tthis.type = 'lottery';\r\n\t\tthis.phase = 'pending';\r\n\r\n\t\tthis.winners = [];\r\n\r\n\t\tthis.maxWinners = winners || 1;\r\n\r\n\t\tthis.send(this.generateReminder(false), true);\r\n\r\n\t\tthis.timer = setTimeout(() => this.drawLottery(), 1000 * 60 * 2);\r\n\t}\r\n\r\n\tstatic splitTarget(\r\n\t\ttarget: string, sep = '|', context: Chat.CommandContext,\r\n\t\tuser: User, type: 'create' | 'store' | 'submit'\r\n\t) {\r\n\t\tlet [giver, ot, tid, game, winners, ivs, ball, extraInfo, ...prize] = target.split(sep).map(param => param.trim());\r\n\t\tif (!(giver && ot && tid && prize?.length)) {\r\n\t\t\tcontext.parse(`/help giveaway`);\r\n\t\t\tthrow new Chat.Interruption();\r\n\t\t}\r\n\t\tconst targetUser = Users.get(giver);\r\n\t\tif (!targetUser?.connected) throw new Chat.ErrorMessage(`User '${giver}' is not online.`);\r\n\r\n\t\tGiveaway.checkCanCreate(context, user, type);\r\n\r\n\t\tif (!!ivs && ivs.split('/').length !== 6) {\r\n\t\t\tthrow new Chat.ErrorMessage(`If you provide IVs, they must be provided for all stats.`);\r\n\t\t}\r\n\t\tif (!game) game = 'SV';\r\n\t\tgame = gameidToGame[toID(game)] || game as Game;\r\n\t\tif (!game || !['SV', 'BDSP', 'SwSh'].includes(game)) {\r\n\t\t\tthrow new Chat.ErrorMessage(`The game must be \"SV,\" \"BDSP,\" or \"SwSh\".`);\r\n\t\t}\r\n\t\tif (!ball) ball = 'pokeball';\r\n\t\tif (!toID(ball).endsWith('ball')) ball = toID(ball) + 'ball';\r\n\t\tif (!Dex.items.get(ball).isPokeball) {\r\n\t\t\tthrow new Chat.ErrorMessage(`${Dex.items.get(ball).name} is not a Pok\\u00e9 Ball.`);\r\n\t\t}\r\n\t\ttid = toID(tid);\r\n\t\tif (isNaN(parseInt(tid)) || tid.length < 5 || tid.length > 6) throw new Chat.ErrorMessage(\"Invalid TID\");\r\n\t\tif (!targetUser.autoconfirmed) {\r\n\t\t\tthrow new Chat.ErrorMessage(`User '${targetUser.name}' needs to be autoconfirmed to give something away.`);\r\n\t\t}\r\n\t\tif (Giveaway.checkBanned(context.room!, targetUser)) {\r\n\t\t\tthrow new Chat.ErrorMessage(`User '${targetUser.name}' is giveaway banned.`);\r\n\t\t}\r\n\r\n\t\tlet numWinners = 1;\r\n\t\tif (winners) {\r\n\t\t\tnumWinners = parseInt(winners);\r\n\t\t\tif (isNaN(numWinners) || numWinners < 1 || numWinners > 5) {\r\n\t\t\t\tthrow new Chat.ErrorMessage(\"The lottery giveaway can have a minimum of 1 and a maximum of 5 winners.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn {\r\n\t\t\ttargetUser, ot, tid, game: game as Game, winners: numWinners,\r\n\t\t\tivs: ivs.split('/'), ball, extraInfo, prize: prize.join('|'),\r\n\t\t};\r\n\t}\r\n\r\n\tgenerateReminder(joined = false) {\r\n\t\tconst cmd = (joined ? 'Leave' : 'Join');\r\n\t\treturn this.generateWindow(<>\r\n\t\t\tThe lottery drawing will occur in 2 minutes, and with {Chat.count(this.maxWinners, \"winners\")}!
\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tdisplay() {\r\n\t\tconst joined = this.generateReminder(true);\r\n\t\tconst notJoined = this.generateReminder();\r\n\r\n\t\tfor (const i in this.room.users) {\r\n\t\t\tconst thisUser = this.room.users[i];\r\n\t\t\tif (this.checkJoined(thisUser)) {\r\n\t\t\t\tthis.sendToUser(thisUser, joined);\r\n\t\t\t} else {\r\n\t\t\t\tthis.sendToUser(thisUser, notJoined);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\taddUser(user: User) {\r\n\t\tif (this.phase !== 'pending') return user.sendTo(this.room, \"The join phase of the lottery giveaway has ended.\");\r\n\r\n\t\tif (!user.named) return user.sendTo(this.room, \"You need to choose a name before joining a lottery giveaway.\");\r\n\t\tif (this.checkJoined(user)) return user.sendTo(this.room, \"You have already joined the giveaway.\");\r\n\t\tif (Giveaway.checkBanned(this.room, user)) return user.sendTo(this.room, \"You are banned from entering giveaways.\");\r\n\t\tif (this.checkExcluded(user)) return user.sendTo(this.room, \"You are disallowed from entering the giveaway.\");\r\n\r\n\t\tthis.joined.set(user.latestIp, user.id);\r\n\t\tthis.sendToUser(user, this.generateReminder(true));\r\n\t\tuser.sendTo(this.room, \"You have successfully joined the lottery giveaway.\");\r\n\t}\r\n\r\n\tremoveUser(user: User) {\r\n\t\tif (this.phase !== 'pending') return user.sendTo(this.room, \"The join phase of the lottery giveaway has ended.\");\r\n\t\tif (!this.checkJoined(user)) return user.sendTo(this.room, \"You have not joined the lottery giveaway.\");\r\n\t\tfor (const [ip, id] of this.joined) {\r\n\t\t\tif (ip === user.latestIp && !Config.noipchecks || id === user.id) {\r\n\t\t\t\tthis.joined.delete(ip);\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.sendToUser(user, this.generateReminder(false));\r\n\t\tuser.sendTo(this.room, \"You have left the lottery giveaway.\");\r\n\t}\r\n\r\n\tdrawLottery() {\r\n\t\tthis.clearTimer();\r\n\r\n\t\tconst userlist = [...this.joined.values()];\r\n\t\tif (userlist.length === 0) {\r\n\t\t\tthis.changeUhtml(

\r\n\t\t\t\tThe giveaway was forcibly ended.\r\n\t\t\t

);\r\n\t\t\tthis.room.send(\"The giveaway has been forcibly ended as there are no participants.\");\r\n\t\t\treturn this.destroy();\r\n\t\t}\r\n\r\n\t\twhile (this.winners.length < this.maxWinners && userlist.length > 0) {\r\n\t\t\tconst winner = Users.get(userlist.splice(Math.floor(Math.random() * userlist.length), 1)[0]);\r\n\t\t\tif (!winner) continue;\r\n\t\t\tthis.winners.push(winner);\r\n\t\t}\r\n\t\tthis.end();\r\n\t}\r\n\r\n\tend(force = false) {\r\n\t\tconst style = {textAlign: 'center', fontSize: '13pt', fontWeight: 'bold'};\r\n\t\tif (force) {\r\n\t\t\tthis.clearTimer();\r\n\t\t\tthis.changeUhtml(

The giveaway was forcibly ended.

);\r\n\t\t\tthis.room.send(\"The giveaway was forcibly ended.\");\r\n\t\t} else {\r\n\t\t\tthis.changeUhtml(

\r\n\t\t\t\tThe giveaway has ended! Scroll down to see the winner{Chat.plural(this.winners)}.\r\n\t\t\t

);\r\n\t\t\tthis.phase = 'ended';\r\n\t\t\tconst winnerNames = this.winners.map(winner => winner.name).join(', ');\r\n\t\t\tthis.room.modlog({\r\n\t\t\t\taction: 'GIVEAWAY WIN',\r\n\t\t\t\tnote: `${winnerNames} won ${this.giver.name}'s giveaway for \"${this.prize.species}\" (OT: ${this.ot} TID: ${this.tid} Nature: ${this.prize.nature} Ball: ${this.ball}${this.extraInfo ? ` Other box info: ${this.extraInfo}` : ''})`,\r\n\t\t\t});\r\n\t\t\tthis.send(this.generateWindow(<>\r\n\t\t\t\t

Lottery Draw

\r\n\t\t\t\t

{Chat.count(this.joined.size, 'users')} joined the giveaway.
\r\n\t\t\t\tOur lucky winner{Chat.plural(this.winners)}: {winnerNames}!
Congratulations!

\r\n\t\t\t));\r\n\t\t\tfor (const winner of this.winners) {\r\n\t\t\t\twinner.sendTo(\r\n\t\t\t\t\tthis.room,\r\n\t\t\t\t\t`|raw|You have won the lottery giveaway! PM ${this.giver.name} to claim your prize!`\r\n\t\t\t\t);\r\n\t\t\t\tif (winner.connected) {\r\n\t\t\t\t\twinner.popup(`You have won the lottery giveaway! PM **${this.giver.name}** to claim your prize!`);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (this.giver.connected) this.giver.popup(`The following users have won your lottery giveaway:\\n${winnerNames}`);\r\n\t\t\tGiveaway.updateStats(new Set([this.pokemonID]));\r\n\t\t}\r\n\t\tthis.destroy();\r\n\t}\r\n}\r\n\r\nexport class GTS extends Rooms.SimpleRoomGame {\r\n\tgtsNumber: number;\r\n\troom: Room;\r\n\tgiver: User;\r\n\tleft: number;\r\n\tsummary: string;\r\n\tdeposit: string;\r\n\tlookfor: string;\r\n\tpokemonID: ID;\r\n\tsprite: Chat.VNode;\r\n\tsent: string[];\r\n\tnoDeposits: boolean;\r\n\ttimer: NodeJS.Timer | null;\r\n\r\n\tconstructor(\r\n\t\troom: Room, giver: User, amount: number,\r\n\t\tsummary: string, deposit: string, lookfor: string\r\n\t) {\r\n\t\t// Always a sub-game so tours etc can be ran while GTS games are running\r\n\t\tsuper(room, true);\r\n\t\tthis.gtsNumber = room.nextGameNumber();\r\n\t\tthis.room = room;\r\n\t\tthis.giver = giver;\r\n\t\tthis.left = amount;\r\n\t\tthis.summary = summary;\r\n\t\tthis.deposit = GTS.linkify(Utils.escapeHTML(deposit));\r\n\t\tthis.lookfor = lookfor;\r\n\r\n\t\t// Deprecated, just typed like this to prevent errors, will rewrite when GTS is planned to be used again\r\n\t\t[this.pokemonID, this.sprite] = Giveaway.getSprite({species: summary} as PokemonSet);\r\n\r\n\t\tthis.sent = [];\r\n\t\tthis.noDeposits = false;\r\n\r\n\t\tthis.timer = setInterval(() => this.send(this.generateWindow()), 1000 * 60 * 5);\r\n\t\tthis.send(this.generateWindow());\r\n\t}\r\n\r\n\tsend(content: string) {\r\n\t\tthis.room.add(Chat.html`|uhtml|gtsga${this.gtsNumber}|${
{content}
}`);\r\n\t\tthis.room.update();\r\n\t}\r\n\r\n\tchangeUhtml(content: string) {\r\n\t\tthis.room.uhtmlchange(`gtsga${this.gtsNumber}`, Chat.html`${
{content}
}`);\r\n\t\tthis.room.update();\r\n\t}\r\n\r\n\tclearTimer() {\r\n\t\tif (this.timer) {\r\n\t\t\tclearTimeout(this.timer);\r\n\t\t\tthis.timer = null;\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateWindow() {\r\n\t\tconst sentModifier = this.sent.length ? 5 : 0;\r\n\t\tconst rightSide = this.noDeposits ?\r\n\t\t\t\r\n\t\t\t\tMore Pokémon have been deposited than there are prizes in this giveaway and new deposits will not be accepted. {}\r\n\t\t\t\tIf you have already deposited a Pokémon, please be patient, and do not withdraw your Pokémon.\r\n\t\t\t : <>\r\n\t\t\t\tTo participate, deposit {this.deposit} into the GTS and look for {this.lookfor}\r\n\t\t\t;\r\n\t\treturn <>\r\n\t\t\t

\r\n\t\t\t\tThere is a GTS giveaway going on!\r\n\t\t\t

\r\n\t\t\t

\r\n\t\t\t\tHosted by: {this.giver.name} | Left: {this.left}\r\n\t\t\t

\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{!!sentModifier && }\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t\t\t\tLast winners:
\r\n\t\t\t\t\t\t{this.sent.join(
)}\r\n\t\t\t\t\t
{this.sprite}\r\n\t\t\t\t\t\t{this.summary}\r\n\t\t\t\t\t{rightSide}
\r\n\t\t;\r\n\t}\r\n\r\n\tupdateLeft(num: number) {\r\n\t\tthis.left = num;\r\n\t\tif (this.left < 1) return this.end();\r\n\r\n\t\tthis.changeUhtml(this.generateWindow());\r\n\t}\r\n\r\n\tupdateSent(ign: string) {\r\n\t\tthis.left--;\r\n\t\tif (this.left < 1) return this.end();\r\n\r\n\t\tthis.sent.push(ign);\r\n\t\tif (this.sent.length > 5) this.sent.shift();\r\n\r\n\t\tthis.changeUhtml(this.generateWindow());\r\n\t}\r\n\r\n\tstopDeposits() {\r\n\t\tthis.noDeposits = true;\r\n\r\n\t\tthis.room.send(Chat.html`|html|${

\r\n\t\t\tMore Pokémon have been deposited than there are prizes in this giveaway and new deposits will not be accepted. {}\r\n\t\t\tIf you have already deposited a Pokémon, please be patient, and do not withdraw your Pokémon.\r\n\t\t

}`);\r\n\t\tthis.changeUhtml(this.generateWindow());\r\n\t}\r\n\r\n\tend(force = false) {\r\n\t\tif (force) {\r\n\t\t\tthis.clearTimer();\r\n\t\t\tthis.changeUhtml(\r\n\t\t\t\t

The GTS giveaway was forcibly ended.

\r\n\t\t\t);\r\n\t\t\tthis.room.send(\"The GTS giveaway was forcibly ended.\");\r\n\t\t} else {\r\n\t\t\tthis.clearTimer();\r\n\t\t\tthis.changeUhtml(\r\n\t\t\t\t

The GTS giveaway has finished.

\r\n\t\t\t);\r\n\t\t\tthis.room.modlog({\r\n\t\t\t\taction: 'GTS FINISHED',\r\n\t\t\t\tuserid: this.giver.id,\r\n\t\t\t\tnote: `their GTS giveaway for \"${this.summary}\"`,\r\n\t\t\t});\r\n\t\t\tthis.send(

\r\n\t\t\t\tThe GTS giveaway for a \"{this.lookfor}\" has finished.\r\n\t\t\t

);\r\n\t\t\tGiveaway.updateStats(new Set([this.pokemonID]));\r\n\t\t}\r\n\t\tthis.room.subGame = null;\r\n\t\treturn this.left;\r\n\t}\r\n\r\n\t// This currently doesn't match some of the edge cases the other pokemon matching function does account for\r\n\t// (such as Type: Null). However, this should never be used as a fodder mon anyway,\r\n\t// so I don't see a huge need to implement it.\r\n\tstatic linkify(text: string) {\r\n\t\tconst parsed = toID(text);\r\n\r\n\t\tfor (const species of Dex.species.all()) {\r\n\t\t\tconst id = species.id;\r\n\t\t\tconst regexp = new RegExp(`\\\\b${id}\\\\b`, 'ig');\r\n\t\t\tconst res = regexp.exec(parsed);\r\n\t\t\tif (res) {\r\n\t\t\t\tconst num = String(species.num).padStart(3, '0');\r\n\t\t\t\treturn <>\r\n\t\t\t\t\t{text.slice(0, res.index)}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{text.slice(res.index, res.index + res[0].length)}\r\n\t\t\t\t\t\r\n\t\t\t\t\t{text.slice(res.index + res[0].length)}\r\n\t\t\t\t;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn text;\r\n\t}\r\n}\r\n\r\nfunction hasSubmittedGiveaway(user: User) {\r\n\tfor (const [key, giveaways] of Object.entries(wifiData.submittedGiveaways)) {\r\n\t\tfor (const [index, giveaway] of giveaways.entries()) {\r\n\t\t\tif (user.id === giveaway.targetUserID) {\r\n\t\t\t\treturn {index, type: key as 'question' | 'lottery'};\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}\r\n\r\nexport const handlers: Chat.Handlers = {\r\n\tonDisconnect(user) {\r\n\t\tconst giveaway = hasSubmittedGiveaway(user);\r\n\t\tif (giveaway) {\r\n\t\t\twifiData.submittedGiveaways[giveaway.type].splice(giveaway.index, 1);\r\n\t\t\tsaveData();\r\n\t\t}\r\n\t},\r\n};\r\n\r\nexport const commands: Chat.ChatCommands = {\r\n\tgts: {\r\n\t\tnew: 'start',\r\n\t\tcreate: 'start',\r\n\t\tstart(target, room, user) {\r\n\t\t\troom = this.room = Rooms.search('wifi') || null;\r\n\t\t\tif (!room) {\r\n\t\t\t\tthrow new Chat.ErrorMessage(`This command must be used in the Wi-Fi room.`);\r\n\t\t\t}\r\n\t\t\tif (room.getGame(GTS, true)) {\r\n\t\t\t\tthrow new Chat.ErrorMessage(`There is already a GTS Giveaway going on.`);\r\n\t\t\t}\r\n\t\t\t// GTS is currently deprecated until it's no longer behind a paywall\r\n\t\t\treturn this.parse(`/help gts`);\r\n\t\t\t/*\r\n\t\t\tconst [giver, amountStr, summary, deposit, lookfor] = target.split(target.includes('|') ? '|' : ',').map(\r\n\t\t\t\tparam => param.trim()\r\n\t\t\t);\r\n\t\t\tif (!(giver && amountStr && summary && deposit && lookfor)) {\r\n\t\t\t\treturn this.errorReply(\"Invalid arguments specified - /gts start giver | amount | summary | deposit | lookfor\");\r\n\t\t\t}\r\n\t\t\tconst amount = parseInt(amountStr);\r\n\t\t\tif (!amount || amount < 20 || amount > 100) {\r\n\t\t\t\treturn this.errorReply(\"Please enter a valid amount. For a GTS giveaway, you need to give away at least 20 mons, and no more than 100.\");\r\n\t\t\t}\r\n\t\t\tconst targetUser = Users.get(giver);\r\n\t\t\tif (!targetUser?.connected) return this.errorReply(`User '${giver}' is not online.`);\r\n\t\t\tthis.checkCan('warn', null, room);\r\n\t\t\tif (!targetUser.autoconfirmed) {\r\n\t\t\t\treturn this.errorReply(`User '${targetUser.name}' needs to be autoconfirmed to host a giveaway.`);\r\n\t\t\t}\r\n\t\t\tif (Giveaway.checkBanned(room, targetUser)) return this.errorReply(`User '${targetUser.name}' is giveaway banned.`);\r\n\r\n\t\t\troom.subGame = new GTS(room, targetUser, amount, summary, deposit, lookfor);\r\n\r\n\t\t\tthis.privateModAction(`${user.name} started a GTS giveaway for ${targetUser.name} with ${amount} Pok\u00E9mon`);\r\n\t\t\tthis.modlog('GTS GIVEAWAY', null, `for ${targetUser.getLastId()} with ${amount} Pok\u00E9mon`);\r\n\t\t\t*/\r\n\t\t},\r\n\t\tleft(target, room, user) {\r\n\t\t\troom = this.requireRoom('wifi' as RoomID);\r\n\t\t\tconst game = this.requireGame(GTS, true);\r\n\t\t\tif (!user.can('warn', null, room) && user !== game.giver) {\r\n\t\t\t\tthrow new Chat.ErrorMessage(\"Only the host or a staff member can update GTS giveaways.\");\r\n\t\t\t}\r\n\t\t\tif (!target) {\r\n\t\t\t\tthis.runBroadcast();\r\n\t\t\t\tlet output = `The GTS giveaway from ${game.giver} has ${game.left} Pok\u00E9mon remaining!`;\r\n\t\t\t\tif (game.sent.length) output += `Last winners: ${game.sent.join(', ')}`;\r\n\t\t\t\treturn this.sendReply(output);\r\n\t\t\t}\r\n\t\t\tconst newamount = parseInt(target);\r\n\t\t\tif (isNaN(newamount)) return this.errorReply(\"Please enter a valid amount.\");\r\n\t\t\tif (newamount > game.left) return this.errorReply(\"The new amount must be lower than the old amount.\");\r\n\t\t\tif (newamount < game.left - 1) {\r\n\t\t\t\tthis.modlog(`GTS GIVEAWAY`, null, `set from ${game.left} to ${newamount} left`);\r\n\t\t\t}\r\n\r\n\t\t\tgame.updateLeft(newamount);\r\n\t\t},\r\n\t\tsent(target, room, user) {\r\n\t\t\troom = this.requireRoom('wifi' as RoomID);\r\n\t\t\tconst game = this.requireGame(GTS, true);\r\n\t\t\tif (!user.can('warn', null, room) && user !== game.giver) {\r\n\t\t\t\treturn this.errorReply(\"Only the host or a staff member can update GTS giveaways.\");\r\n\t\t\t}\r\n\r\n\t\t\tif (!target || target.length > 12) return this.errorReply(\"Please enter a valid IGN.\");\r\n\r\n\t\t\tgame.updateSent(target);\r\n\t\t},\r\n\t\tfull(target, room, user) {\r\n\t\t\troom = this.requireRoom('wifi' as RoomID);\r\n\t\t\tconst game = this.requireGame(GTS, true);\r\n\t\t\tif (!user.can('warn', null, room) && user !== game.giver) {\r\n\t\t\t\treturn this.errorReply(\"Only the host or a staff member can update GTS giveaways.\");\r\n\t\t\t}\r\n\t\t\tif (game.noDeposits) return this.errorReply(\"The GTS giveaway was already set to not accept deposits.\");\r\n\r\n\t\t\tgame.stopDeposits();\r\n\t\t},\r\n\t\tend(target, room, user) {\r\n\t\t\troom = this.requireRoom('wifi' as RoomID);\r\n\t\t\tconst game = this.requireGame(GTS, true);\r\n\t\t\tthis.checkCan('warn', null, room);\r\n\r\n\t\t\tif (target && target.length > 300) {\r\n\t\t\t\treturn this.errorReply(\"The reason is too long. It cannot exceed 300 characters.\");\r\n\t\t\t}\r\n\t\t\tconst amount = game.end(true);\r\n\t\t\tif (target) target = `: ${target}`;\r\n\t\t\tthis.modlog('GTS END', null, `with ${amount} left${target}`);\r\n\t\t\tthis.privateModAction(`The giveaway was forcibly ended by ${user.name} with ${amount} left${target}`);\r\n\t\t},\r\n\t},\r\n\tgtshelp: [\r\n\t\t`GTS giveaways are currently disabled. If you are a Room Owner and would like them to be re-enabled, contact Kris.`,\r\n\t],\r\n\tga: 'giveaway',\r\n\tgiveaway: {\r\n\t\thelp: '',\r\n\t\t''() {\r\n\t\t\tthis.runBroadcast();\r\n\t\t\tthis.run('giveawayhelp');\r\n\t\t},\r\n\t\tview: {\r\n\t\t\t''(target, room, user) {\r\n\t\t\t\tthis.room = room = Rooms.search('wifi') || null;\r\n\t\t\t\tif (!room) throw new Chat.ErrorMessage(`The Wi-Fi room doesn't exist on this server.`);\r\n\t\t\t\tthis.checkCan('warn', null, room);\r\n\t\t\t\tthis.parse(`/j view-giveaways-default`);\r\n\t\t\t},\r\n\t\t\tstored(target, room, user) {\r\n\t\t\t\tthis.room = room = Rooms.search('wifi') || null;\r\n\t\t\t\tif (!room) throw new Chat.ErrorMessage(`The Wi-Fi room doesn't exist on this server.`);\r\n\t\t\t\tthis.checkCan('warn', null, room);\r\n\t\t\t\tthis.parse(`/j view-giveaways-stored`);\r\n\t\t\t},\r\n\t\t\tsubmitted(target, room, user) {\r\n\t\t\t\tthis.room = room = Rooms.search('wifi') || null;\r\n\t\t\t\tif (!room) throw new Chat.ErrorMessage(`The Wi-Fi room doesn't exist on this server.`);\r\n\t\t\t\tthis.checkCan('warn', null, room);\r\n\t\t\t\tthis.parse(`/j view-giveaways-submitted`);\r\n\t\t\t},\r\n\t\t},\r\n\t\trm: 'remind',\r\n\t\tremind(target, room, user) {\r\n\t\t\troom = this.requireRoom('wifi' as RoomID);\r\n\t\t\tthis.runBroadcast();\r\n\t\t\tif (room.getGame(QuestionGiveaway)) {\r\n\t\t\t\tconst game = room.getGame(QuestionGiveaway)!;\r\n\t\t\t\tif (game.phase !== 'started') {\r\n\t\t\t\t\tthrow new Chat.ErrorMessage(`The giveaway has not started yet.`);\r\n\t\t\t\t}\r\n\t\t\t\tgame.send(game.generateQuestion());\r\n\t\t\t} else if (room.getGame(LotteryGiveaway)) {\r\n\t\t\t\troom.getGame(LotteryGiveaway)!.display();\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Chat.ErrorMessage(`There is no giveaway going on right now.`);\r\n\t\t\t}\r\n\t\t},\r\n\t\tleavelotto: 'join',\r\n\t\tleavelottery: 'join',\r\n\t\tleave: 'join',\r\n\t\tjoinlotto: 'join',\r\n\t\tjoinlottery: 'join',\r\n\t\tjoin(target, room, user, conn, cmd) {\r\n\t\t\troom = this.requireRoom('wifi' as RoomID);\r\n\t\t\tthis.checkChat();\r\n\t\t\tif (user.semilocked) return;\r\n\t\t\tconst giveaway = this.requireGame(LotteryGiveaway);\r\n\t\t\tif (cmd.includes('join')) {\r\n\t\t\t\tgiveaway.addUser(user);\r\n\t\t\t} else {\r\n\t\t\t\tgiveaway.removeUser(user);\r\n\t\t\t}\r\n\t\t},\r\n\t\tban(target, room, user) {\r\n\t\t\tif (!target) return false;\r\n\t\t\troom = this.requireRoom('wifi' as RoomID);\r\n\t\t\tthis.checkCan('warn', null, room);\r\n\r\n\t\t\tconst {targetUser, rest: reason} = this.requireUser(target, {allowOffline: true});\r\n\t\t\tif (reason.length > 300) {\r\n\t\t\t\treturn this.errorReply(\"The reason is too long. It cannot exceed 300 characters.\");\r\n\t\t\t}\r\n\t\t\tif (Punishments.hasRoomPunishType(room, targetUser.name, 'GIVEAWAYBAN')) {\r\n\t\t\t\treturn this.errorReply(`User '${targetUser.name}' is already giveawaybanned.`);\r\n\t\t\t}\r\n\r\n\t\t\tGiveaway.ban(room, targetUser, reason);\r\n\t\t\t(room.getGame(LotteryGiveaway) || room.getGame(QuestionGiveaway))?.kickUser(targetUser);\r\n\t\t\tthis.modlog('GIVEAWAYBAN', targetUser, reason);\r\n\t\t\tconst reasonMessage = reason ? ` (${reason})` : ``;\r\n\t\t\tthis.privateModAction(`${targetUser.name} was banned from entering giveaways by ${user.name}.${reasonMessage}`);\r\n\t\t},\r\n\t\tunban(target, room, user) {\r\n\t\t\tif (!target) return false;\r\n\t\t\troom = this.requireRoom('wifi' as RoomID);\r\n\t\t\tthis.checkCan('warn', null, room);\r\n\r\n\t\t\tconst {targetUser} = this.requireUser(target, {allowOffline: true});\r\n\t\t\tif (!Giveaway.checkBanned(room, targetUser)) {\r\n\t\t\t\treturn this.errorReply(`User '${targetUser.name}' isn't banned from entering giveaways.`);\r\n\t\t\t}\r\n\r\n\t\t\tGiveaway.unban(room, targetUser);\r\n\t\t\tthis.privateModAction(`${targetUser.name} was unbanned from entering giveaways by ${user.name}.`);\r\n\t\t\tthis.modlog('GIVEAWAYUNBAN', targetUser, null, {noip: 1, noalts: 1});\r\n\t\t},\r\n\t\tnew: 'create',\r\n\t\tstart: 'create',\r\n\t\tcreate: {\r\n\t\t\t''(target, room, user) {\r\n\t\t\t\troom = this.requireRoom('wifi' as RoomID);\r\n\t\t\t\tif (!user.can('show', null, room)) this.checkCan('warn', null, room);\r\n\t\t\t\tthis.parse('/j view-giveaways-create');\r\n\t\t\t},\r\n\t\t\tquestion(target, room, user) {\r\n\t\t\t\troom = this.room = Rooms.search('wifi') || null;\r\n\t\t\t\tif (!room) {\r\n\t\t\t\t\tthrow new Chat.ErrorMessage(`This command must be used in the Wi-Fi room.`);\r\n\t\t\t\t}\r\n\t\t\t\tif (room.game) {\r\n\t\t\t\t\tthrow new Chat.ErrorMessage(`There is already a room game (${room.game.constructor.name}) going on.`);\r\n\t\t\t\t}\r\n\t\t\t\t// Syntax: giver|ot|tid|game|question|answer1,answer2,etc|ivs/format/like/this|pokeball|packed set\r\n\t\t\t\tconst {\r\n\t\t\t\t\ttargetUser, ot, tid, game, question, answers, ivs, ball, extraInfo, prize,\r\n\t\t\t\t} = QuestionGiveaway.splitTarget(target, '|', this, user, 'create');\r\n\t\t\t\tconst set = Teams.import(prize)?.[0];\r\n\t\t\t\tif (!set) throw new Chat.ErrorMessage(`Please submit the prize in the form of a PS set importable.`);\r\n\r\n\t\t\t\troom.game = new QuestionGiveaway(user, targetUser, room, ot, tid, game, ivs, set, question, answers, ball, extraInfo);\r\n\r\n\t\t\t\tthis.privateModAction(`${user.name} started a question giveaway for ${targetUser.name}.`);\r\n\t\t\t\tthis.modlog('QUESTION GIVEAWAY', null, `for ${targetUser.getLastId()} (OT: ${ot} TID: ${tid} Nature: ${(room.game as LotteryGiveaway).prize.nature} Ball: ${ball}${extraInfo ? ` Other box info: ${extraInfo}` : ''})`);\r\n\t\t\t},\r\n\t\t\tlottery(target, room, user) {\r\n\t\t\t\troom = this.room = Rooms.search('wifi') || null;\r\n\t\t\t\tif (!room) {\r\n\t\t\t\t\tthrow new Chat.ErrorMessage(`This command must be used in the Wi-Fi room.`);\r\n\t\t\t\t}\r\n\t\t\t\tif (room.game) throw new Chat.ErrorMessage(`There is already a room game (${room.game.constructor.name}) going on.`);\r\n\t\t\t\t// Syntax: giver|ot|tid|game|# of winners|ivs/like/this|pokeball|info|packed set\r\n\t\t\t\tconst {\r\n\t\t\t\t\ttargetUser, ot, tid, game, winners, ivs, ball, prize, extraInfo,\r\n\t\t\t\t} = LotteryGiveaway.splitTarget(target, '|', this, user, 'create');\r\n\t\t\t\tconst set = Teams.import(prize)?.[0];\r\n\t\t\t\tif (!set) throw new Chat.ErrorMessage(`Please submit the prize in the form of a PS set importable.`);\r\n\r\n\t\t\t\troom.game = new LotteryGiveaway(user, targetUser, room, ot, tid, ivs, game, set, winners, ball, extraInfo);\r\n\r\n\t\t\t\tthis.privateModAction(`${user.name} started a lottery giveaway for ${targetUser.name}.`);\r\n\t\t\t\tthis.modlog('LOTTERY GIVEAWAY', null, `for ${targetUser.getLastId()} (OT: ${ot} TID: ${tid} Nature: ${(room.game as LotteryGiveaway).prize.nature} Ball: ${ball}${extraInfo ? ` Other box info: ${extraInfo}` : ''})`);\r\n\t\t\t},\r\n\t\t},\r\n\t\tstop: 'end',\r\n\t\tend(target, room, user) {\r\n\t\t\troom = this.requireRoom('wifi' as RoomID);\r\n\t\t\tif (!room.game?.constructor.name.includes('Giveaway')) {\r\n\t\t\t\tthrow new Chat.ErrorMessage(`There is no giveaway going on at the moment.`);\r\n\t\t\t}\r\n\t\t\tconst game = room.game as LotteryGiveaway | QuestionGiveaway;\r\n\t\t\tif (user.id !== game.host.id) this.checkCan('warn', null, room);\r\n\r\n\t\t\tif (target && target.length > 300) {\r\n\t\t\t\treturn this.errorReply(\"The reason is too long. It cannot exceed 300 characters.\");\r\n\t\t\t}\r\n\t\t\tgame.end(true);\r\n\t\t\tthis.modlog('GIVEAWAY END', null, target);\r\n\t\t\tif (target) target = `: ${target}`;\r\n\t\t\tthis.privateModAction(`The giveaway was forcibly ended by ${user.name}${target}`);\r\n\t\t},\r\n\t\tguess(target, room, user) {\r\n\t\t\tthis.parse(`/guess ${target}`);\r\n\t\t},\r\n\t\tchangeanswer: 'changequestion',\r\n\t\tchangequestion(target, room, user, connection, cmd) {\r\n\t\t\troom = this.requireRoom('wifi' as RoomID);\r\n\t\t\tconst giveaway = this.requireGame(QuestionGiveaway);\r\n\t\t\ttarget = target.trim();\r\n\t\t\tif (!target) throw new Chat.ErrorMessage(\"You must include a question or an answer.\");\r\n\t\t\tgiveaway.change(target, user, cmd.includes('answer'));\r\n\t\t},\r\n\t\tshowanswer: 'viewanswer',\r\n\t\tviewanswer(target, room, user) {\r\n\t\t\troom = this.requireRoom('wifi' as RoomID);\r\n\t\t\tconst giveaway = this.requireGame(QuestionGiveaway);\r\n\t\t\tif (user.id !== giveaway.host.id && user.id !== giveaway.giver.id) return;\r\n\r\n\t\t\tthis.sendReply(`The giveaway question is ${giveaway.question}.\\nThe answer${Chat.plural(giveaway.answers, 's are', ' is')} ${giveaway.answers.join(', ')}.`);\r\n\t\t},\r\n\t\tsave: 'store',\r\n\t\tstore: {\r\n\t\t\t''(target, room, user) {\r\n\t\t\t\troom = this.requireRoom('wifi' as RoomID);\r\n\t\t\t\tthis.checkCan('warn', null, room);\r\n\t\t\t\tthis.parse('/j view-giveaways-stored-add');\r\n\t\t\t},\r\n\t\t\tquestion(target, room, user) {\r\n\t\t\t\troom = this.room = Rooms.search('wifi') || null;\r\n\t\t\t\tif (!room) {\r\n\t\t\t\t\tthrow new Chat.ErrorMessage(`This command must be used in the Wi-Fi room.`);\r\n\t\t\t\t}\r\n\t\t\t\tconst {\r\n\t\t\t\t\ttargetUser, ot, tid, game, prize, question, answers, ball, extraInfo, ivs,\r\n\t\t\t\t} = QuestionGiveaway.splitTarget(target, '|', this, user, 'store');\r\n\t\t\t\tconst set = Teams.import(prize)?.[0];\r\n\t\t\t\tif (!set) throw new Chat.ErrorMessage(`Please submit the prize in the form of a PS set importable.`);\r\n\r\n\t\t\t\tif (!wifiData.storedGiveaways.question) wifiData.storedGiveaways.question = [];\r\n\t\t\t\tconst data = {targetUserID: targetUser.id, ot, tid, game, prize: set, question, answers, ivs, ball, extraInfo};\r\n\t\t\t\twifiData.storedGiveaways.question.push(data);\r\n\t\t\t\tsaveData();\r\n\r\n\t\t\t\tthis.privateModAction(`${user.name} saved a question giveaway for ${targetUser.name}.`);\r\n\t\t\t\tthis.modlog('QUESTION GIVEAWAY SAVE');\r\n\t\t\t},\r\n\t\t\tlottery(target, room, user) {\r\n\t\t\t\troom = this.room = Rooms.search('wifi') || null;\r\n\t\t\t\tif (!room) {\r\n\t\t\t\t\tthrow new Chat.ErrorMessage(`This command must be used in the Wi-Fi room.`);\r\n\t\t\t\t}\r\n\t\t\t\tconst {\r\n\t\t\t\t\ttargetUser, ot, tid, game, prize, winners, ball, extraInfo, ivs,\r\n\t\t\t\t} = LotteryGiveaway.splitTarget(target, '|', this, user, 'store');\r\n\t\t\t\tconst set = Teams.import(prize)?.[0];\r\n\t\t\t\tif (!set) throw new Chat.ErrorMessage(`Please submit the prize in the form of a PS set importable.`);\r\n\r\n\t\t\t\tif (!wifiData.storedGiveaways.lottery) wifiData.storedGiveaways.lottery = [];\r\n\t\t\t\tconst data = {targetUserID: targetUser.id, ot, tid, game, prize: set, winners, ball, extraInfo, ivs};\r\n\t\t\t\twifiData.storedGiveaways.lottery.push(data);\r\n\t\t\t\tsaveData();\r\n\r\n\t\t\t\tthis.privateModAction(`${user.name} saved a lottery giveaway for ${targetUser.name}.`);\r\n\t\t\t\tthis.modlog('LOTTERY GIVEAWAY SAVE');\r\n\t\t\t},\r\n\t\t},\r\n\t\tsubmit: {\r\n\t\t\t''(target, room, user) {\r\n\t\t\t\troom = this.requireRoom('wifi' as RoomID);\r\n\t\t\t\tthis.checkChat();\r\n\t\t\t\tthis.parse('/j view-giveaways-submitted-add');\r\n\t\t\t},\r\n\t\t\tquestion(target, room, user) {\r\n\t\t\t\troom = this.room = Rooms.search('wifi') || null;\r\n\t\t\t\tif (!room) {\r\n\t\t\t\t\tthrow new Chat.ErrorMessage(`This command must be used in the Wi-Fi room.`);\r\n\t\t\t\t}\r\n\t\t\t\tconst {\r\n\t\t\t\t\ttargetUser, ot, tid, game, prize, question, answers, ball, extraInfo, ivs,\r\n\t\t\t\t} = QuestionGiveaway.splitTarget(target, '|', this, user, 'submit');\r\n\t\t\t\tconst set = Teams.import(prize)?.[0];\r\n\t\t\t\tif (!set) throw new Chat.ErrorMessage(`Please submit the prize in the form of a PS set importable.`);\r\n\r\n\t\t\t\tif (!wifiData.submittedGiveaways.question) wifiData.submittedGiveaways.question = [];\r\n\t\t\t\tconst data = {targetUserID: targetUser.id, ot, tid, game, prize: set, question, answers, ball, extraInfo, ivs};\r\n\t\t\t\twifiData.submittedGiveaways.question.push(data);\r\n\t\t\t\tsaveData();\r\n\r\n\t\t\t\tthis.sendReply(`You have submitted a question giveaway for ${set.species}. If you log out or go offline, the giveaway won't go through.`);\r\n\t\t\t\tconst message = `|tempnotify|pendingapprovals|Pending question giveaway request!` +\r\n\t\t\t\t\t`|${user.name} has requested to start a question giveaway for ${set.species}.|new question giveaway request`;\r\n\t\t\t\troom.sendRankedUsers(message, '%');\r\n\t\t\t\troom.sendMods(\r\n\t\t\t\t\tChat.html`|uhtml|giveaway-request-${user.id}|${
\r\n\t\t\t\t\t\t{user.name} wants to start a question giveaway for {set.species}
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
}`\r\n\t\t\t\t);\r\n\t\t\t},\r\n\t\t\tlottery(target, room, user) {\r\n\t\t\t\troom = this.room = Rooms.search('wifi') || null;\r\n\t\t\t\tif (!room) {\r\n\t\t\t\t\tthrow new Chat.ErrorMessage(`This command must be used in the Wi-Fi room.`);\r\n\t\t\t\t}\r\n\t\t\t\tconst {\r\n\t\t\t\t\ttargetUser, ot, tid, game, prize, winners, ball, extraInfo, ivs,\r\n\t\t\t\t} = LotteryGiveaway.splitTarget(target, '|', this, user, 'submit');\r\n\t\t\t\tconst set = Teams.import(prize)?.[0];\r\n\t\t\t\tif (!set) throw new Chat.ErrorMessage(`Please submit the prize in the form of a PS set importable.`);\r\n\r\n\t\t\t\tif (!wifiData.submittedGiveaways.lottery) wifiData.submittedGiveaways.lottery = [];\r\n\t\t\t\tconst data = {targetUserID: targetUser.id, ot, tid, game, prize: set, winners, ball, extraInfo, ivs};\r\n\t\t\t\twifiData.submittedGiveaways.lottery.push(data);\r\n\t\t\t\tsaveData();\r\n\r\n\t\t\t\tthis.sendReply(`You have submitted a lottery giveaway for ${set.species}. If you log out or go offline, the giveaway won't go through.`);\r\n\t\t\t\tconst message = `|tempnotify|pendingapprovals|Pending lottery giveaway request!` +\r\n\t\t\t\t\t`|${user.name} has requested to start a lottery giveaway for ${set.species}.|new lottery giveaway request`;\r\n\t\t\t\troom.sendRankedUsers(message, '%');\r\n\t\t\t\troom.sendMods(Chat.html`|uhtml|giveaway-request-${user.id}|${
\r\n\t\t\t\t\t{user.name} wants to start a lottery giveaway for {set.species}
\r\n\t\t\t\t\t\r\n\t\t\t\t
}`);\r\n\t\t\t},\r\n\t\t},\r\n\t\tapprove(target, room, user) {\r\n\t\t\troom = this.room = Rooms.search('wifi') || null;\r\n\t\t\tif (!room) {\r\n\t\t\t\tthrow new Chat.ErrorMessage(`This command must be used in the Wi-Fi room.`);\r\n\t\t\t}\r\n\t\t\tconst targetUser = Users.get(target);\r\n\t\t\tif (!targetUser?.connected) {\r\n\t\t\t\tthis.refreshPage('giveaways-submitted');\r\n\t\t\t\tthrow new Chat.ErrorMessage(`${targetUser?.name || toID(target)} is offline, so their giveaway can't be run.`);\r\n\t\t\t}\r\n\t\t\tconst hasGiveaway = hasSubmittedGiveaway(targetUser);\r\n\t\t\tif (!hasGiveaway) {\r\n\t\t\t\tthis.refreshPage('giveaways-submitted');\r\n\t\t\t\tthrow new Chat.ErrorMessage(`${targetUser?.name || toID(target)} doesn't have any submitted giveaways.`);\r\n\t\t\t}\r\n\t\t\tconst giveaway = wifiData.submittedGiveaways[hasGiveaway.type][hasGiveaway.index];\r\n\t\t\tif (hasGiveaway.type === 'question') {\r\n\t\t\t\tconst data = giveaway as QuestionGiveawayData;\r\n\t\t\t\tthis.parse(`/giveaway create question ${data.targetUserID}|${data.ot}|${data.tid}|${data.game}|${data.question}|${data.answers.join(',')}|${data.ivs.join('/')}|${data.ball}|${data.extraInfo}|${Teams.pack([data.prize])!}`);\r\n\t\t\t} else {\r\n\t\t\t\tconst data = giveaway as LotteryGiveawayData;\r\n\t\t\t\tthis.parse(`/giveaway create lottery ${data.targetUserID}|${data.ot}|${data.tid}|${data.game}|${data.winners}|${data.ivs.join('/')}|${data.ball}|${data.extraInfo}|${Teams.pack([data.prize])!}`);\r\n\t\t\t}\r\n\t\t\twifiData.submittedGiveaways[hasGiveaway.type].splice(hasGiveaway.index, 1);\r\n\t\t\tsaveData();\r\n\t\t\tthis.refreshPage(`giveaways-submitted`);\r\n\t\t\ttargetUser.send(`${user.name} has approved your ${hasGiveaway.type} giveaway!`);\r\n\t\t\tthis.privateModAction(`${user.name} approved a ${hasGiveaway.type} giveaway by ${targetUser.name}.`);\r\n\t\t\tthis.modlog(`GIVEAWAY APPROVE ${hasGiveaway.type.toUpperCase()}`, targetUser, null, {noalts: true, noip: true});\r\n\t\t},\r\n\t\tdeny: 'delete',\r\n\t\tdelete(target, room, user, connection, cmd) {\r\n\t\t\troom = this.room = Rooms.search('wifi') || null;\r\n\t\t\tif (!room) {\r\n\t\t\t\tthrow new Chat.ErrorMessage(`This command must be used in the Wi-Fi room.`);\r\n\t\t\t}\r\n\t\t\tif (!target) return this.parse('/help giveaway');\r\n\t\t\tconst del = cmd === 'delete';\r\n\t\t\tif (del) {\r\n\t\t\t\tconst [type, indexStr] = target.split(',');\r\n\t\t\t\tconst index = parseInt(indexStr) - 1;\r\n\t\t\t\tif (!type || !indexStr || index <= -1 || !['question', 'lottery'].includes(toID(type)) || isNaN(index)) {\r\n\t\t\t\t\treturn this.parse(`/help giveaway`);\r\n\t\t\t\t}\r\n\t\t\t\tconst typedType = toID(type) as 'question' | 'lottery';\r\n\t\t\t\tconst giveaway = wifiData.storedGiveaways[typedType][index];\r\n\t\t\t\tif (!giveaway) {\r\n\t\t\t\t\tthrow new Chat.ErrorMessage(\r\n\t\t\t\t\t\t`There is no giveaway at index ${index}. Indices must be integers between 0 and ${wifiData.storedGiveaways[typedType].length - 1}.`\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\twifiData.storedGiveaways[typedType].splice(index, 1);\r\n\t\t\t\tsaveData();\r\n\t\t\t\tthis.privateModAction(`${user.name} deleted a ${typedType} giveaway by ${giveaway.targetUserID}.`);\r\n\t\t\t\tthis.modlog(`GIVEAWAY DELETE ${typedType.toUpperCase()}`);\r\n\t\t\t} else {\r\n\t\t\t\tconst {targetUser, rest: reason} = this.splitUser(target);\r\n\t\t\t\tif (!targetUser?.connected) {\r\n\t\t\t\t\tthrow new Chat.ErrorMessage(`${targetUser?.name || toID(target)} is offline, so their giveaway can't be run.`);\r\n\t\t\t\t}\r\n\t\t\t\tconst hasGiveaway = hasSubmittedGiveaway(targetUser);\r\n\t\t\t\tif (!hasGiveaway) {\r\n\t\t\t\t\tthis.refreshPage('giveaways-submitted');\r\n\t\t\t\t\tthrow new Chat.ErrorMessage(`${targetUser?.name || toID(target)} doesn't have any submitted giveaways.`);\r\n\t\t\t\t}\r\n\t\t\t\twifiData.submittedGiveaways[hasGiveaway.type].splice(hasGiveaway.index, 1);\r\n\t\t\t\tsaveData();\r\n\t\t\t\ttargetUser?.send(`Staff have rejected your giveaway${reason ? `: ${reason}` : '.'}`);\r\n\t\t\t\tthis.privateModAction(`${user.name} denied a ${hasGiveaway.type} giveaway by ${targetUser.name}.`);\r\n\t\t\t\tthis.modlog(`GIVEAWAY DENY ${hasGiveaway.type.toUpperCase()}`, targetUser, reason || null, {noalts: true, noip: true});\r\n\t\t\t}\r\n\t\t\tthis.refreshPage(del ? `giveaways-stored` : 'giveaways-submitted');\r\n\t\t},\r\n\t\tunwhitelist: 'whitelist',\r\n\t\twhitelist(target, room, user, connection, cmd) {\r\n\t\t\troom = this.requireRoom('wifi' as RoomID);\r\n\t\t\tthis.checkCan('warn', null, room);\r\n\t\t\tconst targetId = toID(target);\r\n\t\t\tif (!targetId) return this.parse(`/help giveaway whitelist`);\r\n\t\t\tif (cmd.includes('un')) {\r\n\t\t\t\tconst idx = wifiData.whitelist.indexOf(targetId);\r\n\t\t\t\tif (idx < 0) {\r\n\t\t\t\t\treturn this.errorReply(`'${targetId}' is not whitelisted.`);\r\n\t\t\t\t}\r\n\t\t\t\twifiData.whitelist.splice(idx, 1);\r\n\t\t\t\tthis.privateModAction(`${user.name} removed '${targetId}' from the giveaway whitelist.`);\r\n\t\t\t\tthis.modlog(`GIVEAWAY UNWHITELIST`, targetId);\r\n\t\t\t\tsaveData();\r\n\t\t\t} else {\r\n\t\t\t\tif (wifiData.whitelist.includes(targetId)) {\r\n\t\t\t\t\treturn this.errorReply(`'${targetId}' is already whitelisted.`);\r\n\t\t\t\t}\r\n\t\t\t\twifiData.whitelist.push(targetId);\r\n\t\t\t\tthis.privateModAction(`${user.name} added ${targetId} to the giveaway whitelist.`);\r\n\t\t\t\tthis.modlog(`GIVEAWAY WHITELIST`, targetId);\r\n\t\t\t\tsaveData();\r\n\t\t\t}\r\n\t\t},\r\n\t\twhitelisthelp: [\r\n\t\t\t`/giveaway whitelist [user] - Allow the given [user] to make giveaways without staff help. Requires: % @ # &`,\r\n\t\t\t`/giveaway unwhitelist [user] - Remove the given user from the giveaway whitelist. Requires: % @ # &`,\r\n\t\t],\r\n\t\twhitelisted(target, room, user) {\r\n\t\t\troom = this.requireRoom('wifi' as RoomID);\r\n\t\t\tthis.checkCan('warn', null, room);\r\n\t\t\tconst buf = [Currently whitelisted users,
];\r\n\t\t\tif (!wifiData.whitelist.length) {\r\n\t\t\t\tbuf.push(
None.
);\r\n\t\t\t} else {\r\n\t\t\t\tbuf.push(wifiData.whitelist.map(n => {n}));\r\n\t\t\t}\r\n\t\t\tthis.sendReplyBox(<>{buf});\r\n\t\t},\r\n\t\tclaim(target, room, user) {\r\n\t\t\troom = this.requireRoom('wifi' as RoomID);\r\n\t\t\tthis.checkCan('mute', null, room);\r\n\t\t\tconst {targetUser} = this.requireUser(target);\r\n\t\t\tconst hasGiveaway = hasSubmittedGiveaway(targetUser);\r\n\t\t\tif (!hasGiveaway) {\r\n\t\t\t\tthis.refreshPage('giveaways-submitted');\r\n\t\t\t\tthrow new Chat.ErrorMessage(`${targetUser?.name || toID(target)} doesn't have any submitted giveaways.`);\r\n\t\t\t}\r\n\t\t\t// we ensure it exists above\r\n\t\t\tconst giveaway = wifiData.submittedGiveaways[hasGiveaway.type][hasGiveaway.index];\r\n\t\t\tif (giveaway.claimed) throw new Chat.ErrorMessage(`That giveaway is already claimed by ${giveaway.claimed}.`);\r\n\t\t\tgiveaway.claimed = user.id;\r\n\t\t\tChat.refreshPageFor('giveaways-submitted', room);\r\n\t\t\tthis.privateModAction(`${user.name} claimed ${targetUser.name}'s giveaway`);\r\n\t\t\tsaveData();\r\n\t\t},\r\n\t\tunclaim(target, room, user) {\r\n\t\t\troom = this.requireRoom('wifi' as RoomID);\r\n\t\t\tthis.checkCan('mute', null, room);\r\n\t\t\tconst {targetUser} = this.requireUser(target);\r\n\t\t\tconst hasGiveaway = hasSubmittedGiveaway(targetUser);\r\n\t\t\tif (!hasGiveaway) {\r\n\t\t\t\tthis.refreshPage('giveaways-submitted');\r\n\t\t\t\tthrow new Chat.ErrorMessage(`${targetUser?.name || toID(target)} doesn't have any submitted giveaways.`);\r\n\t\t\t}\r\n\t\t\t// we ensure it exists above\r\n\t\t\tconst giveaway = wifiData.submittedGiveaways[hasGiveaway.type][hasGiveaway.index];\r\n\t\t\tif (!giveaway.claimed) throw new Chat.ErrorMessage(`That giveaway is not claimed.`);\r\n\t\t\tdelete giveaway.claimed;\r\n\t\t\tChat.refreshPageFor('giveaways-submitted', room);\r\n\t\t\tsaveData();\r\n\t\t},\r\n\t\tcount(target, room, user) {\r\n\t\t\troom = this.requireRoom('wifi' as RoomID);\r\n\t\t\tif (!Dex.species.get(target).exists) {\r\n\t\t\t\tthrow new Chat.ErrorMessage(`No Pok\\u00e9mon entered. Proper syntax: /giveaway count pokemon`);\r\n\t\t\t}\r\n\t\t\ttarget = Dex.species.get(target).id;\r\n\t\t\tthis.runBroadcast();\r\n\r\n\t\t\tconst count = wifiData.stats[target];\r\n\r\n\t\t\tif (!count) return this.sendReplyBox(\"This Pok\u00E9mon has never been given away.\");\r\n\t\t\tconst recent = count.filter(val => val + RECENT_THRESHOLD > Date.now()).length;\r\n\r\n\t\t\tthis.sendReplyBox(`This Pok\u00E9mon has been given away ${Chat.count(count, \"times\")}, a total of ${Chat.count(recent, \"times\")} in the past month.`);\r\n\t\t},\r\n\t},\r\n\tgiveawayhelp(target, room, user) {\r\n\t\troom = this.requireRoom('wifi' as RoomID);\r\n\t\tthis.runBroadcast();\r\n\t\tconst buf = [];\r\n\t\tif (user.can('show', null, room)) {\r\n\t\t\tbuf.push(
Staff commands\r\n\t\t\t\t/giveaway create - Pulls up a page to create a giveaway. Requires: + % @ # &
\r\n\t\t\t\t\r\n\t\t\t\t\t/giveaway create question Giver | OT | TID | Game | Question | Answer 1, Answer 2, Answer 3 | IV/IV/IV/IV/IV/IV | Poké Ball | Extra Info | Prize\r\n\t\t\t\t - Start a new question giveaway (voices can only host their own). Requires: + % @ # &
\r\n\t\t\t\t\r\n\t\t\t\t\t/giveaway create lottery Giver | OT | TID | Game | # of Winners | IV/IV/IV/IV/IV/IV | Poké Ball | Extra Info | Prize\r\n\t\t\t\t - Start a new lottery giveaway (voices can only host their own). Requires: + % @ # &
\r\n\t\t\t\t\r\n\t\t\t\t\t/giveaway changequestion/changeanswer\r\n\t\t\t\t - Changes the question/answer of a question giveaway. Requires: Being giveaway host
\r\n\t\t\t\t/giveaway viewanswer - Shows the answer of a question giveaway. Requires: Being giveaway host/giver
\r\n\t\t\t\t\r\n\t\t\t\t\t/giveaway ban [user], [reason]\r\n\t\t\t\t - Temporarily bans [user] from entering giveaways. Requires: % @ # &
\r\n\t\t\t\t/giveaway end - Forcibly ends the current giveaway. Requires: % @ # &
\r\n\t\t\t\t/giveaway count [pokemon] - Shows how frequently a certain Pokémon has been given away.
\r\n\t\t\t\t/giveaway whitelist [user] - Allow the given [user] to make giveaways. Requires: % @ # &
\r\n\t\t\t\t/giveaway unwhitelist [user] - Remove the given user from the giveaway whitelist. Requires: % @ # &\r\n\t\t\t
);\r\n\t\t}\r\n\t\t// Giveaway stuff\r\n\t\tbuf.push(
Giveaway participation commands\r\n\t\t\t/guess [target] - Guesses an answer for a question giveaway.
\r\n\t\t\t\r\n\t\t\t\t/giveaway submit\r\n\t\t\t - Allows users to submit giveaways. They must remain online after submitting for it to go through.
\r\n\t\t\t/giveaway viewanswer - Guesses an answer for a question giveaway. Requires: Giveaway host/giver
\r\n\t\t\t/giveaway remind - Shows the details of the current giveaway.
\r\n\t\t\t/giveaway join/leave - Joins/leaves a lottery giveaway.\r\n\t\t
);\r\n\t\tthis.sendReplyBox(<>{buf});\r\n\t},\r\n};\r\n\r\nfunction makePageHeader(user: User, pageid?: string) {\r\n\tconst titles: {[k: string]: string} = {\r\n\t\tcreate: `Create`,\r\n\t\tstored: `View Stored`,\r\n\t\t'stored-add': 'Store',\r\n\t\tsubmitted: `View Submitted`,\r\n\t\t'submitted-add': `Submit`,\r\n\t};\r\n\tconst icons: Record = {\r\n\t\tcreate: ,\r\n\t\tstored: ,\r\n\t\t'stored-add': ,\r\n\t\tsubmitted: ,\r\n\t\t'submitted-add': ,\r\n\t};\r\n\tconst buf = [];\r\n\tbuf.push();\r\n\tbuf.push(

Wi-Fi Giveaways

);\r\n\tconst urls = [];\r\n\tconst room = Rooms.get('wifi')!; // we validate before using that wifi exists\r\n\tfor (const i in titles) {\r\n\t\tif (urls.length) urls.push(' / ');\r\n\t\tif (!user.can('mute', null, room) && i !== 'submitted-add') {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tconst title = titles[i];\r\n\t\tconst icon = icons[i];\r\n\t\tif (pageid === i) {\r\n\t\t\turls.push(<>{icon} {title});\r\n\t\t} else {\r\n\t\t\turls.push(<>{icon} {title});\r\n\t\t}\r\n\t}\r\n\tbuf.push(<>{[urls]},
);\r\n\treturn
{buf}
;\r\n}\r\n\r\nfunction formatFakeButton(url: string, text: Chat.VNode): Chat.VNode {\r\n\treturn {text};\r\n}\r\n\r\nfunction generatePokeballDropdown() {\r\n\tconst pokeballs = Dex.items.all().filter(item => item.isPokeball).sort((a, b) => a.num - b.num);\r\n\tconst pokeballsObj = [];\r\n\tfor (const pokeball of pokeballs) {\r\n\t\tpokeballsObj.push();\r\n\t}\r\n\treturn <>;\r\n}\r\n\r\nexport const pages: Chat.PageTable = {\r\n\tgiveaways: {\r\n\t\t''() {\r\n\t\t\tthis.title = `[Giveaways]`;\r\n\t\t\tif (!Rooms.search('wifi')) return

There is no Wi-Fi room on this server.

;\r\n\t\t\tthis.checkCan('warn', null, Rooms.search('wifi')!);\r\n\t\t\treturn
{makePageHeader(this.user)}
;\r\n\t\t},\r\n\t\tcreate(args, user) {\r\n\t\t\tthis.title = `[Create Giveaways]`;\r\n\t\t\tconst wifi = Rooms.search('wifi');\r\n\t\t\tif (!wifi) return

There is no Wi-Fi room on this server.

;\r\n\t\t\tif (!(user.can('show', null, wifi) || wifiData.whitelist.includes(user.id))) {\r\n\t\t\t\tthis.checkCan('warn', null, wifi);\r\n\t\t\t}\r\n\t\t\tconst [type] = args;\r\n\t\t\treturn
{makePageHeader(this.user, 'create')}{(() => {\r\n\t\t\t\tif (!type || !['lottery', 'question'].includes(type)) {\r\n\t\t\t\t\treturn
\r\n\t\t\t\t\t\t

Pick a Giveaway type

\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tformatFakeButton(`/view-giveaways-create-lottery`, <> Lottery)\r\n\t\t\t\t\t\t} | {\r\n\t\t\t\t\t\t\tformatFakeButton(`/view-giveaways-create-question`, <> Question)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t
;\r\n\t\t\t\t}\r\n\t\t\t\tswitch (type) {\r\n\t\t\t\tcase 'lottery':\r\n\t\t\t\t\treturn <>\r\n\t\t\t\t\t\t

Make a Lottery Giveaway

\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\tGame:
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t{generatePokeballDropdown()}

\r\n\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t;\r\n\t\t\t\tcase 'question':\r\n\t\t\t\t\treturn <>\r\n\t\t\t\t\t\t

Make a Question Giveaway

\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\tGame:
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t{generatePokeballDropdown()}

\r\n\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t;\r\n\t\t\t\t}\r\n\t\t\t})()}
;\r\n\t\t},\r\n\t\tstored(args, user) {\r\n\t\t\tthis.title = `[Stored Giveaways]`;\r\n\t\t\tif (!Rooms.search('wifi')) return

There is no Wi-Fi room on this server.

;\r\n\t\t\tthis.checkCan('warn', null, Rooms.search('wifi')!);\r\n\t\t\tconst [add, type] = args;\r\n\t\t\tconst giveaways = [\r\n\t\t\t\t...((wifiData.storedGiveaways || {}).lottery || []),\r\n\t\t\t\t...((wifiData.storedGiveaways || {}).question || []),\r\n\t\t\t];\r\n\t\t\tconst adding = add === 'add';\r\n\t\t\tif (!giveaways.length && !adding) {\r\n\t\t\t\treturn
\r\n\t\t\t\t\t{makePageHeader(this.user, adding ? 'stored-add' : 'stored')}\r\n\t\t\t\t\t

There are no giveaways stored

\r\n\t\t\t\t
;\r\n\t\t\t}\r\n\t\t\treturn
\r\n\t\t\t\t{makePageHeader(this.user, adding ? 'stored-add' : 'stored')}\r\n\t\t\t\t{(() => {\r\n\t\t\t\t\tif (!adding) {\r\n\t\t\t\t\t\tconst buf = [];\r\n\t\t\t\t\t\tfor (let giveaway of giveaways) {\r\n\t\t\t\t\t\t\tif (wifiData.storedGiveaways.lottery.includes(giveaway as LotteryGiveawayData)) {\r\n\t\t\t\t\t\t\t\tgiveaway = giveaway as LotteryGiveawayData;\r\n\t\t\t\t\t\t\t\tconst targetUser = Users.get(giveaway.targetUserID);\r\n\t\t\t\t\t\t\t\tbuf.push(
\r\n\t\t\t\t\t\t\t\t\t

Lottery

\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\tGame: {gameName[giveaway.game]}
\r\n\t\t\t\t\t\t\t\t\tGiver: {giveaway.targetUserID}, {}\r\n\t\t\t\t\t\t\t\t\tOT: {giveaway.ot}, TID: {giveaway.tid}
\r\n\t\t\t\t\t\t\t\t\t# of winners: {giveaway.winners}
\r\n\t\t\t\t\t\t\t\t\tPoké Ball: \r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t Prize\r\n\t\t\t\t\t\t\t\t\t\t{Giveaway.convertIVs(giveaway.prize, giveaway.ivs)}\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t{!!giveaway.extraInfo?.trim() && <>\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\tExtra Info\r\n\t\t\t\t\t\t\t\t\t\t\t{giveaway.extraInfo.trim()}\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{!targetUser?.connected ?\r\n\t\t\t\t\t\t\t\t\t\t :\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t
);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tgiveaway = giveaway as QuestionGiveawayData;\r\n\t\t\t\t\t\t\t\tconst targetUser = Users.get(giveaway.targetUserID);\r\n\t\t\t\t\t\t\t\tbuf.push(
\r\n\t\t\t\t\t\t\t\t\t

Lottery

\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\tGame: {gameName[giveaway.game]}
\r\n\t\t\t\t\t\t\t\t\tGiver: {giveaway.targetUserID}, {}\r\n\t\t\t\t\t\t\t\t\tOT: {giveaway.ot}, TID: {giveaway.tid}
\r\n\t\t\t\t\t\t\t\t\tQuestion: {giveaway.question}
\r\n\t\t\t\t\t\t\t\t\tAnswer{Chat.plural(giveaway.answers.length, \"s\")}: {giveaway.answers.join(', ')}
\r\n\t\t\t\t\t\t\t\t\tPoké Ball: \r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t Prize\r\n\t\t\t\t\t\t\t\t\t\t{Giveaway.convertIVs(giveaway.prize, giveaway.ivs)}\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t{!!giveaway.extraInfo?.trim() && <>\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\tExtra Info\r\n\t\t\t\t\t\t\t\t\t\t\t{giveaway.extraInfo.trim()}\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{!targetUser?.connected ?\r\n\t\t\t\t\t\t\t\t\t\t :\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t
);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn <>

Stored Giveaways

{buf};\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn <>

Store a Giveaway

\r\n\t\t\t\t\t\t\t{(() => {\r\n\t\t\t\t\t\t\t\tif (!type || !['question', 'lottery'].includes(type)) {\r\n\t\t\t\t\t\t\t\t\treturn
\r\n\t\t\t\t\t\t\t\t\t\t

Pick a giveaway type

\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tformatFakeButton(`/view-giveaways-stored-add-lottery`, <> Lottery)\r\n\t\t\t\t\t\t\t\t\t\t} | {\r\n\t\t\t\t\t\t\t\t\t\t\tformatFakeButton(`/view-giveaways-stored-add-question`, <> Question)\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t
;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tswitch (type) {\r\n\t\t\t\t\t\t\t\tcase 'lottery':\r\n\t\t\t\t\t\t\t\t\treturn
\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\tGame:
\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t{generatePokeballDropdown()}

\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t
;\r\n\t\t\t\t\t\t\t\tcase 'question':\r\n\t\t\t\t\t\t\t\t\treturn
\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\tGame:
\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t{generatePokeballDropdown()}

\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t
;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t})()}\r\n\t\t\t\t\t\t;\r\n\t\t\t\t\t}\r\n\t\t\t\t})()}\r\n\t\t\t
;\r\n\t\t},\r\n\t\tsubmitted(args, user) {\r\n\t\t\tthis.title = `[Submitted Giveaways]`;\r\n\t\t\tif (!Rooms.search('wifi')) return

There is no Wi-Fi room on this server.

;\r\n\t\t\tconst [add, type] = args;\r\n\t\t\tconst adding = add === 'add';\r\n\t\t\tif (!adding) this.checkCan('warn', null, Rooms.get('wifi')!);\r\n\t\t\tconst giveaways = [\r\n\t\t\t\t...((wifiData.submittedGiveaways || {}).lottery || []),\r\n\t\t\t\t...((wifiData.submittedGiveaways || {}).question || []),\r\n\t\t\t];\r\n\t\t\tif (!giveaways.length && !adding) {\r\n\t\t\t\treturn
\r\n\t\t\t\t\t{makePageHeader(this.user, args[0] === 'add' ? 'submitted-add' : 'submitted')}\r\n\t\t\t\t\t

There are no submitted giveaways.

\r\n\t\t\t\t
;\r\n\t\t\t}\r\n\t\t\treturn
\r\n\t\t\t\t{makePageHeader(this.user, args[0] === 'add' ? 'submitted-add' : 'submitted')}\r\n\t\t\t\t{(() => {\r\n\t\t\t\t\tif (!adding) {\r\n\t\t\t\t\t\tconst buf = [];\r\n\t\t\t\t\t\tfor (let giveaway of giveaways) {\r\n\t\t\t\t\t\t\tconst claimCmd = giveaway.claimed === user.id ?\r\n\t\t\t\t\t\t\t\t`/giveaway unclaim ${giveaway.targetUserID}` :\r\n\t\t\t\t\t\t\t\t`/giveaway claim ${giveaway.targetUserID}`;\r\n\t\t\t\t\t\t\tconst claimedTitle = giveaway.claimed === user.id ?\r\n\t\t\t\t\t\t\t\t\"Unclaim\" : giveaway.claimed ?\r\n\t\t\t\t\t\t\t\t\t`Claimed by ${giveaway.claimed}` : `Claim`;\r\n\t\t\t\t\t\t\tconst disabled = giveaway.claimed && giveaway.claimed !== user.id ? \" disabled\" : \"\";\r\n\t\t\t\t\t\t\tbuf.push(
\r\n\t\t\t\t\t\t\t\t{(() => {\r\n\t\t\t\t\t\t\t\t\tif (wifiData.submittedGiveaways.lottery.includes(giveaway as LotteryGiveawayData)) {\r\n\t\t\t\t\t\t\t\t\t\tgiveaway = giveaway as LotteryGiveawayData;\r\n\t\t\t\t\t\t\t\t\t\treturn <>\r\n\t\t\t\t\t\t\t\t\t\t\t

Lottery

\r\n\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\tGame: {gameName[giveaway.game]}, Giver: {giveaway.targetUserID}, {}\r\n\t\t\t\t\t\t\t\t\t\t\tOT: {giveaway.ot}, TID: {giveaway.tid}, {}\r\n\t\t\t\t\t\t\t\t\t\t\t# of winners: {giveaway.winners}\r\n\t\t\t\t\t\t\t\t\t\t\t{!!giveaway.claimed && <>
Claimed: {giveaway.claimed}}
\r\n\t\t\t\t\t\t\t\t\t\t\tPoké Ball: \r\n\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t Prize\r\n\t\t\t\t\t\t\t\t\t\t\t\t{Giveaway.convertIVs(giveaway.prize, giveaway.ivs)}\r\n\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t{!!giveaway.extraInfo?.trim() && <>\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tExtra Info\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{giveaway.extraInfo.trim()}\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t;\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\tgiveaway = giveaway as QuestionGiveawayData;\r\n\t\t\t\t\t\t\t\t\t\treturn <>\r\n\t\t\t\t\t\t\t\t\t\t\t

Question

\r\n\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\tGame: {gameName[giveaway.game]}, Giver: {giveaway.targetUserID}, {}\r\n\t\t\t\t\t\t\t\t\t\t\tOT: {giveaway.ot}, TID: {giveaway.tid}\r\n\t\t\t\t\t\t\t\t\t\t\t{!!giveaway.claimed && <>
Claimed: {giveaway.claimed}}
\r\n\t\t\t\t\t\t\t\t\t\t\tQuestion: {giveaway.question}
\r\n\t\t\t\t\t\t\t\t\t\t\tAnswer{Chat.plural(giveaway.answers.length, \"s\")}: {giveaway.answers.join(', ')}
\r\n\t\t\t\t\t\t\t\t\t\t\tPoké Ball: \r\n\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t Prize\r\n\t\t\t\t\t\t\t\t\t\t\t\t{Giveaway.convertIVs(giveaway.prize, giveaway.ivs)}\r\n\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t{!!giveaway.extraInfo?.trim() && <>\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tExtra Info\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{giveaway.extraInfo.trim()}\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t})()}\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t{!Users.get(giveaway.targetUserID)?.connected ? <>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t : <>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t
);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn <>

Submitted Giveaways

{buf};\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn <>\r\n\t\t\t\t\t\t\t

Submit a Giveaway

\r\n\t\t\t\t\t\t\t{(() => {\r\n\t\t\t\t\t\t\t\tif (!type || !['question', 'lottery'].includes(type)) {\r\n\t\t\t\t\t\t\t\t\treturn
\r\n\t\t\t\t\t\t\t\t\t\t

Pick a giveaway type

\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tformatFakeButton(`/view-giveaways-submitted-add-lottery`, <> Lottery)\r\n\t\t\t\t\t\t\t\t\t\t} | {\r\n\t\t\t\t\t\t\t\t\t\t\tformatFakeButton(`/view-giveaways-submitted-add-question`, <> Question)\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t
;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tswitch (type) {\r\n\t\t\t\t\t\t\t\tcase 'lottery':\r\n\t\t\t\t\t\t\t\t\treturn
\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\tGame:
\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t{generatePokeballDropdown()}

\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t
;\r\n\t\t\t\t\t\t\t\tcase 'question':\r\n\t\t\t\t\t\t\t\t\treturn
\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\tGame:
\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t{generatePokeballDropdown()}

\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t
;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t})()}\r\n\t\t\t\t\t\t;\r\n\t\t\t\t\t}\r\n\t\t\t\t})()}\r\n\t\t\t
;\r\n\t\t},\r\n\t},\r\n};\r\n\r\nChat.multiLinePattern.register(`/giveaway (create|new|start|store|submit|save) (question|lottery) `);\r\n"], "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,iBAAwB;AAExB,YAAY,sBAAsB;AAAA,EACjC,MAAM;AAAA,EACN,MAAM;AACP,CAAC;AAED,MAAM,eAAe,IAAI,KAAK,KAAK,KAAK;AACxC,MAAM,mBAAmB,KAAK,KAAK,KAAK,KAAK;AAE7C,MAAM,YAAY;AAiClB,MAAM,WAAqB;AAAA,EAC1B,WAAW,CAAC;AAAA,EACZ,OAAO,CAAC;AAAA,EACR,iBAAiB;AAAA,IAChB,UAAU,CAAC;AAAA,IACX,SAAS,CAAC;AAAA,EACX;AAAA,EACA,oBAAoB;AAAA,IACnB,UAAU,CAAC;AAAA,IACX,SAAS,CAAC;AAAA,EACX;AACD;AAEO,IAAI,YAAsB,MAAM;AACtC,MAAI;AACH,WAAO,KAAK,UAAM,eAAG,SAAS,EAAE,SAAS,CAAC;AAAA,EAC3C,SAAS,GAAP;AACD,QAAI,EAAE,SAAS;AAAU,YAAM;AAC/B,WAAO;AAAA,EACR;AACD,GAAG;AAEH,SAAS,WAAW;AACnB,qBAAG,SAAS,EAAE,YAAY,MAAM,KAAK,UAAU,QA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