Fix ch message ratelimit and sanitization
This commit is contained in:
parent
138982d54a
commit
5e9c367ea2
|
@ -4,7 +4,8 @@ export const ch: ServerEventListener<"ch"> = {
|
||||||
id: "ch",
|
id: "ch",
|
||||||
callback: (msg, socket) => {
|
callback: (msg, socket) => {
|
||||||
// Switch channel
|
// Switch channel
|
||||||
if (!msg._id) return;
|
if (!socket.rateLimits?.normal.ch.attempt()) return;
|
||||||
|
if (typeof msg._id !== "string") return;
|
||||||
|
|
||||||
// So technical and convoluted...
|
// So technical and convoluted...
|
||||||
socket.setChannel(msg._id, msg.set);
|
socket.setChannel(msg._id, msg.set);
|
||||||
|
|
Loading…
Reference in New Issue