Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9c1f18fbee | |||
| 98e2683b80 |
@@ -4,6 +4,7 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import asyncio
|
import asyncio
|
||||||
import datetime
|
import datetime
|
||||||
|
import html
|
||||||
import os
|
import os
|
||||||
import pickle
|
import pickle
|
||||||
import re
|
import re
|
||||||
@@ -307,13 +308,13 @@ async def message_callback(conn, cursor, youtube, client, room, event):
|
|||||||
# Send the title to the channel so people know what the link is
|
# Send the title to the channel so people know what the link is
|
||||||
# Only do this for recent messages to prevent spam during backwards-sync
|
# Only do this for recent messages to prevent spam during backwards-sync
|
||||||
if recent:
|
if recent:
|
||||||
plain_text = f"🎵 {title}"
|
plain_text = f"{title}"
|
||||||
if channel:
|
if channel:
|
||||||
plain_text += f" - {channel}"
|
plain_text += f" - {channel}"
|
||||||
|
|
||||||
# Escape HTML characters to prevent broken rendering in Matrix
|
# Escape HTML characters to prevent broken rendering in Matrix
|
||||||
escaped_text = html.escape(plain_text)
|
escaped_text = html.escape(plain_text)
|
||||||
html_text = f"<em><font color='#808080'>{escaped_text}</font></em>"
|
html_text = f"<em><span data-mx-color='#808080'>{escaped_text}</span></em>"
|
||||||
|
|
||||||
await client.room_send(
|
await client.room_send(
|
||||||
room_id=room.room_id,
|
room_id=room.room_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user