Changed all double quote to backticks
parent
c86457cbfe
commit
d0a74e3f48
@ -1,19 +1,19 @@
|
||||
const Command = require("../../Structure/Command.js");
|
||||
const Command = require(`../../Structure/Command.js`);
|
||||
|
||||
module.exports = class extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "help",
|
||||
description: "Return the commands list.",
|
||||
category: "Bot",
|
||||
name: `help`,
|
||||
description: `Return the commands list.`,
|
||||
category: `Bot`,
|
||||
enabled: true,
|
||||
aliases: ["?"],
|
||||
aliases: [`?`],
|
||||
cooldown: 3,
|
||||
dmOnly: false,
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
message.chat.sendMessage("Here are the commands you can use ! https://github.com/Mr-KayJayDee/instagram-bot#available-commands")
|
||||
message.chat.sendMessage(`Here are the commands you can use ! https://github.com/Mr-KayJayDee/instagram-bot#available-commands`)
|
||||
}
|
||||
}
|
@ -1,24 +1,24 @@
|
||||
let Command = require(`../../Structure/Command.js`);
|
||||
const DIG = require("discord-image-generation");
|
||||
const DIG = require(`discord-image-generation`);
|
||||
|
||||
module.exports = class extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: "lisapresentation",
|
||||
description: "Return a lisa presentation image.",
|
||||
category: "Images",
|
||||
name: `lisapresentation`,
|
||||
description: `Return a lisa presentation image.`,
|
||||
category: `Images`,
|
||||
enabled: true,
|
||||
aliases: ["lisa"],
|
||||
aliases: [`lisa`],
|
||||
cooldown: 3,
|
||||
dmOnly: false,
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
let text = args.join(" ")
|
||||
let text = args.join(` `)
|
||||
if(!text) text = message.author.username;
|
||||
let img = await new DIG.LisaPresentation().getImage(text);
|
||||
message.chat.sendMessage("Please wait we're generating your image...");
|
||||
message.chat.sendMessage(`Please wait we're generating your image...`);
|
||||
message.chat.sendPhoto(img);
|
||||
}
|
||||
};
|
@ -1,46 +1,46 @@
|
||||
const { bgBlue, black, green } = require("chalk");
|
||||
const { bgBlue, black, green } = require(`chalk`);
|
||||
|
||||
function dateTimePad(value, digits){
|
||||
let number = value
|
||||
while (number.toString().length < digits) {
|
||||
number = "0" + number
|
||||
number = `0` + number
|
||||
}
|
||||
return number;
|
||||
}
|
||||
|
||||
function format(tDate){
|
||||
return (tDate.getFullYear() + "-" +
|
||||
dateTimePad((tDate.getMonth() + 1), 2) + "-" +
|
||||
dateTimePad(tDate.getDate(), 2) + " " +
|
||||
dateTimePad(tDate.getHours(), 2) + ":" +
|
||||
dateTimePad(tDate.getMinutes(), 2) + ":" +
|
||||
dateTimePad(tDate.getSeconds(), 2) + "." +
|
||||
return (tDate.getFullYear() + `-` +
|
||||
dateTimePad((tDate.getMonth() + 1), 2) + `-` +
|
||||
dateTimePad(tDate.getDate(), 2) + ` ` +
|
||||
dateTimePad(tDate.getHours(), 2) + `:` +
|
||||
dateTimePad(tDate.getMinutes(), 2) + `:` +
|
||||
dateTimePad(tDate.getSeconds(), 2) + `.` +
|
||||
dateTimePad(tDate.getMilliseconds(), 3))
|
||||
}
|
||||
|
||||
module.exports = class Logger {
|
||||
static log (content, type = "log") {
|
||||
static log (content, type = `log`) {
|
||||
const date = `[${format(new Date(Date.now()))}]:`;
|
||||
switch (type) {
|
||||
case "log": {
|
||||
case `log`: {
|
||||
return console.log(`${date} ${bgBlue(type.toUpperCase())} ${content} `);
|
||||
}
|
||||
case "warn": {
|
||||
case `warn`: {
|
||||
return console.log(`${date} ${black.bgYellow(type.toUpperCase())} ${content} `);
|
||||
}
|
||||
case "error": {
|
||||
case `error`: {
|
||||
return console.log(`${date} ${black.bgRed(type.toUpperCase())} ${content} `);
|
||||
}
|
||||
case "debug": {
|
||||
case `debug`: {
|
||||
return console.log(`${date} ${green(type.toUpperCase())} ${content} `);
|
||||
}
|
||||
case "cmd": {
|
||||
case `cmd`: {
|
||||
return console.log(`${date} ${black.bgWhite(type.toUpperCase())} ${content}`);
|
||||
}
|
||||
case "ready": {
|
||||
case `ready`: {
|
||||
return console.log(`${date} ${black.bgGreen(type.toUpperCase())} ${content}`);
|
||||
}
|
||||
default: throw new TypeError("Logger type must be either warn, debug, log, ready, cmd or error.");
|
||||
default: throw new TypeError(`Logger type must be either warn, debug, log, ready, cmd or error.`);
|
||||
}
|
||||
}
|
||||
};
|
@ -1,7 +1,7 @@
|
||||
const mongoose = require("mongoose"),
|
||||
const mongoose = require(`mongoose`),
|
||||
Schema = mongoose.Schema;
|
||||
|
||||
module.exports = mongoose.model("GroupMembers", new Schema({
|
||||
module.exports = mongoose.model(`GroupMembers`, new Schema({
|
||||
id: String,
|
||||
groupID: String,
|
||||
}));
|
||||
|
@ -1,37 +1,38 @@
|
||||
const InstaBot = require("./Structure/Client"),
|
||||
const InstaBot = require(`./Structure/Client`),
|
||||
client = new InstaBot();
|
||||
|
||||
const util = require("util"),
|
||||
fs = require("fs"),
|
||||
const util = require(`util`),
|
||||
fs = require(`fs`),
|
||||
readdir = util.promisify(fs.readdir),
|
||||
mongoose = require("mongoose");
|
||||
require("dotenv").config();
|
||||
mongoose = require(`mongoose`);
|
||||
require(`dotenv`).config();
|
||||
|
||||
const initialize = async () => {
|
||||
let directories = await readdir("./Commands/");
|
||||
let directories = await readdir(`./Commands/`);
|
||||
directories.forEach(async (dir) => {
|
||||
let commands = await readdir("./Commands/" + dir + "/");
|
||||
commands.filter((cmd) => cmd.split(".").pop() === "js").forEach((cmd) => {
|
||||
const response = client.loadCommand("./Commands/" + dir, cmd);
|
||||
let commands = await readdir(`./Commands/` + dir + `/`);
|
||||
commands.filter((cmd) => cmd.split(`.`).pop() === `js`).forEach((cmd) => {
|
||||
const response = client.loadCommand(`./Commands/` + dir, cmd);
|
||||
if (response) {
|
||||
client.logger.log(response, "error");
|
||||
client.logger.log(response, `error`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const evtFiles = await readdir("./Events/");
|
||||
const evtFiles = await readdir(`./Events/`);
|
||||
evtFiles.forEach((file) => {
|
||||
const eventName = file.split(".")[0];
|
||||
const eventName = file.split(`.`)[0];
|
||||
const event = new (require(`./Events/${file}`))(client);
|
||||
client.on(eventName, (...args) => event.emit(...args));
|
||||
delete require.cache[require.resolve(`./Events/${file}`)];
|
||||
});
|
||||
client.login(process.env.BOTUSERNAME, process.env.PASSWORD);
|
||||
|
||||
client.on('rawFbns', (data) => console.log(data));
|
||||
mongoose.connect(process.env.DATABASEURL, { useNewUrlParser: true, useUnifiedTopology: true }).then(() => {
|
||||
client.logger.log("Connected to the Mongodb database.", "ready");
|
||||
client.logger.log(`Connected to the Mongodb database.`, `ready`);
|
||||
}).catch((err) => {
|
||||
client.logger.log("Unable to connect to the Mongodb database. Error:"+err, "error");
|
||||
client.logger.log(`Unable to connect to the Mongodb database. Error:`+err, `error`);
|
||||
});
|
||||
};
|
||||
initialize();
|
Loading…
Reference in New Issue