TJ-Bot icon indicating copy to clipboard operation
TJ-Bot copied to clipboard

Add Gist link to formatted code embed

Open thegatesdev opened this issue 10 months ago • 0 comments

The "Format" code action generates a nice embed with the formatted code, but it does not display nicely on every screen. This is because the width is limited to some number, so wider screens don't actually get to display the contents any better. This is annoying when for example long lines of code get wrapped while there is still space.

Solution

Show a GitHub Gist link somewhere in the embed, that also displays the formatted code. The Gist functionality is already implemented with user file uploads.

Alternatives

  • Replace the embed with a Gist link.
  • ~~A bookmarklet that the user can add, which would execute JavaScript to modify the embed CSS to allow a bigger width.~~ Modifying the Discord UI would be against their TOS.
  • Link to some other place, e.g. a webpage with the formatted code, and options to further interact with the bot.

thegatesdev avatar Apr 16 '24 20:04 thegatesdev