diff --git a/src/main/kotlin/net/moonleay/rssbot/extensions/FeedExtension.kt b/src/main/kotlin/net/moonleay/rssbot/extensions/FeedExtension.kt index 8b0bf0b..06b40d1 100644 --- a/src/main/kotlin/net/moonleay/rssbot/extensions/FeedExtension.kt +++ b/src/main/kotlin/net/moonleay/rssbot/extensions/FeedExtension.kt @@ -86,6 +86,19 @@ class FeedExtension : Extension() { } return@action } + if (SubscriptionRepository.exists(this.channel.id.value.toLong(), feedName) || SubscriptionRepository.existsWithUrl(this.channel.id.value.toLong(), feedUrl)) { + this.respond { + this.embeds.add( + MessageUtil.getEmbed( + EmbedColor.ERROR, + "Feed already exists", + "The feed \"${feedName}\" already exists", + user.username + ) + ) + } + return@action + } val id = SubscriptionRepository.write( SubscriptionData( 0,