feat: add limit reach warning to pk;group new
This commit is contained in:
parent
b390c8ab62
commit
dec228d5bd
@ -68,6 +68,9 @@ namespace PluralKit.Bot
|
|||||||
.Field(new("Set the description", $"> pk;group **{newGroup.Reference()}** description **This is my new group, and here is the description!**"))
|
.Field(new("Set the description", $"> pk;group **{newGroup.Reference()}** description **This is my new group, and here is the description!**"))
|
||||||
.Field(new("Set the group icon", $"> pk;group **{newGroup.Reference()}** icon\n*(with an image attached)*"));
|
.Field(new("Set the group icon", $"> pk;group **{newGroup.Reference()}** icon\n*(with an image attached)*"));
|
||||||
await ctx.Reply($"{Emojis.Success} Group created!", eb.Build());
|
await ctx.Reply($"{Emojis.Success} Group created!", eb.Build());
|
||||||
|
|
||||||
|
if (existingGroupCount >= Limits.WarnThreshold(groupLimit))
|
||||||
|
await ctx.Reply($"{Emojis.Warn} You are approaching the per-system group limit ({existingGroupCount} / {groupLimit} members). Please review your group list for unused or duplicate groups.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task RenameGroup(Context ctx, PKGroup target)
|
public async Task RenameGroup(Context ctx, PKGroup target)
|
||||||
|
@ -89,7 +89,7 @@ namespace PluralKit.Bot
|
|||||||
await ctx.Reply($"{Emojis.Note} Note that this member's name contains spaces. You will need to surround it with \"double quotes\" when using commands referring to it, or just use the member's 5-character ID (which is `{member.Hid}`).");
|
await ctx.Reply($"{Emojis.Note} Note that this member's name contains spaces. You will need to surround it with \"double quotes\" when using commands referring to it, or just use the member's 5-character ID (which is `{member.Hid}`).");
|
||||||
if (memberCount >= memberLimit)
|
if (memberCount >= memberLimit)
|
||||||
await ctx.Reply($"{Emojis.Warn} You have reached the per-system member limit ({memberLimit}). You will be unable to create additional members until existing members are deleted.");
|
await ctx.Reply($"{Emojis.Warn} You have reached the per-system member limit ({memberLimit}). You will be unable to create additional members until existing members are deleted.");
|
||||||
else if (memberCount >= Limits.MaxMembersWarnThreshold(memberLimit))
|
else if (memberCount >= Limits.WarnThreshold(memberLimit))
|
||||||
await ctx.Reply($"{Emojis.Warn} You are approaching the per-system member limit ({memberCount} / {memberLimit} members). Please review your member list for unused or duplicate members.");
|
await ctx.Reply($"{Emojis.Warn} You are approaching the per-system member limit ({memberCount} / {memberLimit} members). Please review your member list for unused or duplicate members.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,8 +7,8 @@ namespace PluralKit.Core
|
|||||||
public static readonly int MaxSystemNameLength = 100;
|
public static readonly int MaxSystemNameLength = 100;
|
||||||
public static readonly int MaxSystemTagLength = MaxProxyNameLength - 1;
|
public static readonly int MaxSystemTagLength = MaxProxyNameLength - 1;
|
||||||
public static readonly int MaxMemberCount = 1000;
|
public static readonly int MaxMemberCount = 1000;
|
||||||
public static int MaxMembersWarnThreshold(int memberLimit) => memberLimit - 50;
|
|
||||||
public static readonly int MaxGroupCount = 250;
|
public static readonly int MaxGroupCount = 250;
|
||||||
|
public static int WarnThreshold(int limit) => limit - 50;
|
||||||
public static readonly int MaxDescriptionLength = 1000;
|
public static readonly int MaxDescriptionLength = 1000;
|
||||||
public static readonly int MaxProxyTagLength = 100;
|
public static readonly int MaxProxyTagLength = 100;
|
||||||
public static readonly int MaxSwitchMemberCount = 150;
|
public static readonly int MaxSwitchMemberCount = 150;
|
||||||
|
Loading…
Reference in New Issue
Block a user