hacky fix for adding replies to bridge

please note i have no idea on how to test these
This commit is contained in:
what 2021-10-06 07:16:25 -07:00 committed by GitHub
parent 0bf84250b3
commit 92fbacbfcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -59,6 +59,10 @@ 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
try:
if msg.reference:
conn.privmessage (channel_name, f"Replying to @{random_color(msg.reference.cached_message.author.id)}{msg.reference.cached_message.author.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)