JavaBot
JavaBot copied to clipboard
Automatically generate code-blocks for Github gist links in chat
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
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.
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.