Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require('dotenv').config()
- //modules
- const {Client} = require("discord.js");
- const Commands = require("./Modules/commands.js");
- //variables
- const bot = new Client();
- const prefix = process.env.PREFIX;
- const commandsIns = new Commands()
- //events
- bot.on("ready", async () => {
- console.log(bot.user.tag, "is up and running! ✔😀🎉");
- });
- bot.on("message", (message) => {
- let content = message.content
- if (content.startsWith(prefix)) {
- args = content.toLowerCase().trim().split(" ");
- let command = args.shift().slice(prefix.length);
- console.log(commandsIns[command])
- if (commandsIns[command]) {
- let {content,possibleAttachment} = commandsIns[command](args,message);
- message.reply(content,possibleAttachment);
- }
- }
- });
- bot.login(process.env.TOKEN);
Add Comment
Please, Sign In to add comment