Skip to content

Only move bot embeds #229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions app/utils/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,7 @@ async def _format_reply(reply: discord.Message) -> discord.Embed:
else:
description = "> *Some forwarded content elided.*"
return (
discord.Embed(
description=f"{description_prefix}{truncate(description, 100)}",
url=reply.jump_url,
)
discord.Embed(description=f"{description_prefix}{truncate(description, 100)}")
.set_author(
name=f"↪️ Replying to {reply.author.display_name}",
icon_url=reply.author.display_avatar,
Expand Down Expand Up @@ -213,12 +210,11 @@ async def _format_forward(

msg_data = await MessageData.scrape(forward)
embeds = [
*forward.embeds,
*(e for e in forward.embeds if not e.url),
*await asyncio.gather(*map(_get_sticker_embed, forward.stickers)),
]
embed = discord.Embed(
description=content, timestamp=forward.created_at, url=forward.jump_url
).set_author(name="➜ Forwarded")
embed = discord.Embed(description=content, timestamp=forward.created_at)
embed.set_author(name="➜ Forwarded")

if hasattr(forward.channel, "name"):
# Some channel types don't have a `name` and Pyright can't figure out
Expand Down Expand Up @@ -412,7 +408,7 @@ async def move_message_via_webhook(
msg_data = await MessageData.scrape(message)

embeds = [
*message.embeds,
*(e for e in message.embeds if not e.url),
*await asyncio.gather(*map(_get_sticker_embed, message.stickers)),
]

Expand Down