mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix: allow servernameformat to be run in DMs
This commit is contained in:
parent
ec6cbb2a64
commit
c0bc2163f5
1 changed files with 19 additions and 6 deletions
|
|
@ -137,12 +137,24 @@ public class Config
|
||||||
ProxyMember.DefaultFormat
|
ProxyMember.DefaultFormat
|
||||||
));
|
));
|
||||||
|
|
||||||
items.Add(new(
|
if (ctx.Guild == null)
|
||||||
"Server Name Format",
|
{
|
||||||
"Format string used to display a member's name in the current server",
|
items.Add(new(
|
||||||
(await ctx.Repository.GetSystemGuild(ctx.Guild.Id, ctx.System.Id)).NameFormat ?? "none set",
|
"Server Name Format",
|
||||||
"none set"
|
"Format string used to display a member's name in the current server",
|
||||||
));
|
"only available in servers",
|
||||||
|
"only available in servers"
|
||||||
|
));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
items.Add(new(
|
||||||
|
"Server Name Format",
|
||||||
|
"Format string used to display a member's name in the current server",
|
||||||
|
(await ctx.Repository.GetSystemGuild(ctx.Guild.Id, ctx.System.Id)).NameFormat ?? "none set",
|
||||||
|
"none set"
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
await ctx.Paginate<PaginatedConfigItem>(
|
await ctx.Paginate<PaginatedConfigItem>(
|
||||||
items.ToAsyncEnumerable(),
|
items.ToAsyncEnumerable(),
|
||||||
|
|
@ -593,6 +605,7 @@ public class Config
|
||||||
|
|
||||||
public async Task ServerNameFormat(Context ctx)
|
public async Task ServerNameFormat(Context ctx)
|
||||||
{
|
{
|
||||||
|
ctx.CheckGuildContext();
|
||||||
var clearFlag = ctx.MatchClear();
|
var clearFlag = ctx.MatchClear();
|
||||||
var format = ctx.MatchFormat();
|
var format = ctx.MatchFormat();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue