diff --git a/chat-plugins/poll.js b/chat-plugins/poll.js
new file mode 100644
index 0000000000..76693b78e2
--- /dev/null
+++ b/chat-plugins/poll.js
@@ -0,0 +1,163 @@
+/*
+* Poll chat plugin
+* This plugin allows roomauth (default: driver and above) to run a poll in a room.
+* Every room can have one poll, and every user can vote. The results are displayed for
+* users that have voted, and are updated in real time. The poll can be closed with /endpoll.
+* By bumbadadabum with (a lot of) help from Zarel.
+*/
+
+var permission = 'announce';
+
+var Poll = (function () {
+ function Poll(room, question, options) {
+ if (room.pollNumber) {
+ room.pollNumber++;
+ } else {
+ room.pollNumber = 1;
+ }
+ this.room = room;
+ this.question = question;
+ this.voters = new Set();
+ this.totalVotes = 0;
+
+ this.options = new Map();
+ for (var i = 0; i < options.length; i++) {
+ this.options.set(i + 1, {name: options[i], votes: 0});
+ }
+ }
+
+ Poll.prototype.vote = function (user, option) {
+ if (this.voters.has(user.latestIp)) {
+ return user.sendTo(this.room, "You have already voted for this poll.");
+ } else {
+ this.voters.add(user.latestIp);
+ }
+
+ this.options.get(option).votes++;
+ this.totalVotes++;
+
+ this.update();
+ };
+
+ Poll.prototype.generateVotes = function () {
+ var output = '