|
@@ -1,6 +1,6 @@ |
|
|
# -*- coding: utf-8 -*- |
|
|
# -*- coding: utf-8 -*- |
|
|
# |
|
|
# |
|
|
# Copyright (C) 2009-2015 Ben Kurtovic <ben.kurtovic@gmail.com> |
|
|
|
|
|
|
|
|
# Copyright (C) 2009-2016 Ben Kurtovic <ben.kurtovic@gmail.com> |
|
|
# |
|
|
# |
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy |
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy |
|
|
# of this software and associated documentation files (the "Software"), to deal |
|
|
# of this software and associated documentation files (the "Software"), to deal |
|
@@ -188,10 +188,13 @@ class Remind(Command): |
|
|
return |
|
|
return |
|
|
permdb.set_attr("command:remind", "data", "[]") |
|
|
permdb.set_attr("command:remind", "data", "[]") |
|
|
|
|
|
|
|
|
|
|
|
connect_wait = 30 |
|
|
for item in ast.literal_eval(database): |
|
|
for item in ast.literal_eval(database): |
|
|
rid, user, wait, end, message, data = item |
|
|
rid, user, wait, end, message, data = item |
|
|
if end < time.time(): |
|
|
|
|
|
continue |
|
|
|
|
|
|
|
|
if end < time.time() + connect_wait: |
|
|
|
|
|
# Make reminders that have expired while the bot was offline |
|
|
|
|
|
# trigger shortly after startup |
|
|
|
|
|
end = time.time() + connect_wait |
|
|
data = Data.unserialize(data) |
|
|
data = Data.unserialize(data) |
|
|
reminder = _Reminder(rid, user, wait, message, data, self, end) |
|
|
reminder = _Reminder(rid, user, wait, message, data, self, end) |
|
|
self._start_reminder(reminder, user) |
|
|
self._start_reminder(reminder, user) |
|
|