mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-11 08:10:10 +00:00
feat(bot): basic webhook username templating
This commit is contained in:
parent
87196e3297
commit
614131265b
16 changed files with 78 additions and 14 deletions
|
|
@ -130,6 +130,13 @@ public class Config
|
|||
"disabled"
|
||||
));
|
||||
|
||||
items.Add(new(
|
||||
"Name Format",
|
||||
"Format string used to display a member's name https://pluralkit.me/guide/#setting-a-custom-name-format",
|
||||
ctx.Config.NameFormat,
|
||||
ProxyMember.DefaultFormat
|
||||
));
|
||||
|
||||
await ctx.Paginate<PaginatedConfigItem>(
|
||||
items.ToAsyncEnumerable(),
|
||||
items.Count,
|
||||
|
|
@ -558,6 +565,19 @@ public class Config
|
|||
await ctx.Reply($"Logging a switch every time a proxy tag is used is now {EnabledDisabled(newVal)}.");
|
||||
}
|
||||
|
||||
public async Task NameFormat(Context ctx)
|
||||
{
|
||||
if (!ctx.HasNext())
|
||||
{
|
||||
await ctx.Reply($"Member names are currently formatted as `{ctx.Config.NameFormat ?? ProxyMember.DefaultFormat}`");
|
||||
return;
|
||||
}
|
||||
|
||||
var formatString = ctx.RemainderOrNull();
|
||||
await ctx.Repository.UpdateSystemConfig(ctx.System.Id, new() { NameFormat = formatString });
|
||||
await ctx.Reply($"Member names are now formatted as `{formatString}`");
|
||||
}
|
||||
|
||||
public Task LimitUpdate(Context ctx)
|
||||
{
|
||||
throw new PKError("You cannot update your own member or group limits. If you need a limit update, please join the " +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue