diff --git a/Theresa3rd-Bot/TheresaBot.Main/Handler/BaseHandler.cs b/Theresa3rd-Bot/TheresaBot.Main/Handler/BaseHandler.cs index a55dfde9..c1c60dd1 100644 --- a/Theresa3rd-Bot/TheresaBot.Main/Handler/BaseHandler.cs +++ b/Theresa3rd-Bot/TheresaBot.Main/Handler/BaseHandler.cs @@ -234,7 +234,7 @@ public async Task CheckSuperManagersAsync(PrivateCommand command) { if (command.MemberId.IsSuperManager() == false) { - await command.ReplyFriendTemplateAsync(BotConfig.GeneralConfig.ManagersRequiredMsg, "该功能需要管理员执行"); + await command.ReplyPrivateTemplateAsync(BotConfig.GeneralConfig.ManagersRequiredMsg, "该功能需要管理员执行"); return false; } return true; diff --git a/Theresa3rd-Bot/TheresaBot.Main/Handler/CookieHandler.cs b/Theresa3rd-Bot/TheresaBot.Main/Handler/CookieHandler.cs index c11bf0ef..88966b03 100644 --- a/Theresa3rd-Bot/TheresaBot.Main/Handler/CookieHandler.cs +++ b/Theresa3rd-Bot/TheresaBot.Main/Handler/CookieHandler.cs @@ -31,17 +31,17 @@ public async Task UpdatePixivCookieAsync(PrivateCommand command) var cookie = command.KeyWord; if (string.IsNullOrWhiteSpace(cookie)) { - await command.ReplyFriendMessageAsync($"未检测到Cookie"); + await command.ReplyPrivateMessageAsync($"未检测到Cookie"); return; } var website = websiteService.UpdatePixivCookie(cookie); WebsiteDatas.LoadWebsite(); var expireDate = website.CookieExpireDate.ToSimpleString(); - await command.ReplyFriendMessageAsync($"Cookie更新完毕,过期时间为:{expireDate}"); + await command.ReplyPrivateMessageAsync($"Cookie更新完毕,过期时间为:{expireDate}"); } catch (HandleException ex) { - await command.ReplyFriendMessageAsync(ex.RemindMessage); + await command.ReplyPrivateMessageAsync(ex.RemindMessage); } catch (Exception ex) { @@ -61,17 +61,17 @@ public async Task UpdateSaucenaoCookieAsync(PrivateCommand command) var cookie = command.KeyWord; if (string.IsNullOrWhiteSpace(cookie)) { - await command.ReplyFriendMessageAsync($"未检测到Cookie"); + await command.ReplyPrivateMessageAsync($"未检测到Cookie"); return; } var website = websiteService.UpdateSaucenaoCookie(cookie); WebsiteDatas.LoadWebsite(); var expireDate = website.CookieExpireDate.ToSimpleString(); - await command.ReplyFriendMessageAsync($"Cookie更新完毕,过期时间为:{expireDate}"); + await command.ReplyPrivateMessageAsync($"Cookie更新完毕,过期时间为:{expireDate}"); } catch (HandleException ex) { - await command.ReplyFriendMessageAsync(ex.RemindMessage); + await command.ReplyPrivateMessageAsync(ex.RemindMessage); } catch (Exception ex) { diff --git a/Theresa3rd-Bot/TheresaBot.Main/Handler/LocalSetuHandler.cs b/Theresa3rd-Bot/TheresaBot.Main/Handler/LocalSetuHandler.cs index 9539dcf3..264b1031 100644 --- a/Theresa3rd-Bot/TheresaBot.Main/Handler/LocalSetuHandler.cs +++ b/Theresa3rd-Bot/TheresaBot.Main/Handler/LocalSetuHandler.cs @@ -63,7 +63,7 @@ public async Task LocalSearchAsync(GroupCommand command) if (BotConfig.SetuConfig.SendPrivate) { await Task.Delay(1000); - Task sendTempTask = command.SendTempSetuAsync(setuContent, BotConfig.PixivConfig.SendImgBehind); + Task sendTempTask = command.SendPrivateSetuAsync(setuContent, BotConfig.PixivConfig.SendImgBehind); } CoolingCache.SetMemberSetuCooling(command.GroupId, command.MemberId); } diff --git a/Theresa3rd-Bot/TheresaBot.Main/Handler/LoliconHandler.cs b/Theresa3rd-Bot/TheresaBot.Main/Handler/LoliconHandler.cs index 0d7d7194..0795e558 100644 --- a/Theresa3rd-Bot/TheresaBot.Main/Handler/LoliconHandler.cs +++ b/Theresa3rd-Bot/TheresaBot.Main/Handler/LoliconHandler.cs @@ -70,7 +70,7 @@ public async Task LoliconSearchAsync(GroupCommand command) if (BotConfig.SetuConfig.SendPrivate) { await Task.Delay(1000); - Task sendTempTask = command.SendTempSetuAsync(setuContent, BotConfig.PixivConfig.SendImgBehind); + Task sendTempTask = command.SendPrivateSetuAsync(setuContent, BotConfig.PixivConfig.SendImgBehind); } CoolingCache.SetMemberSetuCooling(command.GroupId, command.MemberId); diff --git a/Theresa3rd-Bot/TheresaBot.Main/Handler/LolisukiHandler.cs b/Theresa3rd-Bot/TheresaBot.Main/Handler/LolisukiHandler.cs index 419bc342..7afda536 100644 --- a/Theresa3rd-Bot/TheresaBot.Main/Handler/LolisukiHandler.cs +++ b/Theresa3rd-Bot/TheresaBot.Main/Handler/LolisukiHandler.cs @@ -71,7 +71,7 @@ public async Task LolisukiSearchAsync(GroupCommand command) if (BotConfig.SetuConfig.SendPrivate) { await Task.Delay(1000); - Task sendTempTask = command.SendTempSetuAsync(setuContent, BotConfig.PixivConfig.SendImgBehind); + Task sendTempTask = command.SendPrivateSetuAsync(setuContent, BotConfig.PixivConfig.SendImgBehind); } CoolingCache.SetMemberSetuCooling(command.GroupId, command.MemberId); diff --git a/Theresa3rd-Bot/TheresaBot.Main/Handler/PixivHandler.cs b/Theresa3rd-Bot/TheresaBot.Main/Handler/PixivHandler.cs index febf949f..2bde5371 100644 --- a/Theresa3rd-Bot/TheresaBot.Main/Handler/PixivHandler.cs +++ b/Theresa3rd-Bot/TheresaBot.Main/Handler/PixivHandler.cs @@ -91,7 +91,7 @@ public async Task PixivSearchAsync(GroupCommand command) if (BotConfig.SetuConfig.SendPrivate) { await Task.Delay(1000); - Task sendTempTask = command.SendTempSetuAsync(setuContent, BotConfig.PixivConfig.SendImgBehind); + Task sendTempTask = command.SendPrivateSetuAsync(setuContent, BotConfig.PixivConfig.SendImgBehind); } CoolingCache.SetMemberSetuCooling(command.GroupId, command.MemberId);//进入CD状态 diff --git a/Theresa3rd-Bot/TheresaBot.Main/Handler/SaucenaoHandler.cs b/Theresa3rd-Bot/TheresaBot.Main/Handler/SaucenaoHandler.cs index 332fdc6e..7af2c29c 100644 --- a/Theresa3rd-Bot/TheresaBot.Main/Handler/SaucenaoHandler.cs +++ b/Theresa3rd-Bot/TheresaBot.Main/Handler/SaucenaoHandler.cs @@ -258,7 +258,7 @@ private async Task ReplyAndRevoke(GroupCommand command, List conten if (BotConfig.SaucenaoConfig.SendPrivate) { await Task.Delay(1000); - await command.SendTempMessageAsync(contentList); + await command.SendPrivateMessageAsync(contentList); } } @@ -269,7 +269,7 @@ private async Task ReplyAndRevoke(GroupCommand command, List setuCo if (BotConfig.SaucenaoConfig.SendPrivate) { await Task.Delay(1000); - await command.SendTempSetuAsync(setuContents); + await command.SendPrivateSetuAsync(setuContents); } } diff --git a/Theresa3rd-Bot/TheresaBot.Main/Handler/UndercoverHandler.cs b/Theresa3rd-Bot/TheresaBot.Main/Handler/UndercoverHandler.cs index c6e8cd38..bb2c3261 100644 --- a/Theresa3rd-Bot/TheresaBot.Main/Handler/UndercoverHandler.cs +++ b/Theresa3rd-Bot/TheresaBot.Main/Handler/UndercoverHandler.cs @@ -85,7 +85,7 @@ public async Task SendPrivateWords(GroupCommand command) var contents = new List { new PlainContent(player.GetWordMessage(ucConfig.SendIdentity)) }; - await command.SendTempMessageAsync(contents); + await command.SendPrivateMessageAsync(contents); await Task.Delay(1000); await command.ReplyGroupMessageWithQuoteAsync("词条已私发,请查看私聊消息"); } @@ -104,19 +104,19 @@ public async Task CreateWords(PrivateCommand command) var limitCount = BotConfig.GameConfig.Undercover.AddWordLimits; if (isManager == false && limitCount <= 0) { - await command.ReplyFriendMessageAsync($"超级管理员已关闭添加词条功能,请联系超级管理员~"); + await command.ReplyPrivateMessageAsync($"超级管理员已关闭添加词条功能,请联系超级管理员~"); return; } var unauthCount = ucWordService.GetUnauthorizedCount(command.MemberId); if (isManager == false && unauthCount >= limitCount) { - await command.ReplyFriendMessageAsync($"已添加{unauthCount}个未经审核的词条,请等待超级管理员审核后再继续添加~"); + await command.ReplyPrivateMessageAsync($"已添加{unauthCount}个未经审核的词条,请等待超级管理员审核后再继续添加~"); return; } var newWords = await AskNewWords(command); if (isManager == false && unauthCount + newWords.Count > limitCount) { - await command.ReplyFriendMessageAsync($"非超级管理员限制添加词条个数为{limitCount}个,剩余可添加词条{limitCount - unauthCount}个,等待管理员审核后可以添加更多词条"); + await command.ReplyPrivateMessageAsync($"非超级管理员限制添加词条个数为{limitCount}个,剩余可添加词条{limitCount - unauthCount}个,等待管理员审核后可以添加更多词条"); return; } foreach (var item in newWords) @@ -126,16 +126,16 @@ public async Task CreateWords(PrivateCommand command) } if (isManager) { - await command.ReplyFriendMessageAsync("添加完毕~"); + await command.ReplyPrivateMessageAsync("添加完毕~"); } else { - await command.ReplyFriendMessageAsync("添加完毕,请等待超级管理员审核~"); + await command.ReplyPrivateMessageAsync("添加完毕,请等待超级管理员审核~"); } } catch (ProcessException ex) { - await command.ReplyFriendMessageAsync(ex.RemindMessage); + await command.ReplyPrivateMessageAsync(ex.RemindMessage); } catch (Exception ex) { diff --git a/Theresa3rd-Bot/TheresaBot.Main/Helper/CommandHelper.cs b/Theresa3rd-Bot/TheresaBot.Main/Helper/CommandHelper.cs index 3c9326c7..d5588101 100644 --- a/Theresa3rd-Bot/TheresaBot.Main/Helper/CommandHelper.cs +++ b/Theresa3rd-Bot/TheresaBot.Main/Helper/CommandHelper.cs @@ -162,10 +162,10 @@ public static async Task ReplyProcessingMessageAsync(this GroupCommand command, /// /// /// - public static async Task SendTempSetuAsync(this GroupCommand command, List setuContents) + public static async Task SendPrivateSetuAsync(this GroupCommand command, List setuContents) { List contentList = setuContents.ToBaseContent().SetDefaultImage(); - return await command.SendTempMessageAsync(contentList); + return await command.SendPrivateMessageAsync(contentList); } /// @@ -175,7 +175,7 @@ public static async Task SendTempSetuAsync(this GroupCommand command /// /// /// - public static async Task SendTempSetuAsync(this GroupCommand command, SetuContent setuContent, bool sendImgBehind) + public static async Task SendPrivateSetuAsync(this GroupCommand command, SetuContent setuContent, bool sendImgBehind) { List results = new List(); List msgContents = setuContent.SetuInfos ?? new(); @@ -183,14 +183,14 @@ public static async Task SendTempSetuAsync(this GroupCommand comma if (sendImgBehind) { - results.Add(await command.SendTempMessageAsync(msgContents)); + results.Add(await command.SendPrivateMessageAsync(msgContents)); await Task.Delay(1000); - results.Add(await command.SendTempMessageAsync(imgContents)); + results.Add(await command.SendPrivateMessageAsync(imgContents)); } else { List contentList = msgContents.Concat(imgContents).ToList(); - results.Add(await command.SendTempMessageAsync(contentList)); + results.Add(await command.SendPrivateMessageAsync(contentList)); } return results.ToArray(); @@ -310,7 +310,7 @@ public static async Task ReplyGroupTemplateWithQuoteAsync(this Group /// /// /// - public static async Task ReplyFriendTemplateAsync(this PrivateCommand command, string template, string defaultmsg) + public static async Task ReplyPrivateTemplateAsync(this PrivateCommand command, string template, string defaultmsg) { template = template?.Trim()?.TrimLine(); if (string.IsNullOrWhiteSpace(template)) template = defaultmsg; @@ -368,7 +368,7 @@ public static async Task ReplyGroupMessageWithAtAsync(this GroupComm /// /// /// - public static async Task SendTempMessageAsync(this GroupCommand command, List contents) + public static async Task SendPrivateMessageAsync(this GroupCommand command, List contents) { return await command.Session.SendTempMessageAsync(command.GroupId, command.MemberId, contents); } @@ -379,7 +379,7 @@ public static async Task SendTempMessageAsync(this GroupCommand comm /// /// /// - public static async Task ReplyFriendMessageAsync(this PrivateCommand command, string message) + public static async Task ReplyPrivateMessageAsync(this PrivateCommand command, string message) { return await command.Session.SendFriendMessageAsync(command.MemberId, message); } @@ -390,7 +390,7 @@ public static async Task ReplyFriendMessageAsync(this PrivateCommand /// /// /// - public static async Task ReplyFriendMessageAsync(this PrivateCommand command, List contents) + public static async Task ReplyPrivateMessageAsync(this PrivateCommand command, List contents) { return await command.Session.SendFriendMessageAsync(command.MemberId, contents); } diff --git a/Theresa3rd-Bot/TheresaBot.Main/Model/Process/FriendStep.cs b/Theresa3rd-Bot/TheresaBot.Main/Model/Process/FriendStep.cs index 77e04fe6..ae584a1c 100644 --- a/Theresa3rd-Bot/TheresaBot.Main/Model/Process/FriendStep.cs +++ b/Theresa3rd-Bot/TheresaBot.Main/Model/Process/FriendStep.cs @@ -29,12 +29,12 @@ public FriendStep(PrivateCommand command, string question, int waitSecond, Func< public override async Task SendQuestion() { - await FriendCommand.ReplyFriendMessageAsync(Question); + await FriendCommand.ReplyPrivateMessageAsync(Question); } public override async Task ReplyError(BaseRelay relay, ProcessException ex) { - await FriendCommand.ReplyFriendMessageAsync(ex.RemindMessage); + await FriendCommand.ReplyPrivateMessageAsync(ex.RemindMessage); } public override async Task CheckInputAsync(BaseRelay relay) @@ -57,7 +57,7 @@ public override async Task CheckInputAsync(BaseRelay relay) } catch (ProcessException ex) { - await FriendCommand.ReplyFriendMessageAsync(ex.RemindMessage); + await FriendCommand.ReplyPrivateMessageAsync(ex.RemindMessage); return false; } }