use of io.discloader.discloader.entity.sendable.VoiceStateUpdate in project DiscLoader by R3alCl0ud.
the class VoiceConnection method sendStateUpdate.
private void sendStateUpdate(IVoiceChannel channel) {
this.stateUpdated = false;
VoiceStateUpdate d = new VoiceStateUpdate(getGuild(), channel, false, false);
getLoader().socket.send(new Packet(4, d));
}
use of io.discloader.discloader.entity.sendable.VoiceStateUpdate in project DiscLoader by R3alCl0ud.
the class Gateway method handleQueue.
public void handleQueue() {
if (!ws.isOpen() || remaining == 0 || queue.isEmpty())
return;
Object raw_payload = queue.get(0);
// loader.em
remaining--;
String payload = "";
if (raw_payload instanceof JSONObject) {
payload = raw_payload.toString();
} else {
if (raw_payload instanceof Packet && ((Packet) raw_payload).d instanceof VoiceStateUpdate) {
payload = gson.toJson(raw_payload);
} else {
payload = DLUtil.gson.toJson(raw_payload);
}
}
logger.info("Sending: " + payload);
ws.sendText(payload);
queue.remove(raw_payload);
handleQueue();
}
Aggregations