mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 21:05:10 +00:00
[ADD] Be able to set the power level of an admin
Taking over users!
This commit is contained in:
parent
c4b7d1b92a
commit
307fe6a341
3 changed files with 69 additions and 1 deletions
|
|
@ -5,6 +5,7 @@
|
|||
#include <Cytoplasm/Str.h>
|
||||
#include <Cytoplasm/Log.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <Matrix.h>
|
||||
#include <AS.h>
|
||||
|
|
@ -112,7 +113,7 @@ ParseeBotHandler(ParseeData *data, HashMap *event)
|
|||
if (cmd && StrEquals(cmd->command, BAN_USER))
|
||||
{
|
||||
char *user = HashMapGet(cmd->arguments, "user");
|
||||
char *room = HashMapGet(cmd->arguments, "user");
|
||||
char *room = HashMapGet(cmd->arguments, "room");
|
||||
char *msg;
|
||||
|
||||
if (!user || !room)
|
||||
|
|
@ -129,6 +130,25 @@ ParseeBotHandler(ParseeData *data, HashMap *event)
|
|||
));
|
||||
Free(msg);
|
||||
}
|
||||
else if (cmd && StrEquals(cmd->command, "set-pl"))
|
||||
{
|
||||
char *user = HashMapGet(cmd->arguments, "user");
|
||||
char *room = HashMapGet(cmd->arguments, "room");
|
||||
char *pl_str = HashMapGet(cmd->arguments, "pl");
|
||||
long pl = strtol(pl_str, NULL, 10);
|
||||
HashMap *map;
|
||||
|
||||
if (!user || !pl_str)
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
map = ASGetPL(data->config, room);
|
||||
JsonValueFree(JsonSet(
|
||||
map, JsonValueInteger(pl),
|
||||
2, "users", user
|
||||
));
|
||||
ASSetPL(data->config, room, map);
|
||||
}
|
||||
else if (cmd && StrEquals(cmd->command, LS_USERS))
|
||||
{
|
||||
DbRef *listed = DbLock(data->db, 1, "global_bans");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue