diff --git a/src/irc_link.py b/src/irc_link.py index b9cd3b9..030535f 100644 --- a/src/irc_link.py +++ b/src/irc_link.py @@ -58,18 +58,13 @@ async def initialize(): async def on_bridge_message(channel_name, msg): if channel_name in util.config["irc"]["channels"]: - if channel_name not in joined: conn.join(channel_name) - # if its a reply if msg.replyee: - conn.privmessage (channel_name, f"Replying to @{random_color(msg.replyee.id)}{msg.replyee.name}{color_code('')}:") - + conn.privmessage(channel_name, f"Replying to @{random_color(msg.replyee.id)}{msg.replyee.name}{color_code('')}:") # ping fix - zero width space embedded in messages line = f"<{random_color(msg.author.id)}{msg.author.name[0]}\u200B{msg.author.name[1:]}{color_code('')}> " + render_formatting(msg.message)[:400] - conn.privmsg(channel_name, line) - for at in msg.attachments: conn.privmsg(channel_name, f"-> {at.filename}: {at.proxy_url}") diff --git a/src/telephone.py b/src/telephone.py index 36f694c..fd30a36 100644 --- a/src/telephone.py +++ b/src/telephone.py @@ -114,29 +114,10 @@ class Telephone(commands.Cog): if (msg.author == self.bot.user and msg.content[0] == "<") or msg.author.discriminator == "0000": return channel_id = msg.channel.id - msg = eventbus.Message( - eventbus.AuthorInfo( - msg.author.name, - msg.author.id, - str(msg.author.avatar_url), - msg.author.bot - ), - - parse_formatting (self.bot, msg.content), - - ("discord", channel_id), - - msg.id, - - eventbus.AuthorInfo( - msg.reference.cached_message.author.name, - msg.reference.cached_message.author.id, - str(msg.reference.cached_message.author.avatar_url), - msg.reference.cached_message.author.bot - ), - - [ at for at in msg.attachments if not at.is_spoiler() ] - ) + msg = eventbus.Message(eventbus.AuthorInfo(msg.author.name, msg.author.id, str(msg.author.avatar_url), msg.author.bot), + parse_formatting(self.bot, msg.content), ("discord", channel_id), msg.id, + eventbus.AuthorInfo(msg.reference.cached_message.author.name, msg.reference.cached_message.author.id, str(msg.reference.cached_message.author.avatar_url), msg.reference.cached_message.author.bot), + [ at for at in msg.attachments if not at.is_spoiler() ]) await eventbus.push(msg)