Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ok reopended. I think this is the right branch LOL #18

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
node_modules
config.json
.eslintrc.json
*.env
*.db
*.sqlite
*.sqlite3
34 changes: 20 additions & 14 deletions index.js → Mei.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ Check the MIT License
*/

//required libraries. (NOTE: Some commands do have module dependencies so check them out as well)
require('dotenv').config()
const Commando = require("discord.js-commando");
const sqlite = require("sqlite");
const path = require("path");
//const config = require("./config.json"); //this is just a config file (Only for the Indev version of Mei)
const { MEI_OWNERS, MEI_PREFIX, MEI_TOKEN } = process.env

//client
const client = new Commando.Client({
owner: "175565380981358592",
commandPrefix: "m!",
owner: MEI_OWNERS.split(','),
commandPrefix: MEI_PREFIX,
disableEveryone: true,
unknownCommandResponse: false,
guildOnly: true
Expand All @@ -26,8 +27,8 @@ client.on("debug", console.log);
client.on("ready", () => {

console.log("Loading...");
console.log("Mei is now up and running...");
client.user.setActivity("m!help", ["Playing"]);
console.log(`${client.user.tag} is now up and running!`);
client.user.setActivity(`${MEI_PREFIX}help`, ["Playing"]);

});
client.on("commandError", (cmd, err) => {
Expand All @@ -43,14 +44,19 @@ client.setProvider(
).catch(console.error);

//command group registries
client.registry.registerGroup("core", "Core");
client.registry.registerGroup("info", "Info");
client.registry.registerGroup("fun", "Fun");
client.registry.registerGroup("reactions","Reactions");
client.registry.registerGroup("interactions","Interactions");
client.registry.registerGroup("booru","Booru")
client.registry.registerDefaults();
client.registry.registerCommandsIn(path.join(__dirname, "commands"));
client.registry
.registerDefaultTypes()
.registerGroups([
['core', 'Core'],
['info', 'Info'],
['fun', 'Fun'],
['reactions', 'Reactions'],
['interactions', 'Interactions'],
['booru', 'Booru']
])
.registerDefaultGroups()
.registerDefaultCommands()
.registerCommandsIn(path.join(__dirname, 'commands'));

//now we log in OwO
client.login(process.env.BOT_TOKEN);
client.login(MEI_TOKEN);
25 changes: 25 additions & 0 deletions assets/json/eight_ball.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"answer": [
"It is certain",
"It is decidedly so",
"Without a doubt",
"Yes definitely",
"You may rely on it",
"As I see it, yes",
"Most likely",
"Outlook good",
"Yes",
"Signs point to yes",
"Reply hazy try again",
"Ask again later",
"Better not tell you now",
"Cannot predict now",
"Concentrate and ask again",
"Don't count on it",
"My reply is no",
"My sources say no",
"Outlook not so good",
"Very doubtful",
"Ask youself that"
]
}
56 changes: 56 additions & 0 deletions assets/json/interactions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"cuddle": [
"https://media1.tenor.com/images/08de7ad3dcac4e10d27b2c203841a99f/tenor.gif?itemid=4885268",
"https://media1.tenor.com/images/7dc851c5531d26c0dfa5c62683c211e4/tenor.gif?itemid=4998184",
"https://media1.tenor.com/images/d0c2e7382742f1faf8fcb44db268615f/tenor.gif?itemid=5853736",
"https://media1.tenor.com/images/f73332aa4c013d56f5167efbcc5461d9/tenor.gif?itemid=9383130",
"https://media1.tenor.com/images/20ecc3af6a5523872854a7bc2c083b7e/tenor.gif?itemid=9032323"
],
"kiss": [
"https://media1.tenor.com/images/78095c007974aceb72b91aeb7ee54a71/tenor.gif?itemid=5095865",
"https://media1.tenor.com/images/1306732d3351afe642c9a7f6d46f548e/tenor.gif?itemid=6155670",
"https://media1.tenor.com/images/7fd98defeb5fd901afe6ace0dffce96e/tenor.gif?itemid=9670722",
"https://media1.tenor.com/images/621ceac89636fc46ecaf81824f9fee0e/tenor.gif?itemid=4958649",
"https://media1.tenor.com/images/bc5e143ab33084961904240f431ca0b1/tenor.gif?itemid=9838409"
],
"hug": [
"https://media1.tenor.com/images/6db54c4d6dad5f1f2863d878cfb2d8df/tenor.gif?itemid=7324587",
"https://media1.tenor.com/images/e58eb2794ff1a12315665c28d5bc3f5e/tenor.gif?itemid=10195705",
"https://media1.tenor.com/images/b77fd0cfd95f89f967be0a5ebb3b6c6a/tenor.gif?itemid=7864716",
"https://media1.tenor.com/images/42922e87b3ec288b11f59ba7f3cc6393/tenor.gif?itemid=5634630",
"https://media1.tenor.com/images/b8b017d93d2e24d43f48ac6c63464a9c/tenor.gif?itemid=7552069"
],
"mf": [
"https://media1.tenor.com/images/48d230e9557c2cc8182c4b0e509ff9cf/tenor.gif?itemid=9733014",
"https://media1.tenor.com/images/ca74a9cea9845b1eba6126e5a0aa1d9d/tenor.gif?itemid=9947973"
],
"pet": [
"https://media1.tenor.com/images/116fe7ede5b7976920fac3bf8067d42b/tenor.gif?itemid=9200932",
"https://media1.tenor.com/images/f79a9ec48bde0e592e55447b17ecfbad/tenor.gif?itemid=8053566",
"https://media1.tenor.com/images/f5176d4c5cbb776e85af5dcc5eea59be/tenor.gif?itemid=5081286",
"https://media1.tenor.com/images/c0bcaeaa785a6bdf1fae82ecac65d0cc/tenor.gif?itemid=7453915",
"https://media1.tenor.com/images/bf646b7164b76efe82502993ee530c78/tenor.gif?itemid=7394758",
"https://media1.tenor.com/images/d9b480bcd392d05426ae6150e986bbf0/tenor.gif?itemid=9332926"
],
"punch": [
"https://media1.tenor.com/images/6afcfbc435b698fa5ceb2ff019718e6d/tenor.gif?itemid=10480971",
"https://media1.tenor.com/images/c621075def6ca41785ef4aaea20cc3a2/tenor.gif?itemid=7679409",
"https://media1.tenor.com/images/965fabbfcdc09ee0eb4d697e25509f34/tenor.gif?itemid=7380310",
"https://media1.tenor.com/images/2487a7679b3d7d23cadcd51381635467/tenor.gif?itemid=11451829",
"https://media1.tenor.com/images/b2db2a7fe0b9f68f2869b4e0d11a9490/tenor.gif?itemid=8932977"
],
"slam": [
"https://media1.tenor.com/images/5f02103ea39728997617592fa3609955/tenor.gif?itemid=5176442",
"https://media1.tenor.com/images/9ea4fb41d066737c0e3f2d626c13f230/tenor.gif?itemid=7355956"
],
"slap": [
"https://media1.tenor.com/images/9ea4fb41d066737c0e3f2d626c13f230/tenor.gif?itemid=7355956",
"https://media1.tenor.com/images/fd14f63a93796ed26bd385c015df57b8/tenor.gif?itemid=4665506",
"https://media1.tenor.com/images/1cf84bf514d2abd2810588caf7d9fd08/tenor.gif?itemid=7679403",
"https://media1.tenor.com/images/0a3e109296e16977a61ed28c1e5bf7bf/tenor.gif?itemid=5122897",
"https://media1.tenor.com/images/4eed54377433c396ce2d9ad9ee5d22ef/tenor.gif?itemid=11234788"
],
"stab": [
"https://media1.tenor.com/images/aebaa1a854ea1fc04286a8729b3b6cf4/tenor.gif?itemid=5381666"
]
}
24 changes: 10 additions & 14 deletions commands/booru/danbooru.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@
const Commando = require("discord.js-commando");
const { RichEmbed } = require("discord.js");
const { Command } = require("discord.js-commando");
const { MessageEmbed } = require("discord.js");
const Danbooru = require("danbooru");

module.exports = class danbooruCommand extends Commando.Command {

constructor(client) {

module.exports = class danbooruCommand extends Command {
constructor(client) {
super(client, {

name:"danbooru",
group:"booru",
memberName:"danbooru",
description:"Posts a random image from Danbooru (SFW)"

});

}

run(message, callback) {
run(message) {

const booru = new Danbooru();
booru.posts({ tags: "rating:safe order:rank" }).then(posts => {
const index = Math.floor(Math.random() * posts.length);
const post = posts[index];
const url = booru.url(post.file_url);

const embed = new RichEmbed();
embed.addField("Source", `${url}`)
embed.setImage(`${url}`);
return message.embed(embed).then(callback);
const embed = new MessageEmbed()
.addField("Source", `${url}`)
.setImage(`${url}`)

return message.embed(embed);
});

}
Expand Down
25 changes: 11 additions & 14 deletions commands/booru/konachan.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
const Commando = require("discord.js-commando");
const { RichEmbed } = require("discord.js");
const { Command } = require("discord.js-commando");
const { MessageEmbed } = require("discord.js");
const booru = require("booru")

module.exports = class konachanCommand extends Commando.Command {

constructor(client) {

module.exports = class konachanCommand extends Command {
constructor(client) {
super(client, {

name: "konachan",
group: "booru",
memberName: "konachan",
description: "Posts a random image from Konachan (SFW)"

});

}

run(message, callback) {
run(message) {

booru.search("kc",["rating:safe"],{limit:1,random:true})
.then(booru.commonfy)
.then(images  =>  {   //Log the direct link to each image
for  (let  image  of  images)  {
let url = image.common.file_url
const embed = new RichEmbed();
embed.addField("Source", `${url}`)
embed.setImage(`${url}`);
return message.embed(embed).then(callback);

const embed = new MessageEmbed()
.addField("Source", `${url}`)
.setImage(`${url}`)

return message.embed(embed);
}
})
}
Expand Down
23 changes: 11 additions & 12 deletions commands/booru/yandere.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
const Commando = require("discord.js-commando");
const { RichEmbed } = require("discord.js");
const { Command } = require("discord.js-commando");
const { MessageEmbed } = require("discord.js");
const booru = require("booru")

module.exports = class yandereCommand extends Commando.Command {

constructor(client) {

module.exports = class yandereCommand extends Command {
constructor(client) {
super(client, {

name: "yandere",
group: "booru",
memberName: "yandere",
Expand All @@ -17,17 +14,19 @@ module.exports = class yandereCommand extends Commando.Command {

}

run(message, callback) {
run(message) {

booru.search("yd",["rating:safe"],{limit:1,random:true})
.then(booru.commonfy)
.then(images  =>  {   //Log the direct link to each image
for  (let  image  of  images)  {
let url = image.common.file_url
const embed = new RichEmbed();
embed.addField("Source", `${url}`)
embed.setImage(`${url}`);
return message.embed(embed).then(callback);

const embed = new MessageEmbed()
.addField("Source", `${url}`)
.setImage(`${url}`)

return message.embed(embed)
}
})
}
Expand Down
26 changes: 11 additions & 15 deletions commands/core/about.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
const Commando = require("discord.js-commando");
const { RichEmbed } = require("discord.js");
const { Command } = require("discord.js-commando");
const { MessageEmbed } = require("discord.js");

module.exports = class AboutCommand extends Commando.Command {
module.exports = class AboutCommand extends Command {
constructor(client) {
super(client, {

name: "about",
group: "core",
memberName: "about",
description: "Gives bot information"

});
}

run (msg, args, callback) {

const embed = new RichEmbed();
embed.setTitle("About Mei");
embed.setColor(0x551A8B);
embed.setDescription("Mei is a discord bot made by Eris#6753 using discord.js. Commands handled by discord.js-commando. For help please type `m!help`");
embed.addField("Owner","Eris#6753");
embed.addField("Version","v1.0.2");
return msg.embed(embed).then(callback);

run (message) {
const embed = new MessageEmbed()
.setTitle("About Mei")
.setColor('0x551A8B')
.setDescription(`Mei is a discord bot made by Eris#6753 using discord.js. Commands handled by discord.js-commando. For help please type \`${process.env.MEI_PREFIX}help\``)
.addField("Owner","Eris#6753")
.addField("Version","v1.1.3")
return message.embed(embed)
}
};
19 changes: 4 additions & 15 deletions commands/core/invite.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
const Commando = require("discord.js-commando");
const { RichEmbed } = require("discord.js");

module.exports = class inviteCommand extends Commando.Command {
const { Command } = require("discord.js-commando");

module.exports = class inviteCommand extends Command {
constructor(client) {

super(client, {

name: "invite",
group: "core",
memberName: "invite",
description: "Invite me!"

});

}

run(message, callback) {

const embed = new RichEmbed();
embed.addField("Invite me!", "https://discordapp.com/oauth2/authorize?&client_id=432365216593084426&scope=bot&permissions=0");
return message.embed(embed).then(callback);

run(message) {
return message.say('https://discordapp.com/api/oauth2/authorize?client_id=499734554345603072&permissions=0&scope=bot')
}

};
Loading