Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Github preview message #2

Open
ChiefArug opened this issue Aug 29, 2024 · 2 comments
Open

Improve Github preview message #2

ChiefArug opened this issue Aug 29, 2024 · 2 comments
Labels
enhancement New feature or request needs discussion

Comments

@ChiefArug
Copy link

First of all, very cool bot! I'm used to message preview bots but this is building on that and definitely a cool addition.

Currently it is a bit awkward with the full commit hash in the message, which is very long and often causes slightly odd line wrapping when you aren't using maximized desktop discord, which is why git and github typically only display the first 6 characters. It would also be nice to have more links in there, like the file path selector github has when viewing a file.

Something like:
TelepaticGrunt/Bumblezone:c2d25d
common/src/main/resources/assets/the_bumblezone/sounds.json#450

405 |   "entity.the_bumblezone.bee_queen.happy": {

(side note, since when has githubs json syntax highlighter had syntax errors)

where each clickable section goes to where you expect it to.

This is a bit long in terms of raw character count (see below), but if it starts to not fit in discords character limit then you can replace the commit hash with the short hash (first 6 chars) and github will still resolve it into the full hash!

[TelepaticGrunt](<https://github.com/TelepathicGrunt>)/[Bumblezone](<https://github.com/TelepathicGrunt/Bumblezone>):[c2d25d](<https://github.com/TelepathicGrunt/Bumblezone/commit/c2d25d19155a2b4ba6307aa730a297970e94f2f2>)
[common](<https://github.com/TelepathicGrunt/Bumblezone/blob/c2d25d19155a2b4ba6307aa730a297970e94f2f2/common/>)/[src](<https://github.com/TelepathicGrunt/Bumblezone/blob/c2d25d19155a2b4ba6307aa730a297970e94f2f2/common/src/>)/[main](<https://github.com/TelepathicGrunt/Bumblezone/blob/c2d25d19155a2b4ba6307aa730a297970e94f2f2/common/src/main/>)/[resources](<https://github.com/TelepathicGrunt/Bumblezone/blob/c2d25d19155a2b4ba6307aa730a297970e94f2f2/common/src/main/resources/>)/[assets](<https://github.com/TelepathicGrunt/Bumblezone/blob/c2d25d19155a2b4ba6307aa730a297970e94f2f2/common/src/main/resources/assets/>)/[the_bumblezone](<https://github.com/TelepathicGrunt/Bumblezone/blob/c2d25d19155a2b4ba6307aa730a297970e94f2f2/common/src/main/resources/assets/the_bumblezone>)/[sounds.json#450](<https://github.com/TelepathicGrunt/Bumblezone/blob/c2d25d19155a2b4ba6307aa730a297970e94f2f2/common/src/main/resources/assets/the_bumblezone/sounds.json#L405>)
```json
405 |   "entity.the_bumblezone.bee_queen.happy": {
```
@ChiefArug
Copy link
Author

Looks like github uses the first 7 chars of the commit hash, not the first 6 whoops. Everything still applies though.

@Kneemund
Copy link
Owner

Thanks for the kind words and sorry for the late reply. Using the short hash in the message header seems like a good improvement, I'll work on that soon.

Adding hyperlinks to all sections of the URL also sounds good. Unfortunately, Discord mobile doesn't support file previews, so I'd like to keep the character count of the header to a minimum. That way, the content is more likely to fit into the character limit (and doesn't need to be appended as a file). Like you already said, all the hyperlinks would significantly increase the character count, and using the short hash in the URLs probably wouldn't help much.

@Kneemund Kneemund added the enhancement New feature or request label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs discussion
Projects
None yet
Development

No branches or pull requests

2 participants