Skip to content
This repository has been archived by the owner on Jul 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #186 from book000/fix/media-url
Browse files Browse the repository at this point in the history
feat(textimg): media.discordapp.netに対応
  • Loading branch information
yuuahp authored Nov 24, 2022
2 parents 2556d1a + f9971d4 commit 2442cec
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void generateTextImg(SlashCommandInteractionEvent event) {
}
String url = Main.getExistsOption(event, "messagelink").getAsString();
Pattern msgUrlPattern = Pattern.compile("^https://discord(?:app)?\\.com/channels/(\\d+)/(\\d+)/(\\d+)$");
Pattern mediaUrlPattern = Pattern.compile("^https://cdn\\.discordapp\\.com/attachments/(\\d+)/(\\d+)/(.+)$");
Pattern mediaUrlPattern = Pattern.compile("^https://(?:cdn|media)\\.discordapp\\.(?:com|net)/attachments/(\\d+)/(\\d+)/(.+)$");

String imageUrl;
Matcher msgUrlMatcher = msgUrlPattern.matcher(url);
Expand Down

0 comments on commit 2442cec

Please sign in to comment.