Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
clqu authored Jul 9, 2021
1 parent 84c5839 commit 25b324d
Show file tree
Hide file tree
Showing 17 changed files with 296 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/commands/botinfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
const Discord = require('discord.js');
const client = new Discord.Client();
const bots = require("../database/models/botlist/bots.js");
module.exports.run = async (client,message,args) => {
if(!args[0]) return message.channel.send("Error: Please write bot id.");
let b = await bots.findOne({ botID: args[0] });
if(!b) return message.channel.send("Invalid bot id.")
let website = b.website ? " | [Website]("+b.website+")" : "";
let github = b.github ? " | [Github]("+b.github+")" : "";
let discord = b.support ? " | [Support Server]("+b.support+")" : "";
let coowner;
if(!b.coowners.length <= 0) {
coowner = b.coowners.map(a => "<@"+a+">").join("\n");
} else {
coowner = "";
}
const embed = new Discord.MessageEmbed()
.setThumbnail(b.avatar)
.setAuthor(b.username+"#"+b.discrim, b.avatar)
.setDescription("**[Vote for the bot named "+b.username+"#"+b.discrim+" in vCodes.](https://vcodes.xyz/bot/"+b.botID+"/vote)**")
.addField("ID", b.botID, true)
.addField("Username", b.username, true)
.addField("Discriminator", b.discrim, true)
.addField("Votes", b.votes, true)
.addField("Certificate", b.certificate, true)
.addField("Short Description", b.shortDesc, true)
.setColor("#7289da")
.addField("Server Count", `${b.serverCount || "N/A"}`, true)
.addField("Owner(s)", `<@${b.ownerID}>\n${coowner.replace("<@>", "")}`, true)
.addField("Links", `[Invite](https://discord.com/oauth2/authorize?client_id=${b.botID}&scope=bot&permissions=8)${website}${discord}${github}`, true)
message.channel.send(embed)
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
};

exports.help = {
name: "botinfo",
description: "",
usage: ""
};
24 changes: 24 additions & 0 deletions src/commands/bots.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const Discord = require('discord.js')
const vcodes = require("vcodes.js");
const botdata = require("../database/models/botlist/bots.js")
module.exports.run = async (client,message,args) => {
let x = await botdata.find();
let bots = await x.filter(a => a.ownerID == message.author.id || a.coowners.includes(message.author.id))
const embed = new Discord.MessageEmbed()
.setAuthor(message.author.tag, message.author.avatarURL({dynamic: true}))
.setDescription(`**Total ${bots.length} bots found.**`)
.setColor("#7289da")
.addField("Bots", `${!bots ? "" : bots.map(a => "<@"+a.botID+">").join("\n")}`, true)
message.channel.send(embed)
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
};

exports.help = {
name: "bots",
description: "",
usage: ""
};
52 changes: 52 additions & 0 deletions src/commands/eval.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
const Discord = require('discord.js');
const client = new Discord.Client();
const bot = new Discord.Client();
const { Client, Util } = require('discord.js');
exports.run = async (client, message, args) => {
if(!global.config.bot.owners.includes(message.author.id)) return message.reply('could not be granted access permission.')
try {
var code = args.join(" ");
var evaled = eval(code);

if (typeof evaled !== "string")
evaled = require("util").inspect(evaled);
let Embed = new Discord.MessageEmbed()
.addField("Code","```js\n" + code + "```")
.setDescription("```js\n" + clean(evaled) + "```")
if (Embed.description.length >= 2048)
Embed.description = Embed.description.substr(0, 2042) + "```...";
return message.channel.send(Embed)
} catch (err) {
message.channel.send(`\`HATA\` \`\`\`xl\n${clean(err)}\n\`\`\``);
}
};

exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: 0
};

exports.help = {
name: 'eval',
description: 'Kod denemek için kullanılır.',
usage: 'eval [kod]',
category: 'owner'
}

const clean = text => {
if (typeof(text) === "string")
return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
else
return text;
}
function makeToken(length) {
var result = '';
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
var charactersLength = characters.length;
for ( var i = 0; i < length; i++ ) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
}
19 changes: 19 additions & 0 deletions src/commands/reboot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const Discord = require('discord.js');
const fetch = require("node-fetch");
exports.run = (client, message, args) => {
if(!global.config.bot.owners.includes(message.author.id)) return message.reply('could not be granted access permission.')
message.channel.send("vCodes: Bot yeniden başlatılıyor.").then(msg => {
console.log(`BOT : Yeniden başlatılıyor...`);
process.exit(1);
})
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: []
};
exports.help = {
name: 'reboot',
description: 'Botu Yeniden Başlatır.',
usage: 'reboot'
};
14 changes: 14 additions & 0 deletions src/database/connect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const config = require("../../config.js");
const mongoose = require("mongoose")

module.exports = async () => {
mongoose.connect(config.bot.mongourl, {
useNewUrlParser: true,
useUnifiedTopology: true,
useCreateIndex: true,
useFindAndModify: false,
autoIndex: false
}).then(() => {
console.log("[vcodes.xyz]: Mongoose successfully connected.");
}).catch(err => console.log("[vcodes.xyz]: An error occurred while connecting mongoose.", err));
}
12 changes: 12 additions & 0 deletions src/database/json/partners.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"partners": [
{
"code": "513946525426",
"ownerID": "615029465726320654",
"icon": "https://codeshare.xyz/public/img/logo.png",
"serverName": "Code Share",
"website": "https://codeshare.xyz",
"description": "The right place to share your own personal codes and find the code you are looking for.."
}
]
}
7 changes: 7 additions & 0 deletions src/database/models/analytics-site.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const mongoose = require("mongoose");
let hm = new mongoose.Schema({
id: String,
country: Array,
});

module.exports = mongoose.model("analytics", hm);
32 changes: 32 additions & 0 deletions src/database/models/botlist/bots.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const mongoose = require("mongoose");
let hm = new mongoose.Schema({
ownerID: String,
ownerName: String,
botID: String,
username: String,
discrim: String,
avatar: String,
prefix: String,
longDesc: String,
shortDesc: String,
tags: Array,
coowners: Array,
status: String,
website: String,
github: String,
support: String,
backURL: String,
Date: {type: Date, default: null},
certificate: String,
votes: {type: Number, default: 0},
token: String,
serverCount: Number,
shardCount: Number,
analytics: Object,
analytics_visitors: Number,
analytics_invites: Number,
country: Object,
rates: Object,
});

module.exports = mongoose.model("bots", hm);
7 changes: 7 additions & 0 deletions src/database/models/botlist/certificate-apps.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const mongoose = require('mongoose')
const schema = new mongoose.Schema({
botID: String,
hundred: String,
future: String,
})
module.exports = mongoose.model('certificate-apps', schema)
8 changes: 8 additions & 0 deletions src/database/models/botlist/vote.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const mongoose = require('mongoose')
const schema = new mongoose.Schema({
user: String,
bot: String,
ms: Number,
Date: Date
})
module.exports = mongoose.model('votes', schema)
11 changes: 11 additions & 0 deletions src/database/models/codes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const mongoose = require("mongoose");
let hm = new mongoose.Schema({
code: String,
codeName: String,
codeCategory: String,
codeDesc: String,
main: { type: String, default: null },
commands: { type: String, default: null },
});

module.exports = mongoose.model("codes", hm);
8 changes: 8 additions & 0 deletions src/database/models/maintence.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const mongoose = require("mongoose");
let hm = new mongoose.Schema({
server: String,
reason: String,
bakimmsg: String
});

module.exports = mongoose.model("bakim", hm);
11 changes: 11 additions & 0 deletions src/database/models/profile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const mongoose = require("mongoose");
let hm = new mongoose.Schema({
userID: String,
biography: {type: String, default: null},
website: {type: String, default: null},
github: {type: String, default: null},
twitter: {type: String, default: null},
instagram: {type: String, default: null}
});

module.exports = mongoose.model("profiles", hm);
22 changes: 22 additions & 0 deletions src/database/models/servers/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const mongoose = require("mongoose");
module.exports = mongoose.model("servers",
new mongoose.Schema({
id: String,
name: String,
icon: String,
ownerID: String,
longDesc: String,
shortDesc: String,
tags: Array,
link: String,
createForMe: { type: String, defaults: 'Non-Create' },
bump: {type: Date, default: null},
votes: {type: Number, default: 0},
bumps: {type: Number, default: 0},
analytics: Object,
analytics_visitors: Number,
analytics_joins: Number,
country: Object,
rates: Object
})
);
8 changes: 8 additions & 0 deletions src/database/models/servers/user.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const mongoose = require("mongoose");
module.exports = mongoose.model("user-vote-servers",
new mongoose.Schema({
id: String,
date: Date,
guild: String
})
);
8 changes: 8 additions & 0 deletions src/database/models/site-ban.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const mongoose = require("mongoose");
let hm = new mongoose.Schema({
user: String,
sebep: String,
yetkili: String
});

module.exports = mongoose.model("site-bans", hm);
10 changes: 10 additions & 0 deletions src/database/models/uptime.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const mongoose = require("mongoose");
let hm = new mongoose.Schema({
userID: String,
userName: String,
link: String,
code: String,
server: String,
});

module.exports = mongoose.model("uptime-links", hm);

0 comments on commit 25b324d

Please sign in to comment.