Skip to content
Merged
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
9 changes: 8 additions & 1 deletion techsupport_bot/commands/factoids.py
Original file line number Diff line number Diff line change
Expand Up @@ -982,13 +982,17 @@ async def send_to_logger(
},
)
async def factoid_call_command(
self: Self, interaction: discord.Interaction, factoid_name: str
self: Self,
interaction: discord.Interaction,
factoid_name: str,
member_to_ping: discord.Member = None,
) -> None:
"""This is an app command version of typing {prefix}call

Args:
interaction (discord.Interaction): The interaction that triggered this command
factoid_name (str): The factoid name to search for and print
member_to_ping (discord.Member): A member to ping in the output

Raises:
TooLongFactoidMessageError: If the plaintext exceed 2000 characters
Expand Down Expand Up @@ -1055,6 +1059,9 @@ async def factoid_call_command(
# The not embed causes a ValueError in certain cases. This ensures fallback works
content = factoid.message

if member_to_ping:
content = f"{member_to_ping.mention} {content}".strip()

if content and len(content) > 2000:
embed = auxiliary.prepare_deny_embed(
message="I ran into an error sending that factoid: "
Expand Down
Loading