John
John
DIAdiscord.js - Imagine an app
Created by John on 1/30/2024 in #djs-questions
DiscordAPIError[50013]: Missing Permissions
I have a timeout command my bot has all the permissions it needs so I dont know why im getting this error https://sourceb.in/DwFsNQpjQC Does anyone know why this might be happening
2 replies
DIAdiscord.js - Imagine an app
Created by John on 6/9/2023 in #djs-questions
throw err; ^Error: Cannot find module '../commands/fun/avatar.js'Require stack:
Main.js File
const { Client, Intents, Collection } = require('discord.js');

const Discord = require("discord.js")
const db = require('quick.db')
const bot = new Client({intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES ] })
const { token } = require('./config.json');
const hostedBy = (true)
const config = require('./config.json');
bot.config = config;
const prefix = "."

const { readdirSync } = require("fs");
const ascii = require("ascii-table");
const table = new ascii("Commands");
table.setHeading("File Name", "Load Status");

const fs = require("fs");

bot.commands = new Discord.Collection();

const commands = fs.readdirSync("./commands/").filter(file => file.endsWith(".js"))
for(file of commands) {
const commandName = file.split(".")[0]
const command = require(`./commands/${commandName}`)
client.commands.set(commandName, command)
}

bot.on("messageCreate", message => {
if(message.content.startsWith(prefix)) {
const args = message.content.slice(prefix.length).trim().split(/ +/g)
const commandName = args.shift()
const command = client.commands.get(commandName)
if(!command) return
command.run(client, message, args)
}
})

bot.aliases = new Discord.Collection();



const { GiveawaysManager } = require('discord-giveaways');

bot.giveawaysManager = new GiveawaysManager(bot, {
storage: "./giveaways.json",
updateCountdownEvery: 5000,
default: {
botsCanWin: false,
exemptPermissions: [],
embedColor: "#FF0000",
reaction: "🎉"
}
});



bot.on("guildMemberAdd", (member) => {

let msg = db.get(`welmessage_${member.guild.id}`)
if (!msg) msg = "We are very happy to have you in our server"
const { Client, Intents, Collection } = require('discord.js');

const Discord = require("discord.js")
const db = require('quick.db')
const bot = new Client({intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES ] })
const { token } = require('./config.json');
const hostedBy = (true)
const config = require('./config.json');
bot.config = config;
const prefix = "."

const { readdirSync } = require("fs");
const ascii = require("ascii-table");
const table = new ascii("Commands");
table.setHeading("File Name", "Load Status");

const fs = require("fs");

bot.commands = new Discord.Collection();

const commands = fs.readdirSync("./commands/").filter(file => file.endsWith(".js"))
for(file of commands) {
const commandName = file.split(".")[0]
const command = require(`./commands/${commandName}`)
client.commands.set(commandName, command)
}

bot.on("messageCreate", message => {
if(message.content.startsWith(prefix)) {
const args = message.content.slice(prefix.length).trim().split(/ +/g)
const commandName = args.shift()
const command = client.commands.get(commandName)
if(!command) return
command.run(client, message, args)
}
})

bot.aliases = new Discord.Collection();



const { GiveawaysManager } = require('discord-giveaways');

bot.giveawaysManager = new GiveawaysManager(bot, {
storage: "./giveaways.json",
updateCountdownEvery: 5000,
default: {
botsCanWin: false,
exemptPermissions: [],
embedColor: "#FF0000",
reaction: "🎉"
}
});



bot.on("guildMemberAdd", (member) => {

let msg = db.get(`welmessage_${member.guild.id}`)
if (!msg) msg = "We are very happy to have you in our server"
23 replies
DIAdiscord.js - Imagine an app
Created by John on 6/9/2023 in #djs-questions
Commands not working
I made this discord bot about maybe 2 years ago I have recently started developing it again to use it as my final A level project everything seems to be doing well until I try execute commands they wont execute I dont know if it has something to do with the command handler being outdated or soemthing with the prefix Full code for refrence :https://replit.com/@MadlyJohn/Contbot-2 Using Version : "discord.js": "^12.5.3",
10 replies