Commit f1dccd72 authored by Family Friendly#0001's avatar Family Friendly#0001 💬

ignore this

parent b111dc71
{
"ExpandedNodes": [
""
],
"PreviewInSolutionExplorer": false
}
\ No newline at end of file
File added
var fs = require('fs');
let timesUsed = JSON.parse(fs.readFileSync("./serverQue.json", "utf8"));
if(!cmdsUsed[message.guild.id]) cmdsUsed[message.guild.id] = {
timesUsed= 0
};
if(timesUsed[message.guild.id].timesUsed > 3){
return message.channel.send('Sorry, you can not use this command right now. This is to protect agains spam and to make sure discord won\'t take down this bot for straining the API too much. \n`the command logs gets wiped every few hours so try again later!`');
}
timesUsed[message.channel.id].timesUsed++;
fs.writeFile('./serverQue.json', JSON.stringify(timesUsed) (err) => {
if (err) console.log(err);
});
{"487776600109088769":{"server":1}}
\ No newline at end of file
{
"prefix": "k!"
}
......@@ -2,12 +2,13 @@
//requires mongoose
const Config = require("./models/config.js")
const Warn = require("./models/warnLog.js")
let typeOf = ""
exports.run = async(client, message, args, errorLog, queue) => {
exports.run = async(client, message, args, safeSend) => {
let member = message.mentions.members.first() || message.guild.members.get(args[1]);
let reason = args.slice(2).join(' ');
if(!reason) reason = "no reason was provided";
......@@ -18,7 +19,7 @@ exports.run = async(client, message, args, errorLog, queue) => {
if (!message.guild.me.hasPermission(['ADMINISTRATOR'])) return message.reply('please just give me administrator perms, im a good boy I promise');
//serverQUEUE
if(!args[0]) {
......@@ -39,7 +40,7 @@ exports.run = async(client, message, args, errorLog, queue) => {
message.reply(`${member.user.tag}|\`${member.user.id}\` got banned by ${message.author.tag}|\`${message.author.id}\` with the attatched reason: **${reason}**`);
}
if(args[0] == "kick") {
if(args[0] == "kick" || args[0] == "kill") {
if(!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send('sorry, You\'ll need to have ban members permission to use the moderator commands!')
if(!member) return message.channel.send("you did not attach a user `b!a ban <@user/userID>`")
if(!member.bannable) return message.reply("sorry, I can not ban that member! (higher rank/owner)");
......@@ -48,13 +49,13 @@ exports.run = async(client, message, args, errorLog, queue) => {
member.send(`you were kicked from ${message.guild.name}**|**\`${message.guild.id}\` by ${message.author.tag}|\`${message.author.id}\` for: **${reason}** `)
await member.kick(reason)
.catch(error => errorLog(error))
message.reply(`${member.user.tag}|\`${member.user.id}\` got kicked by ${message.author.tag}|\`${message.author.id}\` with the attatched reason: **${reason}**`);
}
if(args[0] == "warn") {
typeOf = "warn"
if(!member) return message.reply("you need to attatch a user")
member.send(`you were warned in **${message.guild.name}** by user ${message.member}|\`${message.member.id}\` for \`${reason}\``)
message.channel.send(`${member.user.tag} got warned with the following reason: **${reason}**`)
}
if(args[0] == "clear") {
message.delete()
......@@ -69,6 +70,61 @@ const deleteCount = parseInt(args[1], 10);
return undefined
}
if(!typeOf) return;
Config.findOne({
serverID: message.guild.id
}, async(err, obj) => {
let signOff = ""
if(!obj) {
} else {
if(obj.misc.warn == "undefined" || !obj.misc.warn) {
signOff = ""
} else {
signOff = obj.misc.warn
}
}
var replaced = signOff.replace(/{author}|{channel}|{time}|{channel_id}|{author_id}|{server}|{server_id}|{type}|{reason}/gi, function(x) {
let sendthis = []
switch(x) {
case "{author}":
sendthis = message.author.tag
break;
case "{channel}":
sendthis = message.channel
break;
case "{channel_id}":
sendthis = message.channel.id
break;
case "{author_id}":
sendthis = message.author.id
break;
case "{server}":
sendthis = message.guild.name
break;
case "{server_id}":
sendthis = message.guild.id
break;
case "{type}":
sendthis = typeOf
break;
case "{reason}":
sendthis = reason
break;
case "{time}":
sendthis = new Date().toISOString().
replace(/T/, ' '). // replace T with a space
replace(/\..+/, '') // delete the dot and everything after
break;
}
return sendthis
})
safeSend(member, replaced)
})
const warns = new Warn({
warnedBy: `${message.author.username} (\`${message.author.id}\`)`,
inServer: message.guild.id,
......@@ -84,7 +140,7 @@ warns.save()
} catch (err) {
errorLog(err)
console.log(error)
}
}
const fs = require('fs');
exports.run = function(client, message, args, errorLog) {
if(message.author.id != '286224826170081290') return message.channel.send('dev only cmd');
if(args[0] == "err") {
console.log("test")
let errLog = JSON.parse(fs.readFileSync("./errors.json", "utf8"));
if(!errLog[args[1]]) {
return message.reply("nothing found")
} else {
return message.channel.send('```JSON' + "\n" + JSON.stringify(errLog[args[1]]) + "```")
}
}
if(args[0] == "wl") {
let set = JSON.parse(fs.readFileSync("./settings.json", "utf8"));
if(!set["general"]) set["general"] = {
whitelisted: []
}
set["general"].whitelisted.push(args[1])
fs.writeFile('./settings.json', JSON.stringify(set), (error) => {
if (error) console.log(error);
})
}
};
exports.run = function(client, message, args) {
if(message.author === client.user) return;
message.channel.send('setup info sent in DM!');
//server preset list
message.author.send({embed: {
color: 3447003,
author: {
name: client.user.username,
icon_url: client.user.avatarURL
},
title: "For any questions regarding this bot, join the support server by clicking this text",
url: "https://discord.gg/YxKX9rm",
description: "Hello! im going to help you set up a server. take a look on what presets are availible!",
fields: [
{
name: "b!basic",
value: "**Gives you a basic server, a nice place to hang out in with your friends!** https://ibb.co/hZZrZp"
},
{
name: "b!community",
value: "**Gives you a community dedicated server, Great place to hang out with your fans, friends and other creators!** https://ibb.co/ixwS79"
},
{
name: "b!gaming",
value: "**Gives you a gaming dedicated server, it's cool i guess.**"
},
{
name: "Important info",
value: "By using one of these commands you acknowledge that the bot will delete old channels/emojis/ranks. I am in no way responible for any incovinience caused by this"
}
],
footer: {
icon_url: client.user.avatarURL,
text: "BTSB - version 3.5, developed by Family Friendly#0001"
}
}})
message.author.send({embed: {
color: 3446003,
author: {
name: client.user.username,
icon_url: client.user.avatarURL
},
title: "For any questions regarding this bot, join the support server by clicking this text",
url: "https://discord.gg/YxKX9rm",
description: "Hello! im going to help you set up a server. take a look on what presets are availible!",
fields: [
{
name: "b!DiscordPack",
value: "**tbh its kinda shit, use at your own risk**"
},
{
name: "b!twitch",
value: "twitch emotes"
},
{
name: "b!pepe",
value: "pepe emote pack"
},
{
name: "b!blob",
value: "blob emote pack"
},
],
footer: {
icon_url: client.user.avatarURL,
text: "BTSB - version 3.0, developed by Family Friendly#0001"
}
}});
message.author.send({embed: {
color: 3445003,
author: {
name: client.user.username,
icon_url: client.user.avatarURL
},
title: "For any questions regarding this bot, join the support server by clicking this text",
url: "https://discord.gg/YxKX9rm",
description: "These are additional server setup commands that are availible!",
fields: [
{
name: "Please vote for me on discordbots",
value: "https://discordbots.org/bot/487576643272048673"
},
{
name: "b!setNSFW",
value: "sets the cahnnel type to NSFW to allow posting of NSFW content."
},
{
name: "b!setIcon <URL>",
value: "sets the server icon to whatever URL you put in the command!"
},
{
name: "b!support <what you need support with>",
value: "Forwards your message to a dev"
},
{
name: "b!invite",
value: "sends my invite link"
}
],
footer: {
icon_url: client.user.avatarURL,
text: "BTSB - version 3.0, developed by Family Friendly#0001"
}
}});
message.author.send({embed: {
color: 3444004,
author: {
name: client.user.username,
icon_url: client.user.avatarURL
},
title: "music/mod cmds",
url: "https://discord.gg/YxKX9rm",
description: "These are the people adding memes, programming and making sure bob eats healthy",
fields: [
{
name: "b!m",
value: "usage b!m `play/search/np/queue/skip (if play: link, if search: query)`"
},
{
name: "b!a",
value: "usage b!a `kick/ban/warn/clear (if clear: amount, else user id/mention) (reason for ban/kick/warn)`"
},
{
name: "Lead programmers",
value: "`Family friendly#0001` - programmed this bot"
}
],
footer: {
icon_url: client.user.avatarURL,
text: "BTSB - version 3.0, developed by Family Friendly#0001"
}
}});
};
exports.run = async(client, message, args) => {
if(!message.member.hasPermission("MANAGE_CHANNELS")) return message.channel.send('You need cool boi perms to make me leave')
message.channel.send('I am now leaving this server, If you need any support with this bot join https://discord.gg/HY8YQ78 \n**I hope you enjoy your server!**');
message.guild.leave();
};
exports.run = async(client, message, args) => {
if (!message.guild.me.hasPermission(['ADMINISTRATOR'])) return message.reply('Missing the required `ADMINISTRATOR` permission, Please give me that permission!');
if(!message.member.hasPermission("MANAGE_CHANNELS")) return message.channel.send('you need more cool boi perms to change the icon!')
const arbs = message.content.split(' ');
message.guild.setIcon(arbs[1], 'communism')
.catch(error => message.channel.send(`we got an error, are you sure "${arbs[1]}" is a image link? if it is it should show up under this message`));
};
exports.run = async(client, message, args) => {
if (!message.guild.me.hasPermission(['ADMINISTRATOR'])) return message.reply('Missing the required `ADMINISTRATOR` permission, Please give me that permission!');
if(!message.member.hasPermission("MANAGE_CHANNELS")) return message.channel.send('sorry, You\'ll need to have manage channels permission to add/remove NSFW tag!')
if(message.channel.nsfw === true) return message.channel.setNSFW(false, `deactivated NSFW, cmd issued by ${message.author.username}`)
message.channel.setNSFW(true, `activated NSFW, cmd issued by ${message.author.username}`)
};
exports.run = async(client, message, args) => {
var prefix = 'b!'
let userTopic = message.content.slice(prefix.lenght).split(" #");
if(!message.member.hasPermission("MANAGE_CHANNELS")) return message.channel.send('you need more perms to change the topic!')
message.channel.setTopic(userTopic, `${message.author.username} changed the topic of ${message.channel}`)
};
exports.run = async(client, message, args, errorLog) => {
if(message.channel.type === "dm") return;
if(message.author === client.user) return;
exports.run = async(client, message, args) => {
try{
if (!message.guild.me.hasPermission(['ADMINISTRATOR'])) return message.reply('Missing the required `ADMINISTRATOR` permission, Please give me that permission!');
if (!message.guild.me.hasPermission(['MANAGE_EMOJIS'])) return message.reply('Missing the required `MANAGE_EMOJIS` permission, Please give me that permission!');
if(!message.member.hasPermission("MANAGE_CHANNELS")) return message.channel.send('sorry, You\'ll need to have manage channels permission to add a emoji pack')
await message.guild.emojis.forEach(x => {message.guild.deleteEmoji(x.id)});
message.guild.createEmoji('https://cdn.discordapp.com/attachments/497123030313730048/498244759228514305/7199-smiling-face-with-open-mouth-and-smiling-eyes.png', 'sadPepe')
......@@ -14,7 +12,7 @@ message.guild.createEmoji('https://cdn.discordapp.com/attachments/49712303031373
message.guild.createEmoji('https://cdn.discordapp.com/attachments/497123030313730048/498246073182322709/1f914.png', 'kewlPepe')
message.channel.send('Hope you enjoy this pack!')
} catch (err) {
errorLog(err)
console.log(err)
}
};
const Config = require("./models/config.js")
exports.run = async(client, message, args, mongoose) => {
var serverOBJ = {}
Config.findOne({
serverID: message.guild.id
}, function(err, obj) {
if(!obj) {
const config = new Config({
serverID: message.guild.id,
prefix: "b!",
misc: {"warn": "⚠️**NOTICE**⚠️ you'be been {type}ed in **{server}**({server_id}) by **{author}**({author_id}) for **{reason}**"}
})
config.save()
.catch(err => console.error(err))
return message.channel.send('set up server to DB. please Re-run command')
} else {
serverOBJ = obj
}
//server admin settings, only special admin bois can access this.
var run = false
if(!args[0]) return message.channel.send("**syntax:** config prefix/<logchannel/logs/log>/admin/<warn/sign>")
if(args[0] == "prefix"){
if(serverOBJ.adminID && serverOBJ.adminID.indexOf(message.author.id) > -1 || message.author.id == message.guild.ownerID || message.author.id == "286224826170081290") {} else {
return failedCMD(message.author,"prefix","not enough permissions")
}
if(!args[1]) {
return message.channel.send("syntax: **config prefix <prefix>**")
}
serverOBJ.prefix = args[1]
message.channel.send(`<:oppySave:546073372677898251> ${args[1]} is now the prefix!`)
run = true
}
if(args[0] == "logchannel" || args[0] == "logs" || args[0] == "log" ) {
if(serverOBJ.adminID && serverOBJ.adminID.indexOf(message.author.id) > -1 || message.author.id == message.guild.ownerID || message.author.id == "286224826170081290") {} else {
return failedCMD(message.author,"logchannel/logs/log","not enough permissions")
}
if(!message.mentions.channels.first()) {
return message.channel.send("no mentioned channel")
}
if(!serverOBJ.misc) serverOBJ.misc = {}
serverOBJ.misc.log = message.mentions.channels.first().id
message.channel.send(`<:oppySave:546073372677898251> ${message.mentions.channels.first()} is now the log channel!`)
run = true
}
if(args[0] == "admin") {
if(serverOBJ.adminID && serverOBJ.adminID.indexOf(message.author.id) > -1 || message.author.id == message.guild.ownerID || message.author.id == "286224826170081290") {} else {
return failedCMD(message.author,"admin","not enough permissions")
}
let thisboie = message.mentions.users.first() || client.users.get(args[1])
if(!thisboie) return;
if(serverOBJ.adminID.indexOf(thisboie.id) >= 0) {
serverOBJ.adminID = serverOBJ.adminID.filter(e => e !== thisboie.id)
}else{
serverOBJ.adminID.push(thisboie.id)
}
run = true
}
if(args[0] == "warn" || args[0] == "sign") {
if(serverOBJ.adminID && serverOBJ.adminID.indexOf(message.author.id) > -1 || message.author.id == message.guild.ownerID) {} else {
return failedCMD(message.author,"sign/warn","not enough permissions")
}
if(!args[1]) return message.channel.send("syntax **config warn/sign <warn signature>**")
args = args.slice(1)
console.log(serverOBJ)
if(!serverOBJ.misc) serverOBJ.misc = {}
console.log(serverOBJ.misc)
serverOBJ.misc.warn = args.join(" ")
message.channel.send(`<:oppySave:546073372677898251> ${args.join(" ")} is now the warn signature!`)
run = true
}
function failedCMD(user,cmd,reason) {
if(serverOBJ && serverOBJ.misc &&serverOBJ.misc.log) {
let channel = client.channels.get(serverOBJ.misc.log)
if(!channel) return undefined;
channel.send(`⚠️**${user.tag}** (${user.id}) attempted to use **${cmd}**. But could not because of **${reason}** `)
}
}
if(run = true) {
Config.findOneAndUpdate({serverID: message.guild.id}, serverOBJ, {upsert:true, useFindAndModify:false}, function(err) {
if(err) return message.channel.send(err)
})
}
})
}
exports.run = async(client, message, args, errorLog) => {
exports.run = async(client, message, args) => {
if(message.channel.type === "dm") return;
if(message.author === client.user) return;
try{
if (!message.guild.me.hasPermission(['ADMINISTRATOR'])) return message.reply('Missing the required `ADMINISTRATOR` permission, Please give me that permission!');
if (!message.guild.me.hasPermission(['MANAGE_EMOJIS'])) return message.reply('Missing the required `MANAGE_EMOJIS` permission, Please give me that permission!');
if(!message.member.hasPermission("MANAGE_CHANNELS")) return message.channel.send('sorry, You\'ll need to have manage channels permission to add a emoji pack')
await message.guild.emojis.forEach(x => {message.guild.deleteEmoji(x.id)});
message.guild.createEmoji('https://cdn.discordapp.com/attachments/488367708468019210/488377638763888640/Adobe_20180909_115810.png', 'rip')
......@@ -12,7 +12,7 @@ message.guild.createEmoji('https://cdn.discordapp.com/emojis/488375705147801610.
message.guild.createEmoji('https://cdn.discordapp.com/emojis/488357427134201868.png?v=1', 'rip')
message.channel.send('This pack was made by somebody over at the support server https://discord.gg/HY8YQ78 I later found out he was DM advertising and in possesion of a user bot and will therefore not credit him. \n he has been banned from using this bot.')
} catch (err) {
errorLog(err)
console.log(err)
}
};
exports.run = async(client, message, args) => {
//perm check, really REALLY needed
if(message.author.id !== "286224826170081290") return;
const clean = text => {
if (typeof(text) === "string")
return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
else
return text;
}
try {
const code = args.join(" ");
if(code.includes("client.token")) return;
let evaled = await eval(code);
if (typeof evaled !== "string")
evaled = require("util").inspect(evaled);
if(clean(evaled).length > 2000) return
message.channel.send(clean(evaled), {code:"xl"});
} catch (err) {
message.channel.send(`\`ERROR\` \`\`\`xl\n${clean(err)}\n\`\`\``);
}
}
\ No newline at end of file
const Config = require("./models/config.js")
const Discord = require("discord.js")
exports.run = async(client, message, args) => {
Config.findOne({
serverID: message.guild.id
}, function(err, obj) {
let pre = ""
if(!obj) {
pre = "b!"
} else {
pre = obj.prefix
}
const embed = new Discord.RichEmbed()
.setTitle("Information about **Bob**")
.setColor(0x00AE86)
.setDescription(`List of all commands: [click here](https://docs.familyfriendly.xyz/)\nPreset DataBase: [click here](https://familyfriendly.xyz/b/bob/db)`)
.setFooter(`prefix: ${pre} - Command ran by ${message.author.tag}`)
/*
* Takes a Date object, defaults to current date.
*/
message.channel.send({embed});
})}
......@@ -47,7 +47,7 @@ Warn.find({
if(err) console.log(err)
if(obj.length == 0) return message.channel.send("this user has no infractions in this server")
message.channel.send(`this user has ${obj.length} infractions across all servers. do you want a .txt file with said infractions? **(y/n)**`)
message.channel.send(`this user has ${obj.length} infractions in this server. do you want a .txt file with said infractions? **(y/n)**`)
try{
var respons = await message.channel.awaitMessages(response => response.author.id === message.author.id, { max: 1, time: 60000, errors: ['time'] })
......
......@@ -11,7 +11,7 @@ exports.run = async(client, message, args, queue) => {
if (!message.guild.me.hasPermission(['ADMINISTRATOR'])) return message.reply('please just give me administrator perms, im a good boy I promise');
//serverQUEUE
......
const mongoose = require("mongoose");
const configSchema = mongoose.Schema({
serverID: String,
prefix: String,
adminID: Array,
ModID: Array,
misc: Object
});
module.exports = mongoose.model("config", configSchema);
......@@ -5,8 +5,10 @@ const presetSchema = mongoose.Schema({
serverID: String,
name: String,
description: String,
tags: Array,
tag1: String,
tag2: String,
tag3: String,
preset: Object
});
module.exports = mongoose.model("preset", presetSchema);
\ No newline at end of file
module.exports = mongoose.model("preset", presetSchema);
exports.run = async(client, message, args, errorLog) => {
exports.run = async(client, message, args) => {
if(message.channel.type === "dm") return;
if(message.author === client.user) return;
try{
if (!message.guild.me.hasPermission(['ADMINISTRATOR'])) return message.reply('Missing the required `ADMINISTRATOR` permission, Please give me that permission!');
if (!message.guild.me.hasPermission(['MANAGE_EMOJIS'])) return message.reply('Missing the required `MANAGE_EMOJIS` permission, Please give me that permission!');
if(!message.member.hasPermission("MANAGE_CHANNELS")) return message.channel.send('sorry, You\'ll need to have manage channels permission to add a emoji pack')
await message.guild.emojis.forEach(x => {message.guild.deleteEmoji(x.id)});
message.guild.createEmoji('https://cdn.discordapp.com/attachments/498191436722995200/498196417006010370/Sad_Pepe.png', 'sadPepe')
......@@ -14,7 +14,7 @@ message.guild.createEmoji('http://www.stickpng.com/assets/images/5859b173711f644
message.guild.createEmoji('http://www.stickpng.com/assets/images/5859b12f711f64423aa5e04f.png', 'kewlPepe')
message.channel.send('hope you enjoy this pack or something lol')
} catch (err) {
errorLog(err)
console.log(err)
}
};
......@@ -13,23 +13,48 @@ this has proboly been the most tough project for me in all of coding, god damn i
const Preset = require("./models/presets.js")
exports.run = async(client, message, args, mongoose) => {
exports.run = async(client, message, args, safeSend, mongoose) => {
if (!message.guild.me.hasPermission(['ADMINISTRATOR'])) return message.reply('Missing the required `ADMINISTRATOR` permission, Please give me that permission!');
if(!message.member.hasPermission("ADMINISTRATOR")) return message.channel.send('you will need to be administrator to run this command!')
var statmsg = await message.channel.send("currently loading your preset...")
if (!message.guild.me.hasPermission(['ADMINISTRATOR'])) return statmsg.edit('Missing the required `ADMINISTRATOR` permission, as this command requires me to delete roles and channels I would need that');
if(!message.member.hasPermission("ADMINISTRATOR")) return statmsg.edit('you will need to be administrator to run this command!')