From 40736c54bfbbfa26973572919738b40bf2de13d2 Mon Sep 17 00:00:00 2001 From: Chr_ Date: Fri, 8 Dec 2023 22:17:12 +0800 Subject: [PATCH] update --- Directory.Build.props | 2 +- XinjingdailyBot.Service/Data/UserService.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index c91c04bf..e25ed47e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 2.2.4.9 + 2.2.4.10 diff --git a/XinjingdailyBot.Service/Data/UserService.cs b/XinjingdailyBot.Service/Data/UserService.cs index 1bc5b2a0..62d57dd5 100644 --- a/XinjingdailyBot.Service/Data/UserService.cs +++ b/XinjingdailyBot.Service/Data/UserService.cs @@ -501,12 +501,12 @@ private async Task AutoDeleteNotification(Message message) return null; } - if (target.StartsWith('@')) + if (target.StartsWith("https://t.me/") || target.StartsWith('@')) { - return await FetchUserByUserName(target[1..]); + target = target.Replace("https://t.me/", "").Replace("@", ""); + return await FetchUserByUserName(target); } - if (long.TryParse(target, out var userID)) { return await FetchUserByUserID(userID) ?? await FetchUserByUserName(target);