Merge pull request #311 from Spectralitree/rawdisplaynames
Add raw display name printing
This commit is contained in:
commit
d719303053
@ -104,15 +104,30 @@ namespace PluralKit.Bot
|
||||
else if (!ctx.HasNext())
|
||||
{
|
||||
// No perms check, display name isn't covered by member privacy
|
||||
if (ctx.MatchFlag("r", "raw"))
|
||||
{
|
||||
if (target.DisplayName == null)
|
||||
{
|
||||
if (ctx.System?.Id == target.System)
|
||||
await ctx.Reply($"This group does not have a display name set. To set one, type `pk;group {target.Reference()} displayname <display name>`.");
|
||||
else
|
||||
await ctx.Reply("This group does not have a display name set.");
|
||||
}
|
||||
else
|
||||
await ctx.Reply($"```\n{target.DisplayName}\n```");
|
||||
}
|
||||
else
|
||||
{
|
||||
var eb = new EmbedBuilder()
|
||||
.Field(new("Name", target.Name))
|
||||
.Field(new("Display Name", target.DisplayName ?? "*(none)*"));
|
||||
|
||||
if (ctx.System?.Id == target.System)
|
||||
eb.Description($"To change display name, type `pk;group {target.Reference()} displayname <display name>`.\nTo clear it, type `pk;group {target.Reference()} displayname -clear`.");
|
||||
eb.Description($"To change display name, type `pk;group {target.Reference()} displayname <display name>`.\nTo clear it, type `pk;group {target.Reference()} displayname -clear`.\nTo print the raw display name, type `pk;group {target.Reference()} displayname -raw`.");
|
||||
|
||||
await ctx.Reply(embed: eb.Build());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ctx.CheckOwnGroup(target);
|
||||
|
@ -115,8 +115,10 @@ namespace PluralKit.Bot
|
||||
await ctx.Reply($"This member does not have pronouns set. To set some, type `pk;member {target.Reference()} pronouns <pronouns>`.");
|
||||
else
|
||||
await ctx.Reply("This member does not have pronouns set.");
|
||||
else if (ctx.MatchFlag("r", "raw"))
|
||||
await ctx.Reply($"```\n{target.Pronouns}\n```");
|
||||
else
|
||||
await ctx.Reply($"**{target.NameFor(ctx)}**'s pronouns are **{target.Pronouns}**."
|
||||
await ctx.Reply($"**{target.NameFor(ctx)}**'s pronouns are **{target.Pronouns}**.\nTo print the pronouns with formatting, type `pk;member {target.Reference()} pronouns -raw`."
|
||||
+ (ctx.System?.Id == target.System ? $" To clear them, type `pk;member {target.Reference()} pronouns -clear`." : ""));
|
||||
}
|
||||
else
|
||||
@ -284,11 +286,26 @@ namespace PluralKit.Bot
|
||||
else if (!ctx.HasNext())
|
||||
{
|
||||
// No perms check, display name isn't covered by member privacy
|
||||
if (ctx.MatchFlag("r", "raw"))
|
||||
{
|
||||
if (target.DisplayName == null)
|
||||
{
|
||||
if (ctx.System?.Id == target.System)
|
||||
await ctx.Reply($"This member does not have a display name set. To set one, type `pk;member {target.Reference()} displayname <display name>`.");
|
||||
else
|
||||
await ctx.Reply("This member does not have a display name set.");
|
||||
}
|
||||
else
|
||||
await ctx.Reply($"```\n{target.DisplayName}\n```");
|
||||
}
|
||||
else
|
||||
{
|
||||
var eb = await CreateMemberNameInfoEmbed(ctx, target);
|
||||
if (ctx.System?.Id == target.System)
|
||||
eb.Description($"To change display name, type `pk;member {target.Reference()} displayname <display name>`.\nTo clear it, type `pk;member {target.Reference()} displayname -clear`.");
|
||||
eb.Description($"To change display name, type `pk;member {target.Reference()} displayname <display name>`.\nTo clear it, type `pk;member {target.Reference()} displayname -clear`.\nTo print the raw display name, type `pk;member {target.Reference()} displayname -raw`.");
|
||||
await ctx.Reply(embed: eb.Build());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ctx.CheckOwnMember(target);
|
||||
@ -320,12 +337,29 @@ namespace PluralKit.Bot
|
||||
}
|
||||
else if (!ctx.HasNext())
|
||||
{
|
||||
// No perms check, server name isn't covered by member privacy
|
||||
// No perms check, display name isn't covered by member privacy
|
||||
if (ctx.MatchFlag("r", "raw"))
|
||||
{
|
||||
MemberGuildSettings memberGuildConfig = await _db.Execute(c => _repo.GetMemberGuild(c, ctx.Guild.Id, target.Id));
|
||||
|
||||
if (memberGuildConfig.DisplayName == null)
|
||||
{
|
||||
if (ctx.System?.Id == target.System)
|
||||
await ctx.Reply($"This member does not have a server name set. To set one, type `pk;member {target.Reference()} servername <server name>`.");
|
||||
else
|
||||
await ctx.Reply("This member does not have a server name set.");
|
||||
}
|
||||
else
|
||||
await ctx.Reply($"```\n{memberGuildConfig.DisplayName}\n```");
|
||||
}
|
||||
else
|
||||
{
|
||||
var eb = await CreateMemberNameInfoEmbed(ctx, target);
|
||||
if (ctx.System?.Id == target.System)
|
||||
eb.Description($"To change server name, type `pk;member {target.Reference()} servername <server name>`.\nTo clear it, type `pk;member {target.Reference()} servername -clear`.");
|
||||
eb.Description($"To change server name, type `pk;member {target.Reference()} servername <server name>`.\nTo clear it, type `pk;member {target.Reference()} servername -clear`.\nTo print the raw server name, type `pk;member {target.Reference()} servername -raw`.");
|
||||
await ctx.Reply(embed: eb.Build());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ctx.CheckOwnMember(target);
|
||||
|
Loading…
Reference in New Issue
Block a user