fix: Cannot read properties of undefined (reading 'guildId')

TypeError: Cannot read properties of undefined (reading 'guildId')
    at module.exports [as INTERACTION_SUCCESS]
This commit is contained in:
March 7th 2022-10-11 17:19:57 +07:00
parent e8158ec85f
commit 3c2b4c9364
4 changed files with 4 additions and 3 deletions

View File

@ -14,7 +14,7 @@
## About ## About
<strong>Welcome to `discord.js-selfbot-v13@v2.8`, based on `discord.js@13.11`</strong> <strong>Welcome to `discord.js-selfbot-v13@v2.8`, based on `discord.js@13.12`</strong>
- discord.js-selfbot-v13 is a [Node.js](https://nodejs.org) module that allows user accounts to interact with the Discord API v9. - discord.js-selfbot-v13 is a [Node.js](https://nodejs.org) module that allows user accounts to interact with the Discord API v9.

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "discord.js-selfbot-v13", "name": "discord.js-selfbot-v13",
"version": "2.8.0", "version": "2.8.1",
"description": "A unofficial discord.js fork for creating selfbots [Based on discord.js v13]", "description": "A unofficial discord.js fork for creating selfbots [Based on discord.js v13]",
"main": "./src/index.js", "main": "./src/index.js",
"types": "./typings/index.d.ts", "types": "./typings/index.d.ts",

View File

@ -10,6 +10,7 @@ module.exports = (client, { d: data }) => {
client.emit(Events.INTERACTION_SUCCESS, data); client.emit(Events.INTERACTION_SUCCESS, data);
// Get channel data // Get channel data
const cache = client._interactionCache.get(data.nonce); const cache = client._interactionCache.get(data.nonce);
if (!cache) return;
const channel = cache.guildId const channel = cache.guildId
? client.guilds.cache.get(cache.guildId)?.channels.cache.get(cache.channelId) ? client.guilds.cache.get(cache.guildId)?.channels.cache.get(cache.channelId)
: client.channels.cache.get(cache.channelId); : client.channels.cache.get(cache.channelId);