mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-18 14:40:51 +01:00
Missing irc's are bad
This commit is contained in:
parent
553f31c425
commit
4ca62e60fd
@ -86,7 +86,7 @@ class Poll(callbacks.Privmsg, plugins.ChannelDBHandler):
|
|||||||
db.commit()
|
db.commit()
|
||||||
return db
|
return db
|
||||||
|
|
||||||
def _getUserId(self, prefix):
|
def _getUserId(self, irc, prefix):
|
||||||
try:
|
try:
|
||||||
return ircdb.users.getUserId(prefix)
|
return ircdb.users.getUserId(prefix)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
@ -148,7 +148,7 @@ class Poll(callbacks.Privmsg, plugins.ChannelDBHandler):
|
|||||||
"""
|
"""
|
||||||
channel = privmsgs.getChannel(msg, args)
|
channel = privmsgs.getChannel(msg, args)
|
||||||
question = privmsgs.getArgs(args)
|
question = privmsgs.getArgs(args)
|
||||||
userId = self._getUserId(msg.prefix)
|
userId = self._getUserId(irc, msg.prefix)
|
||||||
db = self.getDb(channel)
|
db = self.getDb(channel)
|
||||||
cursor = db.cursor()
|
cursor = db.cursor()
|
||||||
cursor.execute("""INSERT INTO polls VALUES (NULL, %s, %s, 1)""",
|
cursor.execute("""INSERT INTO polls VALUES (NULL, %s, %s, 1)""",
|
||||||
@ -188,7 +188,7 @@ class Poll(callbacks.Privmsg, plugins.ChannelDBHandler):
|
|||||||
channel = privmsgs.getChannel(msg, args)
|
channel = privmsgs.getChannel(msg, args)
|
||||||
(poll_id, option) = privmsgs.getArgs(args, required=2)
|
(poll_id, option) = privmsgs.getArgs(args, required=2)
|
||||||
poll_id = self._getId(irc, poll_id)
|
poll_id = self._getId(irc, poll_id)
|
||||||
userId = self._getUserId(msg.prefix)
|
userId = self._getUserId(irc, msg.prefix)
|
||||||
db = self.getDb(channel)
|
db = self.getDb(channel)
|
||||||
cursor = db.cursor()
|
cursor = db.cursor()
|
||||||
# Only the poll starter or an admin can add options
|
# Only the poll starter or an admin can add options
|
||||||
@ -231,7 +231,7 @@ class Poll(callbacks.Privmsg, plugins.ChannelDBHandler):
|
|||||||
(poll_id, option_id) = privmsgs.getArgs(args, required=2)
|
(poll_id, option_id) = privmsgs.getArgs(args, required=2)
|
||||||
poll_id = self._getId(irc, poll_id)
|
poll_id = self._getId(irc, poll_id)
|
||||||
option_id = self._getId(irc, option_id)
|
option_id = self._getId(irc, option_id)
|
||||||
userId = self._getUserId(msg.prefix)
|
userId = self._getUserId(irc, msg.prefix)
|
||||||
db = self.getDb(channel)
|
db = self.getDb(channel)
|
||||||
cursor = db.cursor()
|
cursor = db.cursor()
|
||||||
cursor.execute("""SELECT open
|
cursor.execute("""SELECT open
|
||||||
|
Loading…
x
Reference in New Issue
Block a user