diff --git a/src/main/java/de/kittybot/kittybot/modules/MusicModule.java b/src/main/java/de/kittybot/kittybot/modules/MusicModule.java index f7dc9ae1..55bb8e9f 100644 --- a/src/main/java/de/kittybot/kittybot/modules/MusicModule.java +++ b/src/main/java/de/kittybot/kittybot/modules/MusicModule.java @@ -30,7 +30,7 @@ public class MusicModule extends Module implements Serializable{ public static final Pattern URL_PATTERN = Pattern.compile("^(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]?"); - public static final Pattern SPOTIFY_URL_PATTERN = Pattern.compile("^(https?://)?(www\\.)?open\\.spotify\\.com/(user/[a-zA-Z0-9-_]+/)?(?track|album|playlist)/(?[a-zA-Z0-9-_]+)"); + public static final Pattern SPOTIFY_URL_PATTERN = Pattern.compile("(https?://)?(www\\.)?open\\.spotify\\.com/(user/[a-zA-Z0-9-_]+/)?(?track|album|playlist)/(?[a-zA-Z0-9-_]+)"); private Map musicPlayers; @@ -203,7 +203,7 @@ public void play(GuildInteraction ia, String query, SearchProvider searchProvide var manager = this.musicPlayers.computeIfAbsent(ia.getGuildId(), guildId -> new MusicManager(this.modules, guildId, ia.getChannelId())); var matcher = SPOTIFY_URL_PATTERN.matcher(query); - if(matcher.matches()){ + if(matcher.find()){ this.modules.get(SpotifyModule.class).load(ia, manager, matcher); return; }