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