修改为long,添加判断

This commit is contained in:
milimoe 2024-07-01 20:38:44 +08:00
parent 5024755e17
commit dc11e3de53
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E
2 changed files with 6 additions and 6 deletions

View File

@ -557,7 +557,7 @@ namespace Milimoe.RainBOT.ListeningTask
}
// 随机叫哥
if (GeneralSettings.IsCallBrother && e.CheckThrow(GeneralSettings.PCallBrother, out dice))
if (GeneralSettings.IsCallBrother && !Ignore.CallBrotherQQIgnore.Contains(e.user_id) && e.CheckThrow(GeneralSettings.PCallBrother, out dice))
{
int delay = GeneralSettings.RepeatDelay[0] + new Random().Next(GeneralSettings.RepeatDelay[1]);
Bot.ColorfulCheckPass(sender, "随机叫哥", dice, GeneralSettings.PCallBrother, delay);

View File

@ -6,7 +6,7 @@ namespace Milimoe.RainBOT.Settings
{
public static HashSet<string> RepeatIgnore { get; set; } = [];
public static List<string> CallBrotherQQIgnore { get; set; } = [];
public static List<long> CallBrotherQQIgnore { get; set; } = [];
/// <summary>
/// 这个属性暂时没用到 标记一下
@ -25,7 +25,7 @@ namespace Milimoe.RainBOT.Settings
}
if (configs.TryGetValue("CallBrotherQQIgnore", out value) && value != null)
{
CallBrotherQQIgnore = new List<string>((List<string>)value);
CallBrotherQQIgnore = new List<long>((List<long>)value);
}
if (configs.TryGetValue("QQGroupIgnore", out value) && value != null)
{
@ -52,8 +52,8 @@ namespace Milimoe.RainBOT.Settings
else RepeatIgnore.Remove((string)value);
break;
case "callbrotherqqignore":
if (isadd) CallBrotherQQIgnore.Add((string)value);
else CallBrotherQQIgnore.Remove((string)value);
if (isadd) CallBrotherQQIgnore.Add((long)value);
else CallBrotherQQIgnore.Remove((long)value);
break;
case "qqgroupignore":
if (isadd) QQGroupIgnore.Add((long)value);
@ -79,7 +79,7 @@ namespace Milimoe.RainBOT.Settings
list = [..RepeatIgnore];
break;
case "callbrotherqqignore":
list = CallBrotherQQIgnore;
list = CallBrotherQQIgnore.Select(x => x.ToString()).ToList();
break;
case "qqgroupignore":
list = QQGroupIgnore.Select(x => x.ToString()).ToList();