make random commands consistent by adding missing ones

This commit is contained in:
dusk 2025-11-23 11:56:14 +00:00
parent 5c2c2dceff
commit d4c80aed00
No known key found for this signature in database
4 changed files with 31 additions and 27 deletions

View file

@ -223,11 +223,15 @@ public partial class CommandTree
flags.group
? ctx.Execute<Random>(GroupRandom, m => m.Group(ctx, ctx.System, flags.all, flags.show_embed))
: ctx.Execute<Random>(MemberRandom, m => m.Member(ctx, ctx.System, flags.all, flags.show_embed)),
Commands.RandomGroupSelf(_, var flags) => ctx.Execute<Random>(GroupRandom, m => m.Group(ctx, ctx.System, flags.all, flags.show_embed)),
Commands.RandomGroupMemberSelf(var param, var flags) => ctx.Execute<Random>(GroupMemberRandom, m => m.GroupMember(ctx, param.target, flags.all, flags.show_embed, flags)),
Commands.SystemRandom(var param, var flags) =>
flags.group
? ctx.Execute<Random>(GroupRandom, m => m.Group(ctx, param.target, flags.all, flags.show_embed))
: ctx.Execute<Random>(MemberRandom, m => m.Member(ctx, param.target, flags.all, flags.show_embed)),
Commands.GroupRandomMember(var param, var flags) => ctx.Execute<Random>(GroupMemberRandom, m => m.GroupMember(ctx, param.target, flags)),
Commands.SystemRandomGroup(var param, var flags) =>
ctx.Execute<Random>(GroupRandom, m => m.Group(ctx, param.target, flags.all, flags.show_embed)),
Commands.GroupRandomMember(var param, var flags) => ctx.Execute<Random>(GroupMemberRandom, m => m.GroupMember(ctx, param.target, flags.all, flags.show_embed, flags)),
Commands.SystemLink(var param, _) => ctx.Execute<SystemLink>(Link, m => m.LinkSystem(ctx, param.account)),
Commands.SystemUnlink(var param, var flags) => ctx.Execute<SystemLink>(Unlink, m => m.UnlinkAccount(ctx, param.account, flags.yes)),
Commands.SystemMembersListSelf(var param, var flags) => ctx.Execute<SystemList>(SystemList, m => m.MemberList(ctx, ctx.System, null, flags)),

View file

@ -82,7 +82,7 @@ public class Random
components: await _embeds.CreateGroupMessageComponents(ctx, target, groups.ToArray()[randInt], all));
}
public async Task GroupMember(Context ctx, PKGroup group, GroupRandomMemberFlags flags)
public async Task GroupMember(Context ctx, PKGroup group, bool all, bool show_embed, IHasListOptions flags)
{
ctx.CheckSystemPrivacy(group.System, group.ListPrivacy);
@ -96,7 +96,7 @@ public class Random
"This group has no members!"
+ (ctx.System?.Id == group.System ? " Please add at least one member to this group before using this command." : ""));
if (!flags.all)
if (!all)
members = members.Where(g => g.MemberVisibility == PrivacyLevel.Public);
else
ctx.CheckOwnGroup(group);
@ -112,7 +112,7 @@ public class Random
var randInt = randGen.Next(ms.Count);
if (flags.show_embed)
if (show_embed)
{
await ctx.Reply(
text: EmbedService.LEGACY_EMBED_WARNING,