mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
feat: add abuse handling
This commit is contained in:
parent
4bf60a47d7
commit
2dfb851246
17 changed files with 405 additions and 16 deletions
|
|
@ -101,6 +101,14 @@ public class ApplicationCommandProxiedMessage
|
|||
|
||||
public async Task PingMessageAuthor(InteractionContext ctx)
|
||||
{
|
||||
// if the command message was sent by a user account with bot usage disallowed, ignore it
|
||||
var abuse_log = await _repo.GetAbuseLogByAccount(ctx.User.Id);
|
||||
if (abuse_log != null && abuse_log.DenyBotUsage)
|
||||
{
|
||||
await ctx.Defer();
|
||||
return;
|
||||
}
|
||||
|
||||
var messageId = ctx.Event.Data!.TargetId!.Value;
|
||||
var msg = await ctx.Repository.GetFullMessage(messageId);
|
||||
if (msg == null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue