···2424from xmpp_discord_bridge.discord import DiscordClient
2525from xmpp_discord_bridge.helpers import discord_status_to_xmpp_show
26262727+# TODO: Move into separate file
2828+# TODO: Add an option that allows a real user to join the MUC to replace a virtual one
2729class BridgeComponent(ComponentXMPP):
2830 def __init__(self, jid, secret, server, port, token, config):
2931 ComponentXMPP.__init__(self, jid, secret, server, port)
···251253 member.mention)
252254253255 if message["oob"]["url"] and message["body"] == message["oob"]["url"]:
254254- embed = Embed(url=message["oob"]["url"], type="rich")
256256+ # TODO: Quick and dirty hack. Discord requires a webhook embed to have
257257+ # a description
258258+ description = message["oob"]["url"].split("/")[-1]
259259+ embed = Embed(url=message["oob"]["url"], type="rich", description=description)
260260+ embed.set_image(url=message["oob"]["url"])
261261+262262+ # I mean, this should always be true, but you never know
263263+ if content == message["oob"]["url"]:
264264+ # NOTE: To prevent the URL being visible in Discord, remove the content.
265265+ # Makes it feel more native.
266266+ content = None
255267256268 try:
257269 await self._webhooks[muc].send(content=content,