Add unban message
This commit is contained in:
parent
5bf307482e
commit
06f6413945
|
@ -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);
|
||||||
|
}
|
||||||
|
};
|
|
@ -16,6 +16,7 @@ import { chset } from "./handlers/chset";
|
||||||
import { kickban } from "./handlers/kickban";
|
import { kickban } from "./handlers/kickban";
|
||||||
import { bye } from "./handlers/bye";
|
import { bye } from "./handlers/bye";
|
||||||
import { chown } from "./handlers/chown";
|
import { chown } from "./handlers/chown";
|
||||||
|
import { unban } from "./handlers/unban";
|
||||||
|
|
||||||
// Imagine not having an "addMany" function...
|
// Imagine not having an "addMany" function...
|
||||||
|
|
||||||
|
@ -45,6 +46,7 @@ EVENTGROUP_USER.addMany(
|
||||||
admin_message,
|
admin_message,
|
||||||
chset,
|
chset,
|
||||||
kickban,
|
kickban,
|
||||||
|
unban,
|
||||||
bye,
|
bye,
|
||||||
chown
|
chown
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue