Prevent duplicate options in polls (#5532)

This commit is contained in:
TheJetOU
2019-06-19 00:32:36 +03:00
committed by Bär Halberkamp
parent c878afa2ad
commit 4d6bb5638e

View File

@@ -258,6 +258,10 @@ const commands = {
return this.errorReply("Too many options for poll (maximum is 8).");
}
if (new Set(options).size !== options.length) {
return this.errorReply("There are duplicate options in the poll.");
}
room.poll = new Poll(room, {source: params[0], supportHTML: supportHTML}, options);
room.poll.display();