mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
feat: add raw and pt format to system servericon
This commit is contained in:
parent
c5e56781f0
commit
0552335d1d
1 changed files with 19 additions and 10 deletions
|
|
@ -648,19 +648,28 @@ public class SystemEdit
|
||||||
var settings = await ctx.Repository.GetSystemGuild(ctx.Guild.Id, target.Id);
|
var settings = await ctx.Repository.GetSystemGuild(ctx.Guild.Id, target.Id);
|
||||||
|
|
||||||
if ((settings.AvatarUrl?.Trim() ?? "").Length > 0)
|
if ((settings.AvatarUrl?.Trim() ?? "").Length > 0)
|
||||||
{
|
switch (ctx.MatchFormat())
|
||||||
var eb = new EmbedBuilder()
|
{
|
||||||
.Title("System server icon")
|
case ReplyFormat.Raw:
|
||||||
.Image(new Embed.EmbedImage(settings.AvatarUrl.TryGetCleanCdnUrl()));
|
await ctx.Reply($"`{settings.AvatarUrl.TryGetCleanCdnUrl()}`");
|
||||||
if (target.Id == ctx.System?.Id)
|
break;
|
||||||
eb.Description("To clear, use `pk;system servericon clear`.");
|
case ReplyFormat.Plaintext:
|
||||||
await ctx.Reply(embed: eb.Build());
|
var ebP = new EmbedBuilder()
|
||||||
}
|
.Description($"Showing icon for system {target.NameFor(ctx)}");
|
||||||
|
await ctx.Reply(text: $"<{settings.AvatarUrl.TryGetCleanCdnUrl()}>", embed: ebP.Build());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
var ebS = new EmbedBuilder()
|
||||||
|
.Title("System server icon")
|
||||||
|
.Image(new Embed.EmbedImage(settings.AvatarUrl.TryGetCleanCdnUrl()));
|
||||||
|
if (target.Id == ctx.System?.Id)
|
||||||
|
ebS.Description("To clear, use `pk;system servericon clear`.");
|
||||||
|
await ctx.Reply(embed: ebS.Build());
|
||||||
|
break;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
throw new PKSyntaxError(
|
throw new PKSyntaxError(
|
||||||
"This system does not have a icon specific to this server. Set one by attaching an image to this command, or by passing an image URL or @mention.");
|
"This system does not have a icon specific to this server. Set one by attaching an image to this command, or by passing an image URL or @mention.");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.CheckGuildContext();
|
ctx.CheckGuildContext();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue