From f0f07269985958e765cee74bcacdfd7b3858b3ef Mon Sep 17 00:00:00 2001 From: osmarks Date: Tue, 27 Oct 2020 16:35:56 +0000 Subject: [PATCH] removal of bug, probably addition of new ones --- src/telephone.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/telephone.py b/src/telephone.py index 3f9d8f4..db78c0f 100644 --- a/src/telephone.py +++ b/src/telephone.py @@ -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)) \ No newline at end of file + await ctx.send(embed=util.info_embed(title, f"Connected: {len(incoming) + len(outgoing)}", fields))