mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-23 21:52:45 -05:00
...
This commit is contained in:
1 parent
e529114c31
commit
6ba7b33a05
4 files changed
+123
-15
No files matched your search
@@ -9,6 +9,9 @@ import { REQUIRED_BOT_PERMISSIONS } from "./MessageHandler.mjs";
|
||||
import { cleanId } from "./Utils.mjs";
|
||||
import { iterateVoiceStates, hasHumansInChannel, getChannelsWithHumans } from "./constants/VoiceStateResolver.mjs";
|
||||
|
||||
const RAW_GATEWAY_INTEREST =
|
||||
/"(?:t|op)":\s*(?:"(?:VOICE_STATE_UPDATE|VOICE_SERVER_UPDATE|GUILD_CREATE|READY|RESUMED)"|(?:7|9|10|12)\b)/;
|
||||
|
||||
/** @class GatewayHandler @description Handles all Discord gateway events relevant to voice state tracking, 24/7 mode, boot recovery, presence rotation, and permission checks. Key responsibilities include voice state cache seeding and updates, bot move-away detection with 24/7 rejoin scheduling, boot recovery with sequential rejoin of 24/7 channels, inactivity timer management on human join/leave, and guild create/delete handling with startup grace period. */
|
||||
export class GatewayHandler {
|
||||
/**
|
||||
@@ -366,6 +369,7 @@ export class GatewayHandler {
|
||||
if (wsObj && wsObj !== remix._rawGatewayWsObj) {
|
||||
remix._rawGatewayHandler = (data) => {
|
||||
try {
|
||||
if (typeof data === "string" && !RAW_GATEWAY_INTEREST.test(data)) return;
|
||||
const payload = typeof data === "string" ? JSON.parse(data) : data;
|
||||
|
||||
if (payload?.op === GatewayOpcodes.GatewayError || payload?.op === 12) {
|
||||
|
||||
@@ -211,6 +211,7 @@ export default class Player extends EventEmitter {
|
||||
super();
|
||||
|
||||
this.queue = new Queue();
|
||||
this.queue.on("queue", (...args) => this.emit("queue", ...args));
|
||||
this.client = opts.client;
|
||||
this.config = opts.config ?? {};
|
||||
this.settings = opts.settings ?? null;
|
||||
|
||||
Reference in new issue
Block a user