···24from xmpp_discord_bridge.discord import DiscordClient
25from xmpp_discord_bridge.helpers import discord_status_to_xmpp_show
2627+# TODO: Move into separate file
28+# TODO: Add an option that allows a real user to join the MUC to replace a virtual one
29class BridgeComponent(ComponentXMPP):
30 def __init__(self, jid, secret, server, port, token, config):
31 ComponentXMPP.__init__(self, jid, secret, server, port)
···253 member.mention)
254255 if message["oob"]["url"] and message["body"] == message["oob"]["url"]:
256+ # TODO: Quick and dirty hack. Discord requires a webhook embed to have
257+ # a description
258+ description = message["oob"]["url"].split("/")[-1]
259+ embed = Embed(url=message["oob"]["url"], type="rich", description=description)
260+ embed.set_image(url=message["oob"]["url"])
261+262+ # I mean, this should always be true, but you never know
263+ if content == message["oob"]["url"]:
264+ # NOTE: To prevent the URL being visible in Discord, remove the content.
265+ # Makes it feel more native.
266+ content = None
267268 try:
269 await self._webhooks[muc].send(content=content,