Skip to content

Commit

Permalink
Merge pull request #100 from Softawii/feature/cleaner-twitter-message
Browse files Browse the repository at this point in the history
feat(twitter): cleaner message
  • Loading branch information
yaansz authored Feb 6, 2024
2 parents 26a52df + b078777 commit 9c4bfe8
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
public class TwitterListener extends ListenerAdapter {
private final Pattern twitterPattern;
private final TwitterParserConfigService service;
private static final char invisibleChar = '⠀'; // https://www.compart.com/en/unicode/U+2800

public TwitterListener(JDA jda, TwitterParserConfigService service) {
this.service = service;
Expand Down Expand Up @@ -70,13 +71,10 @@ private Optional<String> parseMessage(String twitterLink, User author) {
if (matcher.find()) {
String twitterUsername = matcher.group("username");
String twitterPostId = matcher.group("postId");

String result = String.format(
"""
Autor: %s
Link original: `%s`
[Postagem](https://fxtwitter.com/%s/status/%s)
""", author.getAsMention(), twitterLink, twitterUsername, twitterPostId);
Autor: %s | [Link original](<%s>) [%c](https://fxtwitter.com/%s/status/%s)
""", author.getAsMention(), twitterLink, invisibleChar, twitterUsername, twitterPostId);
return Optional.of(result);
}

Expand Down

0 comments on commit 9c4bfe8

Please # to comment.