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
73568619b2
commit
0bbac2cf7e
1 changed files with 19 additions and 6 deletions
|
|
@ -137,12 +137,24 @@ public class Config
|
|||
ProxyMember.DefaultFormat
|
||||
));
|
||||
|
||||
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"
|
||||
));
|
||||
if (ctx.Guild == null)
|
||||
{
|
||||
items.Add(new(
|
||||
"Server Name Format",
|
||||
"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>(
|
||||
items.ToAsyncEnumerable(),
|
||||
|
|
@ -593,6 +605,7 @@ public class Config
|
|||
|
||||
public async Task ServerNameFormat(Context ctx)
|
||||
{
|
||||
ctx.CheckGuildContext();
|
||||
var clearFlag = ctx.MatchClear();
|
||||
var format = ctx.MatchFormat();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue