Merge pull request #2 from Mr-KayJayDee/develop

Merge develop to master
main
Killian' Dal-Cin 4 years ago committed by GitHub
commit f73720ea7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,2 +1,3 @@
BOTUSERNAME=Your bot account username
PASSWORD=Your bot account password
PASSWORD=Your bot account password
DATABASEURL=The url of your mongoDB database (can be local or cluster and need to be URL friendly)

@ -0,0 +1,19 @@
const Command = require("../../Structure/Command.js");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "help",
description: "Return the commands list.",
category: "Bot",
enabled: true,
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")
}
}

@ -4,7 +4,7 @@ module.exports = class extends Command {
constructor(client) {
super(client, {
name: "ping",
description: "Return the bot ping (just a test command for now until the real ping is added)",
description: "Return the bot ping.",
category: "Bot",
enabled: true,
aliases: ["latency"],
@ -14,7 +14,9 @@ module.exports = class extends Command {
}
async run(message, args) {
message.chat.sendMessage(`Hey, my name is ${this.client.user.fullName} and i am an instagram bot.`);
message.chat.sendMessage('Calcul du ping...').then(m => {
m.delete();
message.chat.sendMessage(`Mon ping est de ${(m.timestamp - message.timestamp) / 1000}ms`)
})
}
}
}

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "ad",
description: "Display an ad image.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.Ad().getImage(avatar);
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "affect",
description: "Return an affect image.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.Affect().getImage(avatar);
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "beautiful",
description: "Return a beautiful image.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.Beautiful().getImage(avatar);
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "blur",
description: "Return a blured image.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.Blur().getImage(avatar);
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "circle",
description: "Return a circled image.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.Circle().getImage(avatar);
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "confusedstonk",
description: "Return a confused stonk image.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.ConfusedStonk().getImage(avatar);
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "delete",
description: "Return a dalete image.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.Delete().getImage(avatar);
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "facepalm",
description: "Return a facepalm.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.Facepalm().getImage(avatar);
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "gay",
description: "Return a gay image.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.Gay().getImage(avatar);
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "greyscale",
description: "Return a greyscaled image.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.Greyscale().getImage(avatar);
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "hitler",
description: "Return an hitler image.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.Hitler().getImage(avatar);
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "invert",
description: "Returnan inverted image.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.Invert().getImage(avatar);
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "jail",
description: "Return a jail image.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.Jail().getImage(avatar);
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,24 @@
let Command = require(`../../Structure/Command.js`);
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",
enabled: true,
aliases: ["lisa"],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
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.sendPhoto(img);
}
};

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "mms",
description: "Return an m&ms image.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.Mms().getImage(avatar);
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "notstonk",
description: "Return a not stonk image.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.NotStonk().getImage(avatar);
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "poutine",
description: "Return a poutine image.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.Poutine().getImage(avatar);
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "rip",
description: "Return a RIP image.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.Rip().getImage(avatar);
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "sepia",
description: "Return a sepia image.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.Sepia().getImage(avatar);
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "stonk",
description: "Return a stonk image.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.Stonk().getImage(avatar);
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "tatoo",
description: "Return a tatoo image.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.Tatoo().getImage(avatar);
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "thomas",
description: "Return a thomas image.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.Thomas().getImage(avatar);
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "trash",
description: "Return a trash image.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.Trash().getImage(avatar);
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,23 @@
let Command = require(`../../Structure/Command.js`);
const DIG = require("discord-image-generation");
module.exports = class extends Command {
constructor(client) {
super(client, {
name: "wanted",
description: "Return a wanted image.",
category: "Images",
enabled: true,
aliases: [],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
let avatar = message.author.avatarURL;
let img = await new DIG.Wanted().getImage(avatar, "$");
message.chat.sendMessage("Please wait we're generating your image...");
message.chat.sendPhoto(img);
}
};

@ -0,0 +1,33 @@
const Command = require(`../../Structure/Command.js`);
module.exports = class extends Command {
constructor(client) {
super(client, {
name: `myinfos`,
description: `Return some informations about you.`,
category: `Utils`,
enabled: true,
aliases: [`me`],
cooldown: 3,
dmOnly: false,
});
}
async run(message, args) {
message.author.fetch().then(e => {
message.chat.sendMessage(
`Full Name: ${message.author.fullName}
Username: ${message.author.username}
ID: ${message.author.id}
Biography:\n${message.author.biography}
Followers: ${message.author.followerCount}
Following: ${message.author.followingCount}
Business: ${message.author.isBusiness}
Verified: ${message.author.isVerified}
Private: ${message.author.isPrivate}
Number Of Posts: ${message.author.mediaCount}
Number Of IGTV posts: ${message.author.totalIgtvVideos}
`)
})
}
}

@ -5,10 +5,10 @@ module.exports = class {
async emit() {
this.client.logger.log(`Logged in as ${this.client.user.fullName} (${this.client.user.username}).`, "ready");
this.client.logger.log(`Followers: ${this.client.user.followerCount}`, "ready")
this.client.logger.log(`Following: ${this.client.user.followingCount}`, "ready")
this.client.logger.log(`Business : ${this.client.user.isBusiness}`, "ready")
this.client.logger.log(`Verified: ${this.client.user.isVerified}`, "ready")
this.client.logger.log(`Private: ${this.client.user.isPrivate}`, "ready")
this.client.logger.log(`Followers: ${this.client.user.followerCount}`, "ready");
this.client.logger.log(`Following: ${this.client.user.followingCount}`, "ready");
this.client.logger.log(`Business : ${this.client.user.isBusiness}`, "ready");
this.client.logger.log(`Verified: ${this.client.user.isVerified}`, "ready");
this.client.logger.log(`Private: ${this.client.user.isPrivate}`, "ready");
}
}

@ -6,8 +6,21 @@ module.exports = class {
}
async emit(message) {
const data = {};
data.config = this.client.config;
if (message.authorID === this.client.user.id) return;
message.markSeen();
if (message.chat.isGroup) {
const groupMembersData = await this.client.findOrCreateGroupMember({ id: message.author.id, groupID: message.chat.id });
data.groupMembers = groupMembersData;
console.log(groupMembersData)
const groupsData = await this.client.findOrCreateGroup({ groupID: message.chat.id });
data.groups = groupsData;
} else {
const usersData = await this.client.findOrCreateUser({ id: message.author.id });
data.users = usersData;
}
let prefixes = this.client.config.defaultPrefix;
if (message.content.indexOf(prefixes) !== 0) return;
@ -46,6 +59,6 @@ module.exports = class {
tStamps.set(message.authorID, timeNow);
setTimeout(() => tStamps.delete(message.authorID), cdAmount);
cmd.run(message, args);
cmd.run(message, args, data);
}
}

@ -4,7 +4,7 @@ module.exports = class {
}
async emit(user) {
console.log(`${user.fullName} (${username}) started following you.`)
console.log(`${user.fullName} (${user.username}) started following you.`)
user.follow();
}
}

@ -0,0 +1,7 @@
const mongoose = require("mongoose"),
Schema = mongoose.Schema;
module.exports = mongoose.model("GroupMembers", new Schema({
id: String,
groupID: String,
}));

@ -0,0 +1,10 @@
const mongoose = require("mongoose"),
Schema = mongoose.Schema;
module.exports = mongoose.model("Groups", new Schema({
groupID: String,
reminds: {
type: Array,
default: []
},
}));

@ -0,0 +1,10 @@
const mongoose = require("mongoose"),
Schema = mongoose.Schema;
module.exports = mongoose.model("Users", new Schema({
id: String,
reminds: {
type: Array,
default: []
},
}));

@ -50,13 +50,48 @@ it means that the bot is ready to be used. 🎉
# Available commands
- !ping
## Bot
- !ping: Return the bot ping
## Images
- !ad: Return an ad image.
- !affect: Return an affect image.
- !beautiful: Return a beautiful image.
- !blur: Return a blured image.
- !circle: Return a circled image.
- !confuedStonk: Return a confuedStonk image.
- !delete: Return a delete image.
- !facepalm: Return a facepalm image.
- !gay: Return a gay image.
- !greyscale: Return a greyscale image.
- !hitler: Return an hitler image.
- !invert: Return an invert image.
- !jail: Return a jail image.
- !lisaPresentation: Return a lisaPresentation image.
- !mms: Return a mms image.
- !notstonk: Return a notstonk image.
- !poutine: Return a poutine image.
- !rip: Return a rip image.
- !sepia: Return a sepia image.
- !stonk: Return a stonk image.
- !tatoo: Return a tatoo image.
- !thomas: Return a thomas image.
- !trash: Return a trash image.
- !wanted: Return a wanted image.
## Utils
- !myinfos: Return some informations about you. (missing some infos)
# Known bugs
- A story answer return an error (TypeError: Cannot read property 'indexOf' of undefined, same for all system messages)
# Future updates
- Ability to change the prefix on a chat
- Ability to change the lang
- Ability to make reminders
- Ability to make reminders (working on it)
- Ability to get the informations about an user
Feel free to make a pull request if you have any edit to do in the code or just open an issue if you don't know how to fix it.

@ -1,20 +1,27 @@
const { Client } = require("@androz2091/insta.js"),
Collection = require("@discordjs/collection")
Collection = require("@discordjs/collection")
path = require("path");
class InstaBot extends Client {
constructor(options) {
super(options);
["commands", "aliases", "cooldowns"].forEach(x => this[x] = new Collection());
["commands", "aliases", "cooldowns"].forEach(x => this[x] = new Collection());
this.config = require("../config");
this.logger = require("../Helpers/logger");
this.usersData = require("../Models/Users");
this.groupsData = require("../Models/Groups")
this.groupMembersData = require("../Models/GroupMembers")
this.databaseCache = {};
this.databaseCache.users = new Collection();
this.databaseCache.groups = new Collection();
this.databaseCache.groupMembers = new Collection();
}
loadCommand(commandPath, commandName) {
try {
const props = new (require(`.${commandPath}${path.sep}${commandName}`))(this);
props.conf.location = commandPath;
if (props.init){
if (props.init) {
props.init(this);
}
this.commands.set(props.help.name, props);
@ -27,22 +34,73 @@ class InstaBot extends Client {
}
}
async unloadCommand (commandPath, commandName) {
async unloadCommand(commandPath, commandName) {
let command;
if(this.commands.has(commandName)) {
if (this.commands.has(commandName)) {
command = this.commands.get(commandName);
} else if(this.aliases.has(commandName)){
} else if (this.aliases.has(commandName)) {
command = this.commands.get(this.aliases.get(commandName));
}
if(!command){
if (!command) {
return `The command \`${commandName}\` doesn't seem to exist, nor is it an alias. Try again!`;
}
if(command.shutdown){
if (command.shutdown) {
await command.shutdown(this);
}
delete require.cache[require.resolve(`.${commandPath}${path.sep}${commandName}.js`)];
return false;
}
async findOrCreateUser({ id: userID }, isLean) {
if (this.databaseCache.users.get(userID)) {
return isLean ? this.databaseCache.users.get(userID).toJSON() : this.databaseCache.users.get(userID);
} else {
let userData = (isLean ? await this.usersData.findOne({ id: userID }).populate("members").lean() : await this.usersData.findOne({ id: userID }).populate("members"));
if (userData) {
if (!isLean) this.databaseCache.users.set(userID, userData);
return userData;
} else {
userData = new this.usersData({ id: userID });
await userData.save();
this.databaseCache.users.set(userID, userData);
return isLean ? userData.toJSON() : userData;
}
}
}
async findOrCreateGroupMember({ id: userID, groupID: groupID }, isLean) {
if (this.databaseCache.groupMembers.get(`${userID}-${groupID}`)) {
return isLean ? this.databaseCache.groupMembers.get(`${userID}-${groupID}`).toJSON() : this.databaseCache.groupMembers.get(`${userID}-${groupID}`);
} else {
let groupMemberData = (isLean ? await this.groupMembersData.findOne({ id: userID, groupID: groupID }).populate("members").lean() : await this.groupMembersData.findOne({ id: userID, groupID: groupID }).populate("members"));
if (groupMemberData) {
if (!isLean) this.databaseCache.groupMembers.set(`${userID}-${groupID}`, groupMemberData);
return groupMemberData;
} else {
groupMemberData = new this.groupMembersData({ id: userID, groupID: groupID });
await groupMemberData.save();
this.databaseCache.groupMembers.set(`${userID}-${groupID}`, groupMemberData);
return isLean ? groupMemberData.toJSON() : groupMemberData;
}
}
}
async findOrCreateGroup({ groupID: groupID }, isLean) {
if (this.databaseCache.groups.get(groupID)) {
return isLean ? this.databaseCache.groupMembers.get(groupID).toJSON() : this.databaseCache.groupMembers.get(groupID);
} else {
let groupData = (isLean ? await this.groupMembersData.findOne({ groupID: groupID }).populate("members").lean() : await this.groupMembersData.findOne({ groupID: groupID }).populate("members"));
if (groupData) {
if (!isLean) this.databaseCache.groupMembers.set(groupID, groupData);
return groupData;
} else {
groupData = new this.groupMembersData({ groupID: groupID });
await groupData.save();
this.databaseCache.groupMembers.set(groupID, groupData);
return isLean ? groupData.toJSON() : groupData;
}
}
}
}
module.exports = InstaBot;

@ -3,7 +3,8 @@ const InstaBot = require("./Structure/Client"),
const util = require("util"),
fs = require("fs"),
readdir = util.promisify(fs.readdir);
readdir = util.promisify(fs.readdir),
mongoose = require("mongoose");
require("dotenv").config();
const initialize = async () => {
@ -26,5 +27,11 @@ const initialize = async () => {
delete require.cache[require.resolve(`./Events/${file}`)];
});
client.login(process.env.BOTUSERNAME, process.env.PASSWORD);
mongoose.connect(process.env.DATABASEURL, { useNewUrlParser: true, useUnifiedTopology: true }).then(() => {
client.logger.log("Connected to the Mongodb database.", "ready");
}).catch((err) => {
client.logger.log("Unable to connect to the Mongodb database. Error:"+err, "error");
});
};
initialize();

@ -1,6 +1,6 @@
{
"name": "instabot",
"version": "1.0.0",
"version": "1.1.5",
"description": "A fully working instagram bot using Insta.js by androz2091",
"main": "index.js",
"scripts": {
@ -10,9 +10,13 @@
"author": "Mr¤KayJayDee <killian.dalcin@gmail.com> (https://github.com/Mr-KayJayDee)",
"license": "MIT",
"dependencies": {
"@androz2091/insta.js": "github:androz2091/insta.js",
"@androz2091/insta.js": "github:androz2091/insta.js#develop",
"@discordjs/collection": "^0.1.6",
"chalk": "^4.1.0",
"dotenv": "^8.2.0"
"discord-image-generation": "^1.3.7",
"dotenv": "^8.2.0",
"mongoose": "^5.10.1",
"ms": "^2.1.2",
"node-fetch": "^2.6.0"
}
}

Loading…
Cancel
Save