Parsee/src/Commands/BanUser.c
LDA bb836789b2 [FIX/WIP] Plumbing, -Werror, death to hitmen
Suspend killers are now no more. Except the actual killers to be gone
eventually.
Plumbing is also very basic as of now, but it "works".
2024-07-05 20:24:15 +02:00

54 lines
1.1 KiB
C

#include <Routes.h>
#include <Cytoplasm/Memory.h>
#include <Cytoplasm/Str.h>
#include <Matrix.h>
#include <Bot.h>
#include <AS.h>
CommandHead(CmdBanUser, cmd, argp)
{
ParseeCmdArg *args = argp;
ParseeData *data = args->data;
HashMap *event = args->event;
char *user = HashMapGet(cmd->arguments, "user");
char *room = HashMapGet(cmd->arguments, "room");
BotInitialise();
if (!user || !room)
{
BotDestroy();
return;
}
ASBan(data->config, room, user);
ReplySprintf("Banning %s from '%s'...",
user, room
);
BotDestroy();
}
CommandHead(CmdNoFlyList, cmd, argp)
{
ParseeCmdArg *args = argp;
ParseeData *data = args->data;
HashMap *event = args->event;
char *user = HashMapGet(cmd->arguments, "user");
char *reason = HashMapGet(cmd->arguments, "reason");
BotInitialise();
if (!user)
{
BotDestroy();
return;
}
ReplySprintf("Banning %s for '%s'",
user, reason ? reason : "[no reason specified]"
);
ParseeGlobalBan(data, user, reason);
BotDestroy();
}