[AB-130] making the regex for link embeds more relaxed in order to allow embedding canary and ptb links

This commit is contained in:
Sheldan
2021-03-24 17:40:05 +01:00
parent 08edcbdf8e
commit ddb256cf75

View File

@@ -30,7 +30,7 @@ import java.util.regex.Pattern;
@Slf4j
public class MessageEmbedServiceBean implements MessageEmbedService {
private Pattern messageRegex = Pattern.compile("(?<whole>https://discord(?:app)?.com/channels/(?<server>\\d+)/(?<channel>\\d+)/(?<message>\\d+)(?:.*?))+");
private final Pattern messageRegex = Pattern.compile("(?<whole>(?:https?://)?(?:\\w+\\.)?discord(?:app)?\\.com/channels/(?<server>\\d+)/(?<channel>\\d+)/(?<message>\\d+)(?:.*?))+");
public static final String MESSAGE_EMBED_TEMPLATE = "message_embed";
public static final String REMOVAL_EMOTE = "removeEmbed";