mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-09 23:37:54 +00:00
feat(bot): server config toggle for @silent proxied messages
This commit is contained in:
parent
2d36b8a7cc
commit
b88c1b7712
12 changed files with 50 additions and 3 deletions
|
|
@ -49,6 +49,13 @@ public class ServerConfig
|
|||
"disabled"
|
||||
));
|
||||
|
||||
items.Add(new(
|
||||
"suppress notifications",
|
||||
"Whether all proxied messages will have notifications suppressed (sent as `@silent` messages)",
|
||||
EnabledDisabled(ctx.GuildConfig!.SuppressNotifications),
|
||||
"disabled"
|
||||
));
|
||||
|
||||
items.Add(new(
|
||||
"log channel",
|
||||
"Channel to log proxied messages to",
|
||||
|
|
@ -426,4 +433,20 @@ public class ServerConfig
|
|||
await ctx.Repository.UpdateGuild(ctx.Guild.Id, new() { RequireSystemTag = newVal });
|
||||
await ctx.Reply($"System tags are now **{(newVal ? "required" : "not required")}** for PluralKit users in this server.");
|
||||
}
|
||||
|
||||
public async Task SuppressNotifications(Context ctx)
|
||||
{
|
||||
await ctx.CheckGuildContext().CheckAuthorPermission(PermissionSet.ManageGuild, "Manage Server");
|
||||
|
||||
if (!ctx.HasNext())
|
||||
{
|
||||
var msg = $"Suppressing notifications for proxied messages is currently **{EnabledDisabled(ctx.GuildConfig!.SuppressNotifications)}**.";
|
||||
await ctx.Reply(msg);
|
||||
return;
|
||||
}
|
||||
|
||||
var newVal = ctx.MatchToggle(false);
|
||||
await ctx.Repository.UpdateGuild(ctx.Guild.Id, new() { SuppressNotifications = newVal });
|
||||
await ctx.Reply($"Suppressing notifications for proxied messages is now {EnabledDisabled(newVal)}.");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue