diff --git a/modules/poll.js b/modules/poll.js index cebb735..a1081b8 100644 --- a/modules/poll.js +++ b/modules/poll.js @@ -1,8 +1,4 @@ var poll = function(dbot) { - if(!dbot.db.hasOwnProperty('polls')) { - dbot.db.polls = {}; - } - var polls = dbot.db.polls; var commands = { '~newpoll': function(event) { diff --git a/run.js b/run.js index e6505a5..8958783 100644 --- a/run.js +++ b/run.js @@ -42,6 +42,9 @@ var DBot = function(timers) { if(!this.db.hasOwnProperty("ignores")) { this.db.ignores = {}; } + if(!this.db.hasOwnProperty('polls')) { + this.db.polls = {}; + } // Load Strings file this.strings = JSON.parse(fs.readFileSync('strings.json', 'utf-8'));