mirror of
https://github.com/ION606/custom_discordjs.git
synced 2026-05-14 22:26:54 +00:00
Started work on adding guilds
This commit is contained in:
@@ -2,6 +2,7 @@ const { exit } = require('process');
|
||||
const gateWayEvents = require('../gateway/dispatch.js');
|
||||
const { message } = require('../messages/message.js');
|
||||
const Interaction = require('../interactions/interaction.js');
|
||||
const Guild = require('../guilds/guild.js');
|
||||
|
||||
|
||||
/**
|
||||
@@ -16,8 +17,10 @@ module.exports = async function handleEvents(msgObj, token, id) {
|
||||
|
||||
if (op == 10) return resolve({op: op, heartBeat: msgObj["d"]["heartbeat_interval"]});
|
||||
|
||||
if (op == 0 && t == gateWayEvents.Ready) {
|
||||
resolve({op: op, t: t, config: msgObj["d"]["user_settings"], profile: msgObj["d"]["user"] });
|
||||
else if (op != 0) { resolve(false); }
|
||||
|
||||
else if (t == gateWayEvents.Ready) {
|
||||
resolve({op: op, t: t, config: msgObj["d"]["user_settings"], profile: msgObj["d"]["user"]}); //, guilds: msgObj["d"]["guilds"]
|
||||
}
|
||||
else if (t == gateWayEvents.MessageCreate) {
|
||||
const msg = new message(msgObj["d"], token);
|
||||
@@ -26,6 +29,9 @@ module.exports = async function handleEvents(msgObj, token, id) {
|
||||
else if (t == gateWayEvents.InteractionCreate) {
|
||||
resolve({op: op, t: t, interaction: new Interaction(msgObj["d"], token, id)});
|
||||
}
|
||||
else if (t == gateWayEvents.GuildCreate) {
|
||||
resolve({op: op, t: t, guild: new Guild(msgObj["d"], token)});
|
||||
}
|
||||
|
||||
else {
|
||||
// console.log(t);
|
||||
|
||||
Reference in New Issue
Block a user