Professor
Professor
DIAdiscord.js - Imagine an app
Created by Professor on 8/20/2023 in #djs-questions
shard error
Error [ShardingReadyDied]: Shard 0's process exited before its Client became ready.
at Shard.onDeath (C:\code\node_modules\discord.js\src\sharding\Shard.js:171:16)
at Object.onceWrapper (node:events:629:26)
at Shard.emit (node:events:514:28)
at Shard._handleExit (C:\code\node_modules\discord.js\src\sharding\Shard.js:421:10)
at ChildProcess.emit (node:events:514:28)
at ChildProcess._handle.onexit (node:internal/child_process:291:12) {
code: 'ShardingReadyDied'
}
Error [ShardingReadyDied]: Shard 0's process exited before its Client became ready.
at Shard.onDeath (C:\code\node_modules\discord.js\src\sharding\Shard.js:171:16)
at Object.onceWrapper (node:events:629:26)
at Shard.emit (node:events:514:28)
at Shard._handleExit (C:\code\node_modules\discord.js\src\sharding\Shard.js:421:10)
at ChildProcess.emit (node:events:514:28)
at ChildProcess._handle.onexit (node:internal/child_process:291:12) {
code: 'ShardingReadyDied'
}
2 replies
DIAdiscord.js - Imagine an app
Created by Professor on 7/25/2023 in #djs-questions
when user get focusedValue in discord.js how to get which choice did user select in autocomplete
when user get focusedValue in discord.js how to get which choice did user select in autocomplete
3 replies
DIAdiscord.js - Imagine an app
Created by Professor on 7/5/2023 in #djs-questions
Shards Error
The Console Is loading Two Times And When i Used Some Command Like "$ping" Bot Is Replying Two Times And My Console Getting An Error Like
[ AntiCrashDetection ]:- Unhandled Rejection/Catch
Response {
[Symbol(realm)]: null,
[Symbol(state)]: {
aborted: false,
rangeRequested: false,
timingAllowPassed: true,
requestIncludesCredentials: true,
type: 'default',
status: 429,
timingInfo: {
startTime: 3201.5087999999523,
redirectStartTime: 0,
redirectEndTime: 0,
postRedirectStartTime: 3201.5087999999523,
finalServiceWorkerStartTime: 0,
finalNetworkResponseStartTime: 0,
finalNetworkRequestStartTime: 0,
endTime: 0,
encodedBodySize: 92,
decodedBodySize: 92,
finalConnectionTimingInfo: null
},
cacheState: '',
statusText: 'Too Many Requests',
headersList: HeadersList {
cookies: [Array],
[Symbol(headers map)]: [Map],
[Symbol(headers map sorted)]: null
},
urlList: [ [URL] ],
body: { stream: undefined }
},
[Symbol(headers)]: HeadersList {
cookies: [
'__dcfduid=81587b841b1b11eeb9a73e76673ec65e; Expires=Mon, 03-Jul-2028 10:05:44 GMT; Max-Age=157680000; Secure; HttpOnly; Path=/',
'__sdcfduid=81587b841b1b11eeb9a73e76673ec65e2152bf1b591ca51070e4dd0f8322114667b0f7fe83f5d6f8723c3c6de21c27c5; Expires=Mon, 03-Jul-2028 10:05:44 GMT; Max-Age=157680000; Secure; HttpOnly; Path=/',
'__cfruid=a354f8906f8f11e819e787b6cd91af4a1c2bf004-1688551544; path=/; domain=.discord.com; HttpOnly; Secure; SameSite=None'
],

[ AntiCrashDetection ]:- Unhandled Rejection/Catch
Response {
[Symbol(realm)]: null,
[Symbol(state)]: {
aborted: false,
rangeRequested: false,
timingAllowPassed: true,
requestIncludesCredentials: true,
type: 'default',
status: 429,
timingInfo: {
startTime: 3201.5087999999523,
redirectStartTime: 0,
redirectEndTime: 0,
postRedirectStartTime: 3201.5087999999523,
finalServiceWorkerStartTime: 0,
finalNetworkResponseStartTime: 0,
finalNetworkRequestStartTime: 0,
endTime: 0,
encodedBodySize: 92,
decodedBodySize: 92,
finalConnectionTimingInfo: null
},
cacheState: '',
statusText: 'Too Many Requests',
headersList: HeadersList {
cookies: [Array],
[Symbol(headers map)]: [Map],
[Symbol(headers map sorted)]: null
},
urlList: [ [URL] ],
body: { stream: undefined }
},
[Symbol(headers)]: HeadersList {
cookies: [
'__dcfduid=81587b841b1b11eeb9a73e76673ec65e; Expires=Mon, 03-Jul-2028 10:05:44 GMT; Max-Age=157680000; Secure; HttpOnly; Path=/',
'__sdcfduid=81587b841b1b11eeb9a73e76673ec65e2152bf1b591ca51070e4dd0f8322114667b0f7fe83f5d6f8723c3c6de21c27c5; Expires=Mon, 03-Jul-2028 10:05:44 GMT; Max-Age=157680000; Secure; HttpOnly; Path=/',
'__cfruid=a354f8906f8f11e819e787b6cd91af4a1c2bf004-1688551544; path=/; domain=.discord.com; HttpOnly; Secure; SameSite=None'
],

6 replies
DIAdiscord.js - Imagine an app
Created by Professor on 7/2/2023 in #djs-questions
Autocomplete Error!
CommandHandler
module.exports = class Command {
constructor(client, meta = {}) {
this.client = client;
this.data = meta.data;
this.contextDescription = meta.contextDescription || null;
this.usage = meta.usage || this.name;
this.category = meta.category || 'Info';
this.permissions = meta.permissions || ['Use Application Commands', 'Send Messages', 'Embed Links'];
}
async autocomplete() {
throw new Error(`The Slash Command ${this.name} Doesn't Have Any Autocomplete Method.`);
}
async run() {
throw new Error(`The Slash Command ${this.name} Doesn't Have Any Run Method.`);
}
};
module.exports = class Command {
constructor(client, meta = {}) {
this.client = client;
this.data = meta.data;
this.contextDescription = meta.contextDescription || null;
this.usage = meta.usage || this.name;
this.category = meta.category || 'Info';
this.permissions = meta.permissions || ['Use Application Commands', 'Send Messages', 'Embed Links'];
}
async autocomplete() {
throw new Error(`The Slash Command ${this.name} Doesn't Have Any Autocomplete Method.`);
}
async run() {
throw new Error(`The Slash Command ${this.name} Doesn't Have Any Run Method.`);
}
};
Command
const Command = require('../../structures/CommandClass');

module.exports = class Akinator extends Command {
constructor(client) {
super(client, {
data: new SlashCommandBuilder()
.setName('akinator')
.setDescription('akinator.')
.setDMPermission(true)
.addStringOption(option =>
option.setName(`language`)
.setDescription(`option`)
.setRequired(true)
.setAutocomplete(true)),
usage: 'akinator',
category: 'akinator',
permissions: ['Use Application Commands', 'Send Messages', 'Embed Links'],
});
}
async autocomplete(client, interaction) {
const focusedValue = interaction.options.getFocused();
const choices = ['Popular Topics: Threads', 'Sharding: Getting started', 'Library: Voice Connections', 'Interactions: Replying to slash commands', 'Popular Topics: Embed preview'];
const filtered = choices.filter(choice => choice.startsWith(focusedValue));
await interaction.respond(
filtered.map(choice => ({ name: choice, value: choice })),
);
}
async run(client, interaction) {
// Your run logic here
}
};
const Command = require('../../structures/CommandClass');

module.exports = class Akinator extends Command {
constructor(client) {
super(client, {
data: new SlashCommandBuilder()
.setName('akinator')
.setDescription('akinator.')
.setDMPermission(true)
.addStringOption(option =>
option.setName(`language`)
.setDescription(`option`)
.setRequired(true)
.setAutocomplete(true)),
usage: 'akinator',
category: 'akinator',
permissions: ['Use Application Commands', 'Send Messages', 'Embed Links'],
});
}
async autocomplete(client, interaction) {
const focusedValue = interaction.options.getFocused();
const choices = ['Popular Topics: Threads', 'Sharding: Getting started', 'Library: Voice Connections', 'Interactions: Replying to slash commands', 'Popular Topics: Embed preview'];
const filtered = choices.filter(choice => choice.startsWith(focusedValue));
await interaction.respond(
filtered.map(choice => ({ name: choice, value: choice })),
);
}
async run(client, interaction) {
// Your run logic here
}
};
3 replies
DIAdiscord.js - Imagine an app
Created by Professor on 5/26/2023 in #djs-questions
Remove Emoji
How To Remove Emoji From Button Builder After Sent
5 replies
DIAdiscord.js - Imagine an app
Created by Professor on 5/26/2023 in #djs-questions
Remove Label Not Working
Error
emojiBtn.setEmoji(emoji).setStyle(ButtonStyle.process).removeLabel();
emojiBtn.setEmoji(emoji).setStyle(ButtonStyle.process).removeLabel();
30 replies
DIAdiscord.js - Imagine an app
Created by Professor on 5/26/2023 in #djs-questions
Delete Interaction Message
How To Delete Iteraction Message When Button Clicked.
5 replies
DIAdiscord.js - Imagine an app
Created by Professor on 5/22/2023 in #djs-questions
Disabling Components
await i.update({ components: [ActionRowBuilder.from(buttonRow.components[0]).setDisabled(true)]});
await i.update({ components: [ActionRowBuilder.from(buttonRow.components[0]).setDisabled(true)]});
Doesnt Work
15 replies
DIAdiscord.js - Imagine an app
Created by Professor on 5/22/2023 in #djs-questions
Client Permissions
How To Check If Client Has Permissions
6 replies
DIAdiscord.js - Imagine an app
Created by Professor on 5/18/2023 in #djs-questions
Disabling Components
const buttonRow = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setLabel('NextFact')
.setCustomId('nxtfact')
.setStyle(ButtonStyle.Success),
)
const buttonRow = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setLabel('NextFact')
.setCustomId('nxtfact')
.setStyle(ButtonStyle.Success),
)
Set This Disabled After Sending. This Below Code Not Working.
i.update({ components: [buttonRow.components[0].setDisabled(true)] })
i.update({ components: [buttonRow.components[0].setDisabled(true)] })
16 replies
DIAdiscord.js - Imagine an app
Created by Professor on 5/11/2023 in #djs-questions
I Have Installed Ubuntu But Bot Isnt Running Here Is The Erro
/home/usr/Discord/node_modules/discord.js/src/client/BaseClient.js:29
userAgentAppendix: options.rest?.userAgentAppendix
^

SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/professor/Discord Bots/GroBot/A_GroBot Orginal Files/GroBot ~ Present/node_modules/discord.js/src/index.js:6:22)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
/home/usr/Discord/node_modules/discord.js/src/client/BaseClient.js:29
userAgentAppendix: options.rest?.userAgentAppendix
^

SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/professor/Discord Bots/GroBot/A_GroBot Orginal Files/GroBot ~ Present/node_modules/discord.js/src/index.js:6:22)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
7 replies
DIAdiscord.js - Imagine an app
Created by Professor on 5/3/2023 in #djs-questions
ping command doesnt work
Hey I Have Updated My Package Top v14.10.2. After I Tried To Run Ping Command And It Show Ping As -1 ms. Here Is The Code
${Math.floor(client.ws.ping)} ms
${Math.floor(client.ws.ping)} ms
8 replies
DIAdiscord.js - Imagine an app
Created by Professor on 4/27/2023 in #djs-questions
Shards
I Was Creating Shard System In My Bot But When I Run Code Console Is Running 2 Times And Shows This Error
[ AntiCrashDetection ]:- Unhandled Rejection/Catch
Response {
[Symbol(realm)]: null,
[Symbol(state)]: {
aborted: false,
rangeRequested: false,
timingAllowPassed: true,
requestIncludesCredentials: true,
type: 'default',
status: 429,
timingInfo: {
startTime: 2642.9780999999493,
redirectStartTime: 0,
redirectEndTime: 0,
postRedirectStartTime: 2642.9780999999493,
finalServiceWorkerStartTime: 0,
finalNetworkResponseStartTime: 0,
finalNetworkRequestStartTime: 0,
endTime: 0,
encodedBodySize: 92,
decodedBodySize: 92,
finalConnectionTimingInfo: null
},
cacheState: '',
statusText: 'Too Many Requests',
headersList: HeadersList {
cookies: [Array],
[Symbol(headers map)]: [Map],
[Symbol(headers map sorted)]: null
},
urlList: [ [URL] ],
body: { stream: undefined }
},
[Symbol(headers)]: HeadersList {
cookies: [
'__dcfduid=2d687a60e4f211ed8a4c667f3c8d60b7; Expires=Tue, 25-Apr-2028 11:53:51 GMT; Max-Age=157680000; Secure; HttpOnly; Path=/',
'__sdcfduid=2d687a60e4f211ed8a4c667f3c8d60b7fc5e0814bebaf92ba4f5ccecee58dd0409723fb28b252e927a71cde8e87d2c83; Expires=Tue, 25-Apr-2028 11:53:51 GMT; Max-Age=157680000; Secure; HttpOnly; Path=/',

}
[ AntiCrashDetection ]:- Unhandled Rejection/Catch
Response {
[Symbol(realm)]: null,
[Symbol(state)]: {
aborted: false,
rangeRequested: false,
timingAllowPassed: true,
requestIncludesCredentials: true,
type: 'default',
status: 429,
timingInfo: {
startTime: 2642.9780999999493,
redirectStartTime: 0,
redirectEndTime: 0,
postRedirectStartTime: 2642.9780999999493,
finalServiceWorkerStartTime: 0,
finalNetworkResponseStartTime: 0,
finalNetworkRequestStartTime: 0,
endTime: 0,
encodedBodySize: 92,
decodedBodySize: 92,
finalConnectionTimingInfo: null
},
cacheState: '',
statusText: 'Too Many Requests',
headersList: HeadersList {
cookies: [Array],
[Symbol(headers map)]: [Map],
[Symbol(headers map sorted)]: null
},
urlList: [ [URL] ],
body: { stream: undefined }
},
[Symbol(headers)]: HeadersList {
cookies: [
'__dcfduid=2d687a60e4f211ed8a4c667f3c8d60b7; Expires=Tue, 25-Apr-2028 11:53:51 GMT; Max-Age=157680000; Secure; HttpOnly; Path=/',
'__sdcfduid=2d687a60e4f211ed8a4c667f3c8d60b7fc5e0814bebaf92ba4f5ccecee58dd0409723fb28b252e927a71cde8e87d2c83; Expires=Tue, 25-Apr-2028 11:53:51 GMT; Max-Age=157680000; Secure; HttpOnly; Path=/',

}
2 replies
DIAdiscord.js - Imagine an app
Created by Professor on 4/27/2023 in #djs-questions
Bot Stops Song
The Music Package Is Works But After 30-60 Seconds The Bot Stops Playing I Think Its Djs Error Can AnyOne Say Temperory Solution
5 replies
DIAdiscord.js - Imagine an app
Created by Professor on 4/22/2023 in #djs-questions
Custom Status
Is There Any Method Like Keeping A Separate Status For Separate Server Like Mee6 Does???
3 replies