remindlist: fix

This commit is contained in:
Ave Ozkal 2018-12-31 02:13:04 +03:00
parent ff9d39d199
commit b069dd90c0
No known key found for this signature in database
GPG key ID: 09356ABAA42C842B

View file

@ -15,9 +15,12 @@ class Remind:
async def remindlist(self, ctx):
"""Lists your reminders."""
ctab = get_crontab()
uid = str(ctx.author.id)
embed = discord.Embed(title=f"Active robocronp jobs")
for jobtimestamp in ctab["remind"]:
job_details = ctab["remind"][jobtimestamp][str(ctx.author.id)]
if uid not in ctab["remind"][jobtimestamp]:
continue
job_details = ctab["remind"][jobtimestamp][uid]
expiry_timestr = datetime.utcfromtimestamp(int(jobtimestamp))\
.strftime('%Y-%m-%d %H:%M:%S (UTC)')
embed.add_field(name=f"Reminder for {expiry_timestr}",