Add unban message

This commit is contained in:
Hri7566 2024-07-13 00:30:40 -04:00
parent 5bf307482e
commit 06f6413945
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,14 @@
import { ServerEventListener } from "../../../../util/types";
export const unban: ServerEventListener<"unban"> = {
id: "unban",
callback: (msg, socket) => {
// Kickbanning someone from channel
if (typeof msg._id !== "string") return;
if (socket.rateLimits)
if (!socket.rateLimits.normal.unban.attempt()) return;
socket.unban(msg._id);
}
};

View File

@ -16,6 +16,7 @@ import { chset } from "./handlers/chset";
import { kickban } from "./handlers/kickban";
import { bye } from "./handlers/bye";
import { chown } from "./handlers/chown";
import { unban } from "./handlers/unban";
// Imagine not having an "addMany" function...
@ -45,6 +46,7 @@ EVENTGROUP_USER.addMany(
admin_message,
chset,
kickban,
unban,
bye,
chown
);