ClemBot
ClemBot copied to clipboard
Source Code Cog: Upload File Instead of Printing Script Contents in Code Block
I noticed the other day that file previews for programming files seem to be a much better way to share and view code in discord than code blocks (at least on PC) when there are more than 6 or lines of code.
The source code cog currently prints out the lines in code blocks. If the code is long, posting the code drowns out whatever else was happening in the channel. Posting a file with a preview doesn't have this issue, as only up to 6 lines of code are posted, with buttons to enable popups for viewing the rest of the code.
As such, when posting entire files and "long" code blocks, they should be uploaded as files instead of using code blocks. (or always upload files)
Example
Below is some code from this year's Advent of Code challenge when uploaded as a file:

Here is the same code but posted as a code block:

Uploading a file seems to clearly be the better option. It takes up less space and offers all the same functionality.
this is a good idea, at least as an option at least. however the file would still need to be relatively small for bandwith purposes. would be open to discussing a pr