Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新人群主群变更 #22

Merged
merged 2 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,26 @@ internal class HardcodedProvider : INewbieInfoProvider
97512825, // a9
};

private const long NewbieGroupId = 595985887;
private const long NewbieGroup2Id = 928936255;
private const long LegacyNewbieGroupId = 595985887; // 即将删除
private const long NewbieGroupId = 231094840;
private const long AdvancedGroupId = 928936255;
private const long HyperGroupId = 281624271;
private const long GraveyardGroupId = 293129929;

public static INewbieInfoProvider GetProvider() => new HardcodedProvider();

public string Name => "ignore";

public IEnumerable<long> MonitoredGroups { get; } = new List<long>
{
LegacyNewbieGroupId,
NewbieGroupId,
NewbieGroup2Id,
AdvancedGroupId
}.AsReadOnly();

#pragma warning disable CS1998
public async Task<bool> ShouldIgnoreAsync(long qq) => IgnoreList.Contains(qq);
public async Task<bool> ShouldIgnorePerformanceAsync(long group, long qq) => group == NewbieGroupId ? IgnorePerformanceListBase.Contains(qq) : false;
public async Task<bool> ShouldIgnorePerformanceAsync(long group, long qq) => (group == NewbieGroupId || group == LegacyNewbieGroupId) ? IgnorePerformanceListBase.Contains(qq) : false;
#pragma warning restore CS1998
public double? PerformanceLimit(long group) => group == NewbieGroupId ? (double?)2500 : null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public partial class NotifyOnJoinRequest : Service, IMessageCommand
#endif
private static readonly IReadOnlyDictionary<long, double?> ManagedGroups = new Dictionary<long, double?>
{
[595985887] = 2800,
[595985887] = 2800, // 即将删除
[231094840] = 2800,
[928936255] = 4300,
[281624271] = 5800,
[758120648] = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public class 统计新人群成员 : Service, IMessageCommand

private static readonly Dictionary<string, (long, int, int)> s_groups = new()
{
{ "新人群", (595985887, 3000, 190) },
{ "旧新人群", (595985887, 3000, 190) },
{ "新人群", (231094840, 3000, 190) },
{ "进阶群", (928936255, 4500, 280) },
{ "高阶群", (281624271, 6000, 360) },
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public async Task ProcessAsync(Sisters.WudiLib.Posts.Message message, HttpApiCli
}
catch (ExceptionPlus)
{
await api.SendMessageAsync(message.Endpoint, "查询PP+失败。");
await api.SendMessageAsync(message.Endpoint, "查询 PP+ 失败。");
return;
}
}
Expand All @@ -165,7 +165,7 @@ public bool ShouldResponse(Sisters.WudiLib.Posts.Message message)
{
if (!message.Content.IsPlaintext)
return false;
if (message is GroupMessage g && g.GroupId == 595985887)
if (message is GroupMessage g && (g.GroupId == 595985887 || g.GroupId == 231094840))
return false; // ignored in newbie group.
string text = message.Content.Text.Trim();
if (text.StartsWith("+", StringComparison.Ordinal))
Expand Down
2 changes: 1 addition & 1 deletion Bleatingsheep.NewHydrant.Bot.Public/Osu/Plus/PlusPlus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public async Task ProcessAsync(MessageContext context, HttpApiClient api)

public bool ShouldResponse(MessageContext context)
{
if (context is GroupMessage g && g.GroupId == 595985887)
if (context is GroupMessage g && (g.GroupId == 595985887 || g.GroupId == 231094840))
return false; // ignored in newbie group.
return context.Content.TryGetPlainText(out var text) && text == "++";
}
Expand Down
2 changes: 1 addition & 1 deletion Bleatingsheep.NewHydrant.Bot.Public/Osu/PpTth2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ await page.SetViewportAsync(new ViewPortOptions

public bool ShouldResponse(MessageContext message)
{
if (message is GroupMessage g && g.GroupId == 595985887)
if (message is GroupMessage g && (g.GroupId == 595985887 || g.GroupId == 231094840))
return false; // ignored in newbie group.
if (message.Content.TryGetPlainText(out string text))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,6 @@ private async Task<bool> TrySendImage(Endpoint endpoint, HttpApiClient api, int
private record struct ImageCacheEntry(bool IsSuccess, byte[] Data);

public bool ShouldResponse(MessageContext context)
=> RegexCommand(s_regex, context.Content) && (!(context is GroupMessage g) || !(g.GroupId == 595985887));
=> RegexCommand(s_regex, context.Content) && (!(context is GroupMessage g) || !(g.GroupId == 595985887 || g.GroupId == 231094840));
}
}
Loading