Skip to content

Commit

Permalink
TotD: Update room after broadcasting the TotD (#4934)
Browse files Browse the repository at this point in the history
  • Loading branch information
iscke authored and Bär Halberkamp committed Oct 28, 2018
1 parent 1de5e74 commit 6643749
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion chat-plugins/thing-of-the-day.js
Original file line number Diff line number Diff line change
Expand Up @@ -583,12 +583,14 @@ let commands = {
if (!this.runBroadcast()) return false;

const handler = selectHandler(this.message);
if (!handler.room) return this.errorReply(`The room for this -otd doesn't exist.`);

if (room !== handler.room) return this.errorReply(`This command can only be used in ${handler.room.title}.`);

handler.generateWinnerDisplay().then(text => {
if (!text) return this.errorReply("There is no winner yet.");
return this.sendReplyBox(text);
this.sendReplyBox(text);
this.room.update();
});
},
};
Expand Down

0 comments on commit 6643749

Please sign in to comment.