mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-08 14:57:54 +00:00
feat(bot): allow querying legacy embeds with -se flag
This commit is contained in:
parent
41478f0fef
commit
0afcee108e
4 changed files with 119 additions and 0 deletions
|
|
@ -520,6 +520,12 @@ public class Groups
|
|||
public async Task ShowGroupCard(Context ctx, PKGroup target)
|
||||
{
|
||||
var system = await GetGroupSystem(ctx, target);
|
||||
if (ctx.MatchFlag("show-embed", "se"))
|
||||
{
|
||||
await ctx.Reply(text: EmbedService.LEGACY_EMBED_WARNING, embed: await _embeds.CreateGroupEmbed(ctx, system, target));
|
||||
return;
|
||||
}
|
||||
|
||||
await ctx.Reply(components: await _embeds.CreateGroupMessageComponents(ctx, system, target));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -122,6 +122,14 @@ public class Member
|
|||
public async Task ViewMember(Context ctx, PKMember target)
|
||||
{
|
||||
var system = await ctx.Repository.GetSystem(target.System);
|
||||
if (ctx.MatchFlag("show-embed", "se"))
|
||||
{
|
||||
await ctx.Reply(
|
||||
text: EmbedService.LEGACY_EMBED_WARNING,
|
||||
embed: await _embeds.CreateMemberEmbed(system, target, ctx.Guild, ctx.Config, ctx.LookupContextFor(system.Id), ctx.Zone));
|
||||
return;
|
||||
}
|
||||
|
||||
await ctx.Reply(
|
||||
components: await _embeds.CreateMemberMessageComponents(system, target, ctx.Guild, ctx.Config, ctx.LookupContextFor(system.Id), ctx.Zone));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,11 @@ public class System
|
|||
public async Task Query(Context ctx, PKSystem system)
|
||||
{
|
||||
if (system == null) throw Errors.NoSystemError(ctx.DefaultPrefix);
|
||||
if (ctx.MatchFlag("show-embed", "se"))
|
||||
{
|
||||
await ctx.Reply(text: EmbedService.LEGACY_EMBED_WARNING, embed: await _embeds.CreateSystemEmbed(ctx, system, ctx.LookupContextFor(system.Id)));
|
||||
return;
|
||||
}
|
||||
|
||||
await ctx.Reply(components: await _embeds.CreateSystemMessageComponents(ctx, system, ctx.LookupContextFor(system.Id)));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue