Added restore for tells

This commit is contained in:
mrhanky 2017-05-16 18:37:27 +02:00
parent 4414a3ade7
commit 459651de2f
No known key found for this signature in database
GPG Key ID: 67D772C481CB41B8

View File

@ -29,6 +29,13 @@ class Futures(DatabasePlugin):
args = (IrcString(res['mask']), res['channel'], delta,
res['message'], res['delay'], res['id'])
asyncio.ensure_future(self._timer(*args))
# Restore tells from database
self.cur.execute('select * from tells')
for res in self.cur.fetchall():
user = res['user']
if user not in self.tell_queue:
self.tell_queue[user] = []
self.tell_queue[user].append(res)
@command
def timer(self, mask: IrcString, channel: IrcString, args: DocOptDict):