From fdad0054ef9f19a0a9e81ca7ec464150b0dc9318 Mon Sep 17 00:00:00 2001 From: RTAkland Date: Wed, 9 Oct 2024 18:35:28 +0800 Subject: [PATCH] chore: use cloudflare kv instead of vercel kv --- .../cn/rtast/fancybot/commands/misc/ShortLinkCommand.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/cn/rtast/fancybot/commands/misc/ShortLinkCommand.kt b/src/main/kotlin/cn/rtast/fancybot/commands/misc/ShortLinkCommand.kt index 1db0f58..34e3eeb 100644 --- a/src/main/kotlin/cn/rtast/fancybot/commands/misc/ShortLinkCommand.kt +++ b/src/main/kotlin/cn/rtast/fancybot/commands/misc/ShortLinkCommand.kt @@ -12,7 +12,6 @@ import cn.rtast.fancybot.annotations.CommandDescription import cn.rtast.fancybot.entity.shortlink.ShortLinkPayload import cn.rtast.fancybot.entity.shortlink.ShortLinkResponse import cn.rtast.fancybot.util.Http -import cn.rtast.fancybot.util.str.encodeToBase64 import cn.rtast.fancybot.util.str.toJson import cn.rtast.rob.entity.GroupMessage import cn.rtast.rob.util.BaseCommand @@ -26,10 +25,10 @@ class ShortLinkCommand : BaseCommand() { companion object { fun String.makeShortLink(): String { val shortLink = Http.post( - "$API_RTAST_URL/short_link", - ShortLinkPayload(this.encodeToBase64()).toJson() + "$API_RTAST_URL/api/sl", + ShortLinkPayload(this).toJson() ) - return "$API_RTAST_URL/s?rnd_id=${shortLink.id}" + return "$API_RTAST_URL/${shortLink.id}" } }