mirror of
https://github.com/osmarks/autobotrobot
synced 2025-02-07 12:40:00 +00:00
link changes
This commit is contained in:
parent
d43e431c54
commit
8cf67088ae
@ -102,7 +102,7 @@ async def initialize():
|
||||
def disconnect(conn, event):
|
||||
logging.warn("Disconnected from IRC, reinitializing")
|
||||
teardown()
|
||||
asyncio.create_task(initialize())
|
||||
if not conn.planned_disconnection: asyncio.create_task(initialize())
|
||||
|
||||
# TODO: do better thing
|
||||
conn.add_global_handler("welcome", connect)
|
||||
@ -117,5 +117,7 @@ def setup(bot):
|
||||
asyncio.create_task(initialize())
|
||||
|
||||
def teardown(bot=None):
|
||||
if global_conn: global_conn.disconnect()
|
||||
if global_conn:
|
||||
global_conn.planned_disconnection = True
|
||||
global_conn.disconnect()
|
||||
if unlisten: unlisten()
|
||||
|
@ -126,7 +126,7 @@ class Telephone(commands.Cog):
|
||||
else:
|
||||
try:
|
||||
replying_to = await self.bot.get_guild(msg.reference.guild_id).get_channel(msg.reference.channel_id).fetch_message(msg.reference.message_id)
|
||||
except discord.HTTPException:
|
||||
except (discord.HTTPException, AttributeError):
|
||||
replying_to = None
|
||||
if replying_to:
|
||||
reply = (eventbus.AuthorInfo(replying_to.author.name, replying_to.author.id, str(replying_to.author.display_avatar.url), replying_to.author.bot), parse_formatting(self.bot, replying_to.content))
|
||||
|
Loading…
x
Reference in New Issue
Block a user