removal of bug, probably addition of new ones

This commit is contained in:
osmarks 2020-10-27 16:35:56 +00:00
parent f42dc02572
commit f0f0726998
1 changed files with 3 additions and 2 deletions

View File

@ -125,6 +125,7 @@ def setup(bot):
def check(re, u): return (str(re.emoji) == "" or str(re.emoji) == "") and u != bot.user
reaction = None
# wait until someone clicks the reactions, or time out and say so
try:
reaction, user = await bot.wait_for("reaction_add", timeout=util.config["call_timeout"], check=check)
@ -135,7 +136,7 @@ def setup(bot):
)
await asyncio.gather(call_message.remove_reaction("", bot.user), call_message.remove_reaction("", bot.user))
em = str(reaction.emoji)
em = str(reaction.emoji) if reaction else ""
if em == "": # accept call
await bot.database.execute("INSERT INTO calls VALUES (?, ?, ?)", (originating_address, address, util.timestamp()))
await bot.database.commit()
@ -195,4 +196,4 @@ def setup(bot):
fields.extend(map(lambda x: ["Incoming call", f"From {x['from_id']} - for {delta(x['start_time'])}"], incoming))
outgoing = await bot.database.execute_fetchall("SELECT * FROM calls WHERE from_id = ?", (addr,))
fields.extend(map(lambda x: ["Outgoing call", f"To {x['to_id']} - for {delta(x['start_time'])}"], outgoing))
await ctx.send(embed=util.info_embed(title, f"Connected: {len(incoming) + len(outgoing)}", fields))
await ctx.send(embed=util.info_embed(title, f"Connected: {len(incoming) + len(outgoing)}", fields))