Skip to content

Commit

Permalink
feat: Link to message
Browse files Browse the repository at this point in the history
  • Loading branch information
Alc-Alc committed May 13, 2024
1 parent f863a14 commit 49e6d79
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/byte/plugins/custom/litestar.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,19 @@ def __init__(
custom_id: str = MISSING,
message: Message | None = None,
) -> None:
self.jump_url: str | None = None
# NOTE: check how else to set default
super().__init__(title=title, timeout=timeout, custom_id=custom_id)
if message:
self.description.default = message.content
self.jump_url = message.jump_url

async def on_submit(self, interaction: Interaction) -> None:
issue_reporter = interaction.user
issue_body_lines = [
"### Reported by",
f"[{issue_reporter.display_name}](https://discord.com/users/{issue_reporter.id}) in Discord: {interaction.channel.name}", # noqa: E501
f"[{issue_reporter.display_name}](https://discord.com/users/{issue_reporter.id})"
f" in Discord: [#{interaction.channel.name}]({self.jump_url})",
"",
"### Description",
f"{self.description.value.strip()}",
Expand Down

0 comments on commit 49e6d79

Please sign in to comment.