JavaBot icon indicating copy to clipboard operation
JavaBot copied to clipboard

Automatically generate code-blocks for Github gist links in chat

Open jasonlessenich opened this issue 3 years ago • 2 comments

Description Allow inlining of code blocks from GitHub links that have highlighted lines.

Example

Dioxin says: Check this out: https://gist.github.com/discorddioxin/27a33cf1376847f4ada29d61390c5198#file-main-java-L13-L16

Bot says:

        box.getItems().add(new Student("First", 111, 3));
        box.getItems().add(new Student("Second", 222, 4));
        box.getSelectionModel().select(0);

→ https://canary.discord.com/channels/648956210850299986/752535909228085348/867505817506414593

jasonlessenich avatar Aug 24 '21 16:08 jasonlessenich

Have been working on this and I have an idea in mind just want to run it by everyone before I polish it up. So gists can hold multiple files. A Gist link can be a link to a whole gist or a file in the gist or even a commit in a gist. My idea for this implementation is to have the bot send the code block and add a forwards and backwards reaction to the message allowing them to navigate the gist and the message be updated.

Kemikals avatar Oct 11 '21 08:10 Kemikals

That sounds good, as long as it is relatively simple to keep track of the state without needing to use a database for a relatively minor feature.

andrewlalis avatar Oct 11 '21 11:10 andrewlalis