mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-05 21:17:43 -05:00
Chat: Fix parseSpoiler adding undefined strings (#8037)
And fix /forcerename
This commit is contained in:
parent
61ea2dd916
commit
b1b29daeec
|
|
@ -1527,7 +1527,7 @@ export const commands: ChatCommands = {
|
|||
return this.errorReply(`User '${target}' not found.`);
|
||||
}
|
||||
this.checkCan('forcerename', targetID);
|
||||
const {publicReason, privateReason} = this.parseSpoiler(target);
|
||||
const {publicReason, privateReason} = this.parseSpoiler(reason);
|
||||
|
||||
Monitor.forceRenames.set(targetUser.id, (Monitor.forceRenames.get(targetUser.id) || 0) + 1);
|
||||
|
||||
|
|
|
|||
|
|
@ -814,7 +814,7 @@ export class CommandContext extends MessageContext {
|
|||
(this.room || Rooms.global).modlog(entry);
|
||||
}
|
||||
parseSpoiler(str: string) {
|
||||
let privateReason;
|
||||
let privateReason = "";
|
||||
if (!str) return {publicReason: "", privateReason};
|
||||
|
||||
let publicReason = str;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user