fixed guild channels and interactions

This commit is contained in:
ION606
2023-04-02 09:49:47 -04:00
parent f1415a9840
commit 658b45feee
10 changed files with 445 additions and 22 deletions
+7 -1
View File
@@ -7,6 +7,7 @@ import { EventEmitter } from 'events';
import axios from 'axios';
import { exit } from 'process';
import Guild from '../guilds/Guild.js';
import user from '../messages/User.js';
@@ -158,7 +159,12 @@ export class Client extends EventEmitter {
}
}
else if (response.t == gateWayEvents.InteractionCreate) {
if (data["d"]["user"]["id"] != this.user_profile.id) {
if (data["d"]["member"] && data["d"]["member"]["id"] != this.user_profile.id) {
response.interaction.guild = this.guilds.get(response.interaction.guild_id);
response.interaction.user = new user(data["d"]["member"]["user"]);
this.interactionRecieved(response.interaction);
}
else if (data["d"]["user"]["id"] != this.user_profile.id) {
this.interactionRecieved(response.interaction);
}
}