添加忽略复读QQ名单
This commit is contained in:
parent
810120be92
commit
4105592845
@ -589,7 +589,7 @@ namespace Milimoe.RainBOT.ListeningTask
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 随机复读
|
// 随机复读
|
||||||
if (GeneralSettings.IsRepeat && !Ignore.RepeatIgnore.Any(e.detail.Contains) && e.CheckThrow(GeneralSettings.PRepeat, out dice))
|
if (GeneralSettings.IsRepeat && !Ignore.RepeatIgnore.Any(e.detail.Contains) && !Ignore.RepeatQQIgnore.Contains(e.user_id) && e.CheckThrow(GeneralSettings.PRepeat, out dice))
|
||||||
{
|
{
|
||||||
// 出现了@at就直接触发复读,没有延迟
|
// 出现了@at就直接触发复读,没有延迟
|
||||||
int delay = e.message.Where(m => m.type == "at").Any() ? 0 : GeneralSettings.RepeatDelay[0] + new Random().Next(GeneralSettings.RepeatDelay[1] - GeneralSettings.RepeatDelay[0]);
|
int delay = e.message.Where(m => m.type == "at").Any() ? 0 : GeneralSettings.RepeatDelay[0] + new Random().Next(GeneralSettings.RepeatDelay[1] - GeneralSettings.RepeatDelay[0]);
|
||||||
|
|||||||
@ -13,6 +13,8 @@ namespace Milimoe.RainBOT.Settings
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static List<long> QQGroupIgnore { get; set; } = [];
|
public static List<long> QQGroupIgnore { get; set; } = [];
|
||||||
|
|
||||||
|
public static List<long> RepeatQQIgnore { get; set; } = [];
|
||||||
|
|
||||||
public static PluginConfig Configs { get; set; } = new("rainbot", "ignore");
|
public static PluginConfig Configs { get; set; } = new("rainbot", "ignore");
|
||||||
|
|
||||||
public static void InitIgnore()
|
public static void InitIgnore()
|
||||||
@ -31,6 +33,10 @@ namespace Milimoe.RainBOT.Settings
|
|||||||
{
|
{
|
||||||
QQGroupIgnore = (List<long>)value;
|
QQGroupIgnore = (List<long>)value;
|
||||||
}
|
}
|
||||||
|
if (configs.TryGetValue("RepeatQQIgnore", out value) && value != null)
|
||||||
|
{
|
||||||
|
RepeatQQIgnore = (List<long>)value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SaveConfig()
|
public static void SaveConfig()
|
||||||
@ -38,6 +44,7 @@ namespace Milimoe.RainBOT.Settings
|
|||||||
Configs.Add("RepeatIgnore", RepeatIgnore);
|
Configs.Add("RepeatIgnore", RepeatIgnore);
|
||||||
Configs.Add("CallBrotherQQIgnore", CallBrotherQQIgnore);
|
Configs.Add("CallBrotherQQIgnore", CallBrotherQQIgnore);
|
||||||
Configs.Add("QQGroupIgnore", QQGroupIgnore);
|
Configs.Add("QQGroupIgnore", QQGroupIgnore);
|
||||||
|
Configs.Add("RepeatQQIgnore", RepeatQQIgnore);
|
||||||
Configs.Save();
|
Configs.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,6 +73,13 @@ namespace Milimoe.RainBOT.Settings
|
|||||||
else QQGroupIgnore.Remove(lv);
|
else QQGroupIgnore.Remove(lv);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "repeatqqignore":
|
||||||
|
if (long.TryParse(strv, out lv))
|
||||||
|
{
|
||||||
|
if (isadd) RepeatQQIgnore.Add(lv);
|
||||||
|
else RepeatQQIgnore.Remove(lv);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -91,6 +105,9 @@ namespace Milimoe.RainBOT.Settings
|
|||||||
case "qqgroupignore":
|
case "qqgroupignore":
|
||||||
list = QQGroupIgnore.Select(x => x.ToString()).ToList();
|
list = QQGroupIgnore.Select(x => x.ToString()).ToList();
|
||||||
break;
|
break;
|
||||||
|
case "repeatqqignore":
|
||||||
|
list = RepeatQQIgnore.Select(x => x.ToString()).ToList();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
string msg = list.Count > 0 ? "列表" + group + "拥有以下成员:" + "\r\n" + string.Join("\r\n", list) : "此列表不存在或没有任何成员。";
|
string msg = list.Count > 0 ? "列表" + group + "拥有以下成员:" + "\r\n" + string.Join("\r\n", list) : "此列表不存在或没有任何成员。";
|
||||||
_ = isgroup ? Bot.SendGroupMessage(target, "显示列表成员", msg) : Bot.SendFriendMessage(target, "显示列表成员", msg);
|
_ = isgroup ? Bot.SendGroupMessage(target, "显示列表成员", msg) : Bot.SendFriendMessage(target, "显示列表成员", msg);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user