mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
feat: add raw and pt formats to group pfp and banner
This commit is contained in:
parent
1ae6c8ff54
commit
b972a0238c
1 changed files with 21 additions and 14 deletions
|
|
@ -385,22 +385,29 @@ public class Groups
|
||||||
{
|
{
|
||||||
ctx.CheckSystemPrivacy(target.System, target.BannerPrivacy);
|
ctx.CheckSystemPrivacy(target.System, target.BannerPrivacy);
|
||||||
|
|
||||||
if ((target.BannerImage?.Trim() ?? "").Length > 0)
|
if ((target.Icon?.Trim() ?? "").Length > 0)
|
||||||
{
|
switch (ctx.MatchFormat())
|
||||||
var eb = new EmbedBuilder()
|
{
|
||||||
.Title("Group banner image")
|
case ReplyFormat.Raw:
|
||||||
.Image(new Embed.EmbedImage(target.BannerImage));
|
await ctx.Reply($"`{target.BannerImage.TryGetCleanCdnUrl()}`");
|
||||||
|
break;
|
||||||
if (target.System == ctx.System?.Id)
|
case ReplyFormat.Plaintext:
|
||||||
eb.Description($"To clear, use `pk;group {target.Reference(ctx)} banner clear`.");
|
var ebP = new EmbedBuilder()
|
||||||
|
.Description($"Showing banner for group {target.NameFor(ctx)}");
|
||||||
await ctx.Reply(embed: eb.Build());
|
await ctx.Reply(text: $"<{target.BannerImage.TryGetCleanCdnUrl()}>", embed: ebP.Build());
|
||||||
}
|
break;
|
||||||
|
default:
|
||||||
|
var ebS = new EmbedBuilder()
|
||||||
|
.Title("Group banner image")
|
||||||
|
.Image(new Embed.EmbedImage(target.BannerImage.TryGetCleanCdnUrl()));
|
||||||
|
if (target.System == ctx.System?.Id)
|
||||||
|
ebS.Description($"To clear, use `pk;group {target.Reference(ctx)} banner clear`.");
|
||||||
|
await ctx.Reply(embed: ebS.Build());
|
||||||
|
break;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
throw new PKSyntaxError(
|
throw new PKSyntaxError(
|
||||||
"This group does not have a banner image set. Set one by attaching an image to this command, or by passing an image URL.");
|
"This group does not have a banner image set. Set one by attaching an image to this command, or by passing an image URL or @mention.");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx.MatchClear())
|
if (ctx.MatchClear())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue