Merge pull request #250 from dev-kittens/tweak/avatar-url-flag

Tweak/avatar url flag
This commit is contained in:
Astrid 2020-11-15 13:15:02 +01:00 committed by GitHub
commit 80bdb9795d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View File

@ -65,6 +65,8 @@ namespace PluralKit.Bot
p.IncludeMessageCount = true;
if (ctx.MatchFlag("with-created", "wc"))
p.IncludeCreated = true;
if (ctx.MatchFlag("with-avatar", "with-image", "wa", "wi", "ia", "ii", "img"))
p.IncludeAvatar = true;
// Always show the sort property, too
if (p.SortProperty == SortProperty.LastSwitch) p.IncludeLastSwitch = true;
@ -151,6 +153,9 @@ namespace PluralKit.Bot
if (opts.IncludeCreated && m.MetadataPrivacy.TryGet(lookupCtx, m.Created, out var created))
profile.Append($"\n**Created on:** {created.FormatZoned(zone)}");
if (opts.IncludeAvatar)
profile.Append($"\n**Avatar URL:** {m.AvatarUrl}");
if (m.DescriptionFor(lookupCtx) is {} desc)
profile.Append($"\n\n{desc}");

View File

@ -25,6 +25,7 @@ namespace PluralKit.Bot
public bool IncludeLastSwitch { get; set; }
public bool IncludeLastMessage { get; set; }
public bool IncludeCreated { get; set; }
public bool IncludeAvatar { get; set; }
public string CreateFilterString()
{

View File

@ -60,4 +60,5 @@ You cannot look up private members of another system.
|-with-last-switch|-with-last-fronted, -with-last-front, -wls, -wlf|Show each member's last switch date|
|-with-last-message|-with-last-proxy, -wlm, -wlp|Show each member's last message date|
|-with-message-count|-wmc|Show each member's message count|
|-with-created|-wc|Show each member's creation date|
|-with-created|-wc|Show each member's creation date|
|-with-avatar|-wa, -wi, -ia, -ii, -img|Show each member's avatar URL|