Published by
discord.js v14 prefix bot
About Discord bot draft that does not contain ready-made commands, compatible with discord.js v14. Create your own discord bot with this command handl
- License MIT
- Publication Date 14/07/2023 - 00:09
- Version Discord.js V14
- Command Type Prefix
- Views 25
- Downloads 2
- Files 7
- Images 0
Click to see the description in this file!
module.exports = {
token: "YOUR BOT TOKEN",
prefix: "YOUR BOT PREFİX"
}
Click to see the description in this file!
const { Client, GatewayIntentBits, Partials } = require("discord.js");
const config = require("./config.js");
const client = new Client({
partials: [
Partials.Message, // for message
Partials.Channel, // for text channel
Partials.GuildMember, // for guild member
Partials.Reaction, // for message reaction
Partials.GuildScheduledEvent, // for guild events
Partials.User, // for discord user
Partials.ThreadMember, // for thread member
],
intents: [
GatewayIntentBits.Guilds, // for guild related things
GatewayIntentBits.GuildMembers, // for guild members related things
GatewayIntentBits.GuildBans, // for manage guild bans
GatewayIntentBits.GuildEmojisAndStickers, // for manage emojis and stickers
GatewayIntentBits.GuildIntegrations, // for discord Integrations
GatewayIntentBits.GuildWebhooks, // for discord webhooks
GatewayIntentBits.GuildInvites, // for guild invite managing
GatewayIntentBits.GuildVoiceStates, // for voice related things
GatewayIntentBits.GuildPresences, // for user presence things
GatewayIntentBits.GuildMessages, // for guild messages things
GatewayIntentBits.GuildMessageReactions, // for message reactions things
GatewayIntentBits.GuildMessageTyping, // for message typing things
GatewayIntentBits.DirectMessages, // for dm messages
GatewayIntentBits.DirectMessageReactions, // for dm message reaction
GatewayIntentBits.DirectMessageTyping, // for dm message typinh
GatewayIntentBits.MessageContent, // enable if you need message content things
],
});
module.exports = client;
require("./events/message.js")
require("./events/ready.js")
client.login(config.token || process.env.TOKEN).catch(e => {
console.log("The Bot Token You Entered Into Your Project Is Incorrect Or Your Bot's INTENTS Are OFF!")
})
const express = require("express");
const app = express();
const http = require("http");
app.get("/", (request, response) => {
response.sendStatus(200);
});
app.listen(process.env.PORT);
Click to see the description in this file!
{
"name": "discordjs-14",
"version": "5.0.0",
"description": "Discord bot draft that does not contain ready-made commands, compatible with discord.js v14. Create your own discord bot with this command handler.",
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"keywords": [],
"author": "Umut Bayraktar",
"license": "ISC",
"dependencies": {
"@discordjs/builders": "^1.0.0",
"discord.js": "^14.0.1",
"fs": "^0.0.1-security",
"express": "^4.18.1",
"http": "^0.0.1-security"
},
"engines": {
"node": "16.x"
}
}
Click to see the description in this file!
# discordJS-V14
About Discord bot draft that does not contain ready-made commands, compatible with discord.js v14. Create your own discord bot with this command handler.
<hr>
Follow Me Social Media<br>
Twitch Yayınları: https://twitch.com/umutxyp<br>
Github: https://github.com/umutxyp<br>
Instagram: https://instagram.com/umutxyp<br>
Twitter: https://twitter.com/devbayraktar<br>
Facebook: https://facebook.com/umutxyp<br>
Pinterest: https://pinterest.com/umutxyp<br>
TikTok: https://www.tiktok.com/@umutxyp
Click to see the description in this file!
const { EmbedBuilder } = require("discord.js");
var config = require("../config.js");
const client = require("..");
const prefix = config.prefix;
client.on("messageCreate", async (message) => {
if (!message.guild) return;
if (message.author.bot) return;
if (!message.content.startsWith(prefix)) return;
let command = message.content.toLocaleLowerCase().split(" ")[0].slice(prefix.length);
let params = message.content.split(" ").slice(1);
let cmd;
if (client.commands.has(command)) {
cmd = client.commands.get(command);
} else if (client.aliases.has(command)) {
cmd = client.commands.get(client.aliases.get(command));
}
if (cmd) {
cmd.run(client, message, params);
}
});
Click to see the description in this file!
const {EmbedBuilder} = require("discord.js");
exports.run = async (client, message, args) => {
const embed = new EmbedBuilder()
.setTitle("Command Title")
.setDescription("**https://discord.gg/6XGqdgE**")
.setColor("#007fff")
.setTimestamp()
return message.channel.send({embeds : [embed]});
};
exports.conf = {
aliases: []
};
exports.help = {
name: "test"
};
Click to see the description in this file!
const client = require("../index");
const { Collection } = require("discord.js")
const fs = require("fs")
client.on("ready", () => {
console.log(`${client.user.tag} Bot Online!`)
client.user.setActivity(`Umut Bayraktar ♥ Code Share`)
client.commands = new Collection();
client.aliases = new Collection();
fs.readdir("./commands/", (err, files) => {
if (err) console.error(err);
console.log(`${files.length} Total Command!`);
files.forEach(f => {
let props = require(`../commands/${f}`);
console.log(`${props.help.name} Named Command Online!`);
client.commands.set(props.help.name, props);
props.conf.aliases.forEach(alias => {
client.aliases.set(alias, props.help.name);
});
});
});
});