NanotechPikachu
NanotechPikachu
DIAdiscord.js - Imagine an app
Created by NanotechPikachu on 2/17/2024 in #djs-questions
Bot not responding to prefix cmds
Nvm i got it. It was an intent issue
6 replies
DIAdiscord.js - Imagine an app
Created by NanotechPikachu on 2/17/2024 in #djs-questions
Bot not responding to prefix cmds
I would be thankful for ur help
6 replies
DIAdiscord.js - Imagine an app
Created by NanotechPikachu on 2/17/2024 in #djs-questions
Bot not responding to prefix cmds
The index.js for prefix handle
const prefixCommandFolders = fs.readdirSync('./commands/prefix-cmds');

for (const folder of prefixCommandFolders) {
console.log("@")
const commandFiles = fs.readdirSync(`./commands/prefix-cmds/${folder}`).filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`./commands/prefix-cmds/${folder}/${file}`);
client.commands.set(command.name, command);
}
}
const prefixCommandFolders = fs.readdirSync('./commands/prefix-cmds');

for (const folder of prefixCommandFolders) {
console.log("@")
const commandFiles = fs.readdirSync(`./commands/prefix-cmds/${folder}`).filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`./commands/prefix-cmds/${folder}/${file}`);
client.commands.set(command.name, command);
}
}
6 replies
DIAdiscord.js - Imagine an app
Created by NanotechPikachu on 2/17/2024 in #djs-questions
Bot not responding to prefix cmds
The code in ./commands/prefix-cmds/utility/ping.js
module.exports = {
name: 'ping',
description: 'Pings the bot and shows the latency.',
aliases: ['pong'],
execute(message, args) {
console.log("#")
const timeTaken = Date.now() - message.createdTimestamp;
message.reply(`Pong! This message had a latency of ${timeTaken}ms.`);
}
};
module.exports = {
name: 'ping',
description: 'Pings the bot and shows the latency.',
aliases: ['pong'],
execute(message, args) {
console.log("#")
const timeTaken = Date.now() - message.createdTimestamp;
message.reply(`Pong! This message had a latency of ${timeTaken}ms.`);
}
};
6 replies
DIAdiscord.js - Imagine an app
Created by NanotechPikachu on 10/15/2023 in #djs-questions
Loop for bot role has
Well, it works. Thanks
6 replies
DIAdiscord.js - Imagine an app
Created by NanotechPikachu on 10/15/2023 in #djs-questions
Loop for bot role has
Hmm when did that happen? Something like this loop worked around 1 month ago. Lemme try what you said now.
6 replies
DIAdiscord.js - Imagine an app
Created by NanotechPikachu on 10/15/2023 in #djs-questions
Loop for bot role has
Tried this too but, doesn't work
6 replies
DIAdiscord.js - Imagine an app
Created by NanotechPikachu on 10/15/2023 in #djs-questions
Loop for bot role has
const rol = "1048495552322609232";
const guild = message.guild;
const mem = [];
const role = guild.roles.cache.get(rol);

if (!role) {
message.channel.send('Cannot find the role!');
} else {
await guild.members.fetch()
.then((members) => {
console.log("hu");
members.forEach((member) => {
if (member.bot) {
console.log(`Bot: ${member.user.tag}`);
if (member.roles.cache.has(role.id)) {
mem.push(`<@${member.id}>`);
console.log(`Added: ${member.user.tag}`);
} else {
console.log(`Bot ${member.user.tag} doesn't have the role.`);
}
}
});
message.channel.send('hi');
console.log(mem);
})
.catch((e) => {
console.error(e);
});
}
const rol = "1048495552322609232";
const guild = message.guild;
const mem = [];
const role = guild.roles.cache.get(rol);

if (!role) {
message.channel.send('Cannot find the role!');
} else {
await guild.members.fetch()
.then((members) => {
console.log("hu");
members.forEach((member) => {
if (member.bot) {
console.log(`Bot: ${member.user.tag}`);
if (member.roles.cache.has(role.id)) {
mem.push(`<@${member.id}>`);
console.log(`Added: ${member.user.tag}`);
} else {
console.log(`Bot ${member.user.tag} doesn't have the role.`);
}
}
});
message.channel.send('hi');
console.log(mem);
})
.catch((e) => {
console.error(e);
});
}
6 replies
DIAdiscord.js - Imagine an app
Created by NanotechPikachu on 10/8/2023 in #djs-questions
Await reaction & loop
Thanks very much. It worked. heartlove I am closing this then. Thnx again.
4 replies
DIAdiscord.js - Imagine an app
Created by NanotechPikachu on 10/8/2023 in #djs-questions
Await reaction & loop
Hmmm lemme try
4 replies
DIAdiscord.js - Imagine an app
Created by NanotechPikachu on 7/11/2023 in #djs-questions
Banning doesn't delete msgs
{
"dependencies": {
"discord.js": "^14.11.0",
"fs": "^0.0.1-security",
"path": "^0.12.7",
"moment": "^2.29.4",
"mongodb": "^5.7.0",
"mongoose": "^7.3.4",
"glob-promise": "^6.0.3",
"moment-duration-format": "^2.3.2"
}
}
{
"dependencies": {
"discord.js": "^14.11.0",
"fs": "^0.0.1-security",
"path": "^0.12.7",
"moment": "^2.29.4",
"mongodb": "^5.7.0",
"mongoose": "^7.3.4",
"glob-promise": "^6.0.3",
"moment-duration-format": "^2.3.2"
}
}
Package.json And the result of the code is 14.11.0
10 replies
DIAdiscord.js - Imagine an app
Created by NanotechPikachu on 7/11/2023 in #djs-questions
Banning doesn't delete msgs
Ok
10 replies
DIAdiscord.js - Imagine an app
Created by NanotechPikachu on 7/11/2023 in #djs-questions
Banning doesn't delete msgs
I cannot. Cuz In host, there is no shell
10 replies
DIAdiscord.js - Imagine an app
Created by NanotechPikachu on 7/11/2023 in #djs-questions
Banning doesn't delete msgs
And mostly I think it's a discord error
10 replies
DIAdiscord.js - Imagine an app
Created by NanotechPikachu on 7/11/2023 in #djs-questions
Banning doesn't delete msgs
I am on latest version I can find
10 replies
DIAdiscord.js - Imagine an app
Created by NanotechPikachu on 7/11/2023 in #djs-questions
Banning doesn't delete msgs
No errors
10 replies
DIAdiscord.js - Imagine an app
Created by NanotechPikachu on 7/11/2023 in #djs-questions
Banning doesn't delete msgs
Node: 18.16.1
10 replies
DIAdiscord.js - Imagine an app
Created by NanotechPikachu on 7/11/2023 in #djs-questions
Banning doesn't delete msgs
await user.ban({ deleteMessageSeconds: 60 * 60 * 24 * 7, reason: reason })
await user.ban({ deleteMessageSeconds: 60 * 60 * 24 * 7, reason: reason })
10 replies
DIAdiscord.js - Imagine an app
Created by NanotechPikachu on 3/23/2023 in #djs-questions
Ping command help - Beginner
Hmmm ok
30 replies
DIAdiscord.js - Imagine an app
Created by NanotechPikachu on 3/23/2023 in #djs-questions
Ping command help - Beginner
Well, any idea to close this?
30 replies