Skip to content

Conversation

@firasrg
Copy link
Contributor

@firasrg firasrg commented Jan 13, 2026

New Feature: Rewrite Command

The /rewrite command allows users to have their messages rewritten in a clearer, more professional, or better structured form using ChatGPT AI (GPT 5 mini). The rewritten message is displayed as an ephemeral message (visible only to the user), making it perfect for getting quick writing improvements without cluttering the channel where they are.

Usage

/rewrite message:<text> [tone:<style>]

Parameters

  • message (required): The message to rewrite (3-500 characters)
  • tone (optional): The tone/style enum value for the rewrite. Defaults to CLEAR if not provided

Available Tones

  • CLEAR (default): Make the message clear and easy to understand
  • PRO: Use a professional and polished tone
  • DETAILED: Expand with more detail and explanation
  • TECHNICAL: Use technical and specialized language where appropriate

How It Works

  1. You invoke the command with your message and optional tone
  2. ChatGPT analyzes and rewrites the message according to the selected tone
  3. A formatted embed displays both the original and rewritten versions
  4. The response is ephemeral—only visible to you for 15 minutes
  5. You can copy the rewritten text and use it.

Example

image

UPDATE 16 Jan 2026

  • The command name has been changed into /rewrite-msg for consistency with the class in source code.
  • The following is a demo that shows all possible states :

tjbot-rewrite-demo-3

UPDATE 20 Jan 2026

  • The command is back to its original name /rewrite.
  • The Tone Pro has been renamed to Professionnal
  • The original msg is no more provided by the bot, since it's possible to see it through a link to the command (built-in discord feat, see the demo below)
  • New method added to ChatGptService API, askRaw to avoid touching existing method and for future reusabilities

tjbot-rewrite-demo-5

@firasrg firasrg requested a review from a team as a code owner January 13, 2026 21:56
Copy link
Contributor

@tj-wazei tj-wazei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see comments. There's a lot of final abuse that does nothing but add clutter to the code. It's best to use final when you need it.

Copy link
Member

@Zabuzard Zabuzard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff. Apart from what the others mentioned, im happy now 👍

@Together-Java Together-Java deleted a comment from Zabuzard Jan 20, 2026
@Together-Java Together-Java deleted a comment from Zabuzard Jan 20, 2026
@firasrg firasrg added the new command Add a new command or group of commands to the bot label Jan 20, 2026
Copy link
Contributor

@tj-wazei tj-wazei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there, I still really hate the usage of final, my eyes kept having to "jump" as I was reading your code.

@firasrg firasrg force-pushed the firasrg/feature-slash-command-rewrite-msg branch from 89285c6 to 0604f9b Compare January 24, 2026 16:44
@sonarqubecloud
Copy link

Copy link
Contributor

@tj-wazei tj-wazei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new command Add a new command or group of commands to the bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants