Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Aug 19, 2025

Adds the ability for server administrators to customize how fixed links are displayed using template placeholders in the /settings command.

What's New

Previously, FixTweetBot used a fixed format for displaying fixed links:

[Original Tweet](<https://twitter.com/user/status/123>) • [Author](<https://twitter.com/author>) • [FxTwitter](https://fxtwitter.com/user/status/123)

Now administrators can create custom templates using placeholders like:

{member} posted {fixed_link} by {author} at {datetime}

Which renders as:

@User posted [Fixed Tweet](https://fxtwitter.com/user/status/123) by [OriginalAuthor](<https://twitter.com/OriginalAuthor>) at 2023-12-19 12:00

Available Template Placeholders

  • {member} - Discord mention of the user who posted the link
  • {fixed_link} - The fixed link with markdown formatting [label](url)
  • {author} - Original content author with link if available
  • {original_link} - Original link with markdown formatting
  • {datetime} - Current timestamp (YYYY-MM-DD HH:MM)
  • {fixed_url} - Just the fixed URL without formatting
  • {original_url} - Just the original URL without formatting

UI Features

  • New setting: "📝 Link render template" in /settings menu
  • Visual indicators: 🟢 when custom template is active, 🔴 when using default
  • Template editor: Multi-line textarea with 500 character limit
  • Reset option: One-click return to default format
  • Live preview: Shows current template or "(Using default format)"
  • Input validation: Prevents overly long templates with helpful error messages

Technical Implementation

  • Database: Added link_render_template TEXT field to guilds table with migration
  • Backwards compatible: Existing servers continue using default format unchanged
  • Error handling: Invalid templates gracefully fall back to default format
  • Security: Only predefined placeholders supported, no code execution risks
  • Performance: Template rendering only occurs when custom template is set

Example Use Cases

Simple mention format:

{member} shared: {fixed_url}

Detailed format with context:

🔗 {member} posted {fixed_link} by {author} at {datetime}

Minimal format:

{fixed_link}

This enhancement provides servers with flexibility to match their community's style and preferences while maintaining the bot's core functionality.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] add the possibility, in /settings, to edit the link render using a template (e.g. "{member} posted {fixed_link} by {author} at {datetime}") Add customizable link render template setting to /settings Aug 19, 2025
@Copilot Copilot AI requested a review from Kyrela August 19, 2025 23:28
Copilot finished work on behalf of Kyrela August 19, 2025 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants