categorize cmds in file struct

master
Kit Kasune 4 years ago
parent 9b1255ccbd
commit dd4e8196be
  1. 8
      commands/anime/anime.js
  2. 82
      commands/dev/admin.js
  3. 4
      commands/dev/blacklist.js
  4. 2
      commands/dev/developer.js
  5. 94
      commands/dev/eval.js
  6. 2
      commands/dev/pull.js
  7. 2
      commands/dev/reload.js
  8. 6
      commands/dev/setstatus.js
  9. 82
      commands/dev/staff.js
  10. 82
      commands/dev/support.js
  11. 106
      commands/dev/vip.js
  12. 68
      commands/fun/8ball.js
  13. 286
      commands/fun/deathnote.js
  14. 6
      commands/fun/kiss.js
  15. 6
      commands/fun/secretsanta.js
  16. 8
      commands/fun/slap.js
  17. 4
      commands/leveling/levelchannel.js
  18. 6
      commands/leveling/levelrole.js
  19. 2
      commands/leveling/setupleveling.js
  20. 2
      commands/leveling/stats.js
  21. 6
      commands/misc/ar.js
  22. 62
      commands/misc/avatar.js
  23. 144
      commands/misc/help.js
  24. 2
      commands/misc/info.js
  25. 4
      commands/misc/ingorear.js
  26. 0
      commands/misc/invite.js
  27. 4
      commands/misc/prefix.js
  28. 0
      commands/misc/supportserver.js
  29. 2
      commands/misc/userinfo.js
  30. 2
      commands/moderation/autorole.js
  31. 6
      commands/moderation/ban.js
  32. 2
      commands/moderation/clearwarnings.js
  33. 6
      commands/moderation/kick.js
  34. 6
      commands/moderation/leave.js
  35. 168
      commands/moderation/logs.js
  36. 12
      commands/moderation/response.js
  37. 4
      commands/moderation/softban.js
  38. 4
      commands/moderation/staffrole.js
  39. 52
      commands/moderation/togglestatuses.js
  40. 0
      commands/moderation/unban.js
  41. 6
      commands/moderation/warn.js
  42. 6
      commands/moderation/welcome.js
  43. 4
      commands/social/afk.js
  44. 2
      commands/social/bio.js
  45. 4
      commands/social/clearstatus.js
  46. 6
      commands/social/cry.js
  47. 4
      commands/social/dnd.js
  48. 8
      commands/social/hug.js
  49. 6
      commands/social/sip.js
  50. 4
      commands/social/starboard.js
  51. 0
      commands/utility/randnum.js
  52. 7
      handle/command.js
  53. 2
      handle/event.js
  54. 2
      handle/response.js
  55. 2
      util/cache.js

@ -1,9 +1,9 @@
const {TagFilter} = require("../util/tagfilter"); const {TagFilter} = require("../../util/tagfilter");
const {Tag} = require ("../util/tag"); const {Tag} = require ("../../util/tag");
const Discord = require('discord.js'); const Discord = require('discord.js');
const UserData = require('../models/user'); const UserData = require('../../models/user');
const AniData = require('../models/anime'); const AniData = require('../../models/anime');
module.exports = { module.exports = {
name: "anime", name: "anime",

@ -1,42 +1,42 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const UserData = require('../models/user'); const UserData = require('../../models/user');
module.exports = { module.exports = {
name: "admin", name: "admin",
help: new Discord.MessageEmbed() help: new Discord.MessageEmbed()
.setTitle("Help -> Admin") .setTitle("Help -> Admin")
.setDescription("Make a user a Natsuki admin") .setDescription("Make a user a Natsuki admin")
.addField("Syntax", "`admin <add|remove|check> <@user|userID>`") .addField("Syntax", "`admin <add|remove|check> <@user|userID>`")
.addField("Notice", "This command is only available to Natsuki developers."), .addField("Notice", "This command is only available to Natsuki developers."),
meta: { meta: {
category: 'Developer', category: 'Developer',
description: "Add or remove users as Natsuki admins", description: "Add or remove users as Natsuki admins",
syntax: '`admin <add|remove|check> <@user|userID>`', syntax: '`admin <add|remove|check> <@user|userID>`',
extra: "You can check if a user is an admin without being a developer." extra: "You can check if a user is an admin without being a developer."
}, },
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
if (!message.guild) {return message.reply("This is a guild-only command.");} if (!message.guild) {return message.reply("This is a guild-only command.");}
if (!args.length) {return message.channel.send(`Syntax: \`${prefix}\``);} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}\``);}
let person = mention ? mention : args[1] ? client.users.cache.has(args[1]) ? client.users.cache.get(args[1]) : null : null; let person = mention ? mention : args[1] ? client.users.cache.has(args[1]) ? client.users.cache.get(args[1]) : null : null;
let tu = await UserData.findOne({uid: person ? person.id : message.author.id}) ? await UserData.findOne({uid: person ? person.id : message.author.id}) : new UserData({uid: person ? person.id : message.author.id}); let tu = await UserData.findOne({uid: person ? person.id : message.author.id}) ? await UserData.findOne({uid: person ? person.id : message.author.id}) : new UserData({uid: person ? person.id : message.author.id});
if (['c', 'check'].includes(args[0])) {return message.reply(`${person ? person : message.member.displayName} ${tu.admin ? 'is' : 'is not'} a Natsuki Admin.`);} if (['c', 'check'].includes(args[0])) {return message.reply(`${person ? person : message.member.displayName} ${tu.admin ? 'is' : 'is not'} a Natsuki Admin.`);}
if (!['a', 'add', 'r', 'remove'].includes(args[0])) {return message.reply("You must specify whether to `add` or `remove` someone as an admin.");} if (!['a', 'add', 'r', 'remove'].includes(args[0])) {return message.reply("You must specify whether to `add` or `remove` someone as an admin.");}
if (!person) {return message.reply("You must mention someone to add as an admin, or use their ID.");} if (!person) {return message.reply("You must mention someone to add as an admin, or use their ID.");}
let atu = await UserData.findOne({uid: message.author.id}); let atu = await UserData.findOne({uid: message.author.id});
if (!atu && !atu.developer && !client.developers.includes(message.author.id)) {return message.reply('You must be a developer in order to add set admin statuses.');} if (!atu && !atu.developer && !client.developers.includes(message.author.id)) {return message.reply('You must be a developer in order to add set admin statuses.');}
if (['a', 'add'].includes(args[0])) {tu.support = true; tu.staff = true; tu.admin = true;} if (['a', 'add'].includes(args[0])) {tu.support = true; tu.staff = true; tu.admin = true;}
else {tu.admin = false; tu.developer = false;} else {tu.admin = false; tu.developer = false;}
tu.save(); tu.save();
const logemb = (act) => new Discord.MessageEmbed() const logemb = (act) => new Discord.MessageEmbed()
.setAuthor(`Admin ${act}`, message.author.avatarURL()) .setAuthor(`Admin ${act}`, message.author.avatarURL())
.setDescription("A user's Admin status was updated.") .setDescription("A user's Admin status was updated.")
.setThumbnail(person.avatarURL({size: 1024})) .setThumbnail(person.avatarURL({size: 1024}))
.addField("Name", person.username, true) .addField("Name", person.username, true)
.addField("Developer", message.author.username, true) .addField("Developer", message.author.username, true)
.setColor("e8da3a") .setColor("e8da3a")
.setFooter("Natsuki") .setFooter("Natsuki")
.setTimestamp(); .setTimestamp();
client.guilds.cache.get('762707532417335296').channels.cache.get('762732961753595915').send(logemb(['a', 'add'].includes(args[0]) ? 'Added' : 'Removed')); client.guilds.cache.get('762707532417335296').channels.cache.get('762732961753595915').send(logemb(['a', 'add'].includes(args[0]) ? 'Added' : 'Removed'));
return message.reply(`${message.guild.members.cache.get(person.id).displayName} is no${['a', 'add'].includes(args[0]) ? 'w' : ' longer'} an admin!`); return message.reply(`${message.guild.members.cache.get(person.id).displayName} is no${['a', 'add'].includes(args[0]) ? 'w' : ' longer'} an admin!`);
} }
}; };

@ -1,6 +1,6 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const UserData = require('../models/user'); const UserData = require('../../models/user');
const GuildData = require('../models/guild') const GuildData = require('../../models/guild')
module.exports = { module.exports = {
name: "blacklist", name: "blacklist",

@ -1,6 +1,6 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const mongoose = require('mongoose'); const mongoose = require('mongoose');
const UserData = require('../models/user'); const UserData = require('../../models/user');
module.exports = { module.exports = {
name: "developer", name: "developer",

@ -1,48 +1,48 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const chalk = require('chalk'); const chalk = require('chalk');
const {Tag} = require('../util/tag'); const {Tag} = require('../../util/tag');
const {TagFilter} = require('../util/tagfilter'); const {TagFilter} = require('../../util/tagfilter');
module.exports = { module.exports = {
name: 'eval', name: 'eval',
aliases: ['ev', ':', 'e'], aliases: ['ev', ':', 'e'],
help: "Evaluates raw JavaScript code. *This is a __developer-only__ command.* Usage: `{{p}}eval <code>`", help: "Evaluates raw JavaScript code. *This is a __developer-only__ command.* Usage: `{{p}}eval <code>`",
meta: { meta: {
category: 'Developer', category: 'Developer',
description: "Evaluates raw JavaScript code. Nerd access only.", description: "Evaluates raw JavaScript code. Nerd access only.",
syntax: '`eval <code>`', syntax: '`eval <code>`',
extra: null extra: null
}, },
execute(message, msg, args, cmd, prefix, mention, client) { execute(message, msg, args, cmd, prefix, mention, client) {
try { try {
if (!client.developers.includes(message.author.id)) {return message.channel.send("Sorry, but I've got trust issues, so only me devs can go commanding me around like that.");}; if (!client.developers.includes(message.author.id)) {return message.channel.send("Sorry, but I've got trust issues, so only me devs can go commanding me around like that.");};
if (!args.length) return message.channel.send(`Syntax: \`${prefix}eval <code>\``); if (!args.length) return message.channel.send(`Syntax: \`${prefix}eval <code>\``);
let options = new TagFilter([new Tag(['s', 'silent', 'nr', 'noreply'], 'silent', 'toggle')]).test(args[0]); let options = new TagFilter([new Tag(['s', 'silent', 'nr', 'noreply'], 'silent', 'toggle')]).test(args[0]);
if (options.silent) {args.shift();} if (options.silent) {args.shift();}
if (!args.length) {return message.channel.send("Silly goose, if you want me to do something, you have to tell me what!");} if (!args.length) {return message.channel.send("Silly goose, if you want me to do something, you have to tell me what!");}
const result = new Promise((resolve) => resolve(eval(args.join(' ')))); const result = new Promise((resolve) => resolve(eval(args.join(' '))));
return result.then((output) => { return result.then((output) => {
if (typeof output !== 'string') { if (typeof output !== 'string') {
output = require('util').inspect(output, {depth: 0}); output = require('util').inspect(output, {depth: 0});
} }
output = output.replace(client.config.token, 'Client Token') output = output.replace(client.config.token, 'Client Token')
.replace(client.config.database.password, 'Database Password') .replace(client.config.database.password, 'Database Password')
.replace(client.config.database.cluster, 'Database Cluster'); .replace(client.config.database.cluster, 'Database Cluster');
return options.silent ? null : message.channel.send(new Discord.MessageEmbed() return options.silent ? null : message.channel.send(new Discord.MessageEmbed()
.setTitle('Client Evaluation') .setTitle('Client Evaluation')
.setDescription(`\`\`\`js\n${output}\n\`\`\``) .setDescription(`\`\`\`js\n${output}\n\`\`\``)
.setColor('c375f0') .setColor('c375f0')
.setFooter(`Natsuki`, client.user.avatarURL()) .setFooter(`Natsuki`, client.user.avatarURL())
.setTimestamp()); .setTimestamp());
}).catch(error => {return message.channel.send(`Error: \`${error}\`.`);}); }).catch(error => {return message.channel.send(`Error: \`${error}\`.`);});
} catch (error) { } catch (error) {
let date = new Date; date = date.toString().slice(date.toString().search(":") - 2, date.toString().search(":") + 6); let date = new Date; date = date.toString().slice(date.toString().search(":") - 2, date.toString().search(":") + 6);
console.error(`\n${chalk.red('[ERROR]')} >> ${chalk.yellow(`At [${date}] | Occurred while trying to run n?eval`)}`, error); console.error(`\n${chalk.red('[ERROR]')} >> ${chalk.yellow(`At [${date}] | Occurred while trying to run n?eval`)}`, error);
return message.channel.send(`Error: \`${error}\`.`); return message.channel.send(`Error: \`${error}\`.`);
} }
}, },
}; };

@ -1,7 +1,7 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const fs = require('fs'); const fs = require('fs');
const chalk = require('chalk'); const chalk = require('chalk');
const UserData = require('../models/user'); const UserData = require('../../models/user');
const cp = require('child_process'); const cp = require('child_process');
module.exports = { module.exports = {

@ -3,7 +3,7 @@ const fs = require('fs');
const chalk = require('chalk'); const chalk = require('chalk');
const ora = require('ora'); const ora = require('ora');
const UserData = require("../models/user"); const UserData = require("../../models/user");
module.exports = { module.exports = {
name: "reload", name: "reload",

@ -1,9 +1,9 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const UserData = require('../models/user'); const UserData = require('../../models/user');
const {TagFilter} = require('../util/tagfilter'); const {TagFilter} = require('../../util/tagfilter');
const {Tag} = require('../util/tag'); const {Tag} = require('../../util/tag');
module.exports = { module.exports = {
name: "setstatus", name: "setstatus",

@ -1,42 +1,42 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const UserData = require('../models/user'); const UserData = require('../../models/user');
module.exports = { module.exports = {
name: "staff", name: "staff",
help: new Discord.MessageEmbed() help: new Discord.MessageEmbed()
.setTitle("Help -> Staff") .setTitle("Help -> Staff")
.setDescription("Make a user a Natsuki staff member") .setDescription("Make a user a Natsuki staff member")
.addField("Syntax", "`staff <add|remove|check> <@user|userID>`") .addField("Syntax", "`staff <add|remove|check> <@user|userID>`")
.addField("Notice", "This command is only available to Natsuki developers."), .addField("Notice", "This command is only available to Natsuki developers."),
meta: { meta: {
category: 'Developer', category: 'Developer',
description: "Add or remove users as Natsuki staff", description: "Add or remove users as Natsuki staff",
syntax: '`staff <add|remove|check> <@user|userID>`', syntax: '`staff <add|remove|check> <@user|userID>`',
extra: "You can check if a user is staff without being a developer." extra: "You can check if a user is staff without being a developer."
}, },
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
if (!message.guild) {return message.reply("This is a guild-only command.");} if (!message.guild) {return message.reply("This is a guild-only command.");}
if (!args.length) {return message.channel.send(`Syntax: \`${prefix}\``);} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}\``);}
let person = mention ? mention : args[1] ? client.users.cache.has(args[1]) ? client.users.cache.get(args[1]) : null : null; let person = mention ? mention : args[1] ? client.users.cache.has(args[1]) ? client.users.cache.get(args[1]) : null : null;
let tu = await UserData.findOne({uid: person ? person.id : message.author.id}) ? await UserData.findOne({uid: person ? person.id : message.author.id}) : new UserData({uid: person ? person.id : message.author.id}); let tu = await UserData.findOne({uid: person ? person.id : message.author.id}) ? await UserData.findOne({uid: person ? person.id : message.author.id}) : new UserData({uid: person ? person.id : message.author.id});
if (['c', 'check'].includes(args[0])) {return message.reply(`${person ? person : message.member.displayName} ${tu.staff ? 'is' : 'is not'} a part of Natsuki Staff.`);} if (['c', 'check'].includes(args[0])) {return message.reply(`${person ? person : message.member.displayName} ${tu.staff ? 'is' : 'is not'} a part of Natsuki Staff.`);}
if (!['a', 'add', 'r', 'remove'].includes(args[0])) {return message.reply("You must specify whether to `add` or `remove` someone as a Staff Member.");} if (!['a', 'add', 'r', 'remove'].includes(args[0])) {return message.reply("You must specify whether to `add` or `remove` someone as a Staff Member.");}
if (!person) {return message.reply("You must mention someone to add as a staff member, or use their ID.");} if (!person) {return message.reply("You must mention someone to add as a staff member, or use their ID.");}
let atu = await UserData.findOne({uid: message.author.id}); let atu = await UserData.findOne({uid: message.author.id});
if (!atu && !atu.developer && !client.developers.includes(message.author.id)) {return message.reply('You must be a developer in order to add set staff member statuses.');} if (!atu && !atu.developer && !client.developers.includes(message.author.id)) {return message.reply('You must be a developer in order to add set staff member statuses.');}
if (['a', 'add'].includes(args[0])) {tu.support = true; tu.staff = true;} if (['a', 'add'].includes(args[0])) {tu.support = true; tu.staff = true;}
else {tu.staff = false; tu.admin = false; tu.developer = false;} else {tu.staff = false; tu.admin = false; tu.developer = false;}
tu.save(); tu.save();
const logemb = (act) => new Discord.MessageEmbed() const logemb = (act) => new Discord.MessageEmbed()
.setAuthor(`Staff ${act}`, message.author.avatarURL()) .setAuthor(`Staff ${act}`, message.author.avatarURL())
.setDescription("A user's Staff status was updated.") .setDescription("A user's Staff status was updated.")
.setThumbnail(person.avatarURL({size: 1024})) .setThumbnail(person.avatarURL({size: 1024}))
.addField("Name", person.username, true) .addField("Name", person.username, true)
.addField("Developer", message.author.username, true) .addField("Developer", message.author.username, true)
.setColor("e8da3a") .setColor("e8da3a")
.setFooter("Natsuki") .setFooter("Natsuki")
.setTimestamp(); .setTimestamp();
client.guilds.cache.get('762707532417335296').channels.cache.get('762732961753595915').send(logemb(['a', 'add'].includes(args[0]) ? 'Added' : 'Removed')); client.guilds.cache.get('762707532417335296').channels.cache.get('762732961753595915').send(logemb(['a', 'add'].includes(args[0]) ? 'Added' : 'Removed'));
return message.reply(`${message.guild.members.cache.get(person.id).displayName} is no${['a', 'add'].includes(args[0]) ? 'w' : ' longer'} a staff member!`); return message.reply(`${message.guild.members.cache.get(person.id).displayName} is no${['a', 'add'].includes(args[0]) ? 'w' : ' longer'} a staff member!`);
} }
}; };

@ -1,42 +1,42 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const UserData = require('../models/user'); const UserData = require('../../models/user');
module.exports = { module.exports = {
name: "support", name: "support",
help: new Discord.MessageEmbed() help: new Discord.MessageEmbed()
.setTitle("Help -> Support") .setTitle("Help -> Support")
.setDescription("Make a user a Natsuki Support Team member") .setDescription("Make a user a Natsuki Support Team member")
.addField("Syntax", "`support <add|remove|check> <@user|userID>`") .addField("Syntax", "`support <add|remove|check> <@user|userID>`")
.addField("Notice", "This command is only available to Natsuki admin."), .addField("Notice", "This command is only available to Natsuki admin."),
meta: { meta: {
category: 'Developer', category: 'Developer',
description: "Add or remove users as Natsuki support", description: "Add or remove users as Natsuki support",
syntax: '`support <add|remove|check> <@user|userID>`', syntax: '`support <add|remove|check> <@user|userID>`',
extra: "You can check if a user is a support member without being a developer." extra: "You can check if a user is a support member without being a developer."
}, },
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
if (!message.guild) {return message.reply("This is a guild-only command.");} if (!message.guild) {return message.reply("This is a guild-only command.");}
if (!args.length) {return message.channel.send(`Syntax: \`${prefix}\``);} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}\``);}
let person = mention ? mention : args[1] ? client.users.cache.has(args[1]) ? client.users.cache.get(args[1]) : null : null; let person = mention ? mention : args[1] ? client.users.cache.has(args[1]) ? client.users.cache.get(args[1]) : null : null;
let tu = await UserData.findOne({uid: person ? person.id : message.author.id}) ? await UserData.findOne({uid: person ? person.id : message.author.id}) : new UserData({uid: person ? person.id : message.author.id}); let tu = await UserData.findOne({uid: person ? person.id : message.author.id}) ? await UserData.findOne({uid: person ? person.id : message.author.id}) : new UserData({uid: person ? person.id : message.author.id});
if (['c', 'check'].includes(args[0])) {return message.reply(`${person ? person : message.member.displayName} ${tu.support ? 'is' : 'is not'} a part of Natsuki Support.`);} if (['c', 'check'].includes(args[0])) {return message.reply(`${person ? person : message.member.displayName} ${tu.support ? 'is' : 'is not'} a part of Natsuki Support.`);}
if (!['a', 'add', 'r', 'remove'].includes(args[0])) {return message.reply("You must specify whether to `add` or `remove` someone as a Support Team Member.");} if (!['a', 'add', 'r', 'remove'].includes(args[0])) {return message.reply("You must specify whether to `add` or `remove` someone as a Support Team Member.");}
if (!person) {return message.reply("You must mention someone to add as a support member, or use their ID.");} if (!person) {return message.reply("You must mention someone to add as a support member, or use their ID.");}
let atu = await UserData.findOne({uid: message.author.id}); let atu = await UserData.findOne({uid: message.author.id});
if (!atu && !atu.admin) {return message.reply('You must be an admin in order to add set support team member statuses.');} if (!atu && !atu.admin) {return message.reply('You must be an admin in order to add set support team member statuses.');}
if (['a', 'add'].includes(args[0])) {tu.support = true;} if (['a', 'add'].includes(args[0])) {tu.support = true;}
else {tu.support = false; tu.staff = false; tu.admin = false; tu.developer = false;} else {tu.support = false; tu.staff = false; tu.admin = false; tu.developer = false;}
tu.save(); tu.save();
const logemb = (act) => new Discord.MessageEmbed() const logemb = (act) => new Discord.MessageEmbed()
.setAuthor(`Support ${act}`, message.author.avatarURL()) .setAuthor(`Support ${act}`, message.author.avatarURL())
.setDescription("A user's Support status was updated.") .setDescription("A user's Support status was updated.")
.setThumbnail(person.avatarURL({size: 1024})) .setThumbnail(person.avatarURL({size: 1024}))
.addField("Name", person.username, true) .addField("Name", person.username, true)
.addField("Developer", message.author.username, true) .addField("Developer", message.author.username, true)
.setColor("e8da3a") .setColor("e8da3a")
.setFooter("Natsuki") .setFooter("Natsuki")
.setTimestamp(); .setTimestamp();
client.guilds.cache.get('762707532417335296').channels.cache.get('762732961753595915').send(logemb(['a', 'add'].includes(args[0]) ? 'Added' : 'Removed')); client.guilds.cache.get('762707532417335296').channels.cache.get('762732961753595915').send(logemb(['a', 'add'].includes(args[0]) ? 'Added' : 'Removed'));
return message.reply(`${message.guild.members.cache.get(person.id).displayName} is no${['a', 'add'].includes(args[0]) ? 'w' : ' longer'} a Support Team member!`); return message.reply(`${message.guild.members.cache.get(person.id).displayName} is no${['a', 'add'].includes(args[0]) ? 'w' : ' longer'} a Support Team member!`);
} }
}; };

@ -1,54 +1,54 @@
const Discord = require("discord.js"); const Discord = require("discord.js");
module.exports = { module.exports = {
name: "vip", name: "vip",
aliases: ["premium"], aliases: ["premium"],
help: new Discord.MessageEmbed() help: new Discord.MessageEmbed()
.setTitle("Help -> VIP") .setTitle("Help -> VIP")
.setDescription("Toggle a server as VIP. This grants a few small bonuses to your server that you can't get anywhere else!\n\nWant to become a VIP? Support the bot by [joining the support server](), donating to the bot's creators, or promoting/spreading the bot to other servers.") .setDescription("Toggle a server as VIP. This grants a few small bonuses to your server that you can't get anywhere else!\n\nWant to become a VIP? Support the bot by [joining the support server](), donating to the bot's creators, or promoting/spreading the bot to other servers.")
.addField("Syntax", "`vip <add|remove|check>`") .addField("Syntax", "`vip <add|remove|check>`")
.addField("Notice", "This command is **developer-only**."), .addField("Notice", "This command is **developer-only**."),
meta: { meta: {
category: 'Developer', category: 'Developer',
description: "Set server VIP status", description: "Set server VIP status",
syntax: '`vip <add|remove|check>`', syntax: '`vip <add|remove|check>`',
extra: "This command is mostly cosmetic as there are no real perks *yet*" extra: "This command is mostly cosmetic as there are no real perks *yet*"
}, },
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
if (!message.guild) {return message.reply("This command is server-only!");} if (!message.guild) {return message.reply("This command is server-only!");}
if (!args.length) {return message.channel.send(`Syntax: \`${prefix}vip <add|remove|check>\``);} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}vip <add|remove|check>\``);}
if (!client.developers.includes(message.author.id) && !['check', 'c', 'view', 'v'].includes(args[0])) {return message.reply("Unfortunately, this is a **developer-only command**!");} if (!client.developers.includes(message.author.id) && !['check', 'c', 'view', 'v'].includes(args[0])) {return message.reply("Unfortunately, this is a **developer-only command**!");}
const GuildSettings = require('../models/guild'); const GuildSettings = require('../../models/guild');
const logemb = (act) => new Discord.MessageEmbed() const logemb = (act) => new Discord.MessageEmbed()
.setAuthor(`VIP Server ${act}`, message.author.avatarURL()) .setAuthor(`VIP Server ${act}`, message.author.avatarURL())
.setDescription("A Server's VIP status was updated.") .setDescription("A Server's VIP status was updated.")
.setThumbnail(message.guild.iconURL({size: 1024})) .setThumbnail(message.guild.iconURL({size: 1024}))
.addField("Name", message.guild.name, true) .addField("Name", message.guild.name, true)
.addField("Admin", message.author.username, true) .addField("Admin", message.author.username, true)
.setColor("e8da3a") .setColor("e8da3a")
.setFooter("Natsuki") .setFooter("Natsuki")
.setTimestamp(); .setTimestamp();
if (['add', 'a', 'make', 'm'].includes(args[0])) { if (['add', 'a', 'make', 'm'].includes(args[0])) {
let tguild = await GuildSettings.findOne({gid: message.guild.id}) let tguild = await GuildSettings.findOne({gid: message.guild.id})
? await GuildSettings.findOne({gid: message.guild.id}) ? await GuildSettings.findOne({gid: message.guild.id})
: new GuildSettings({gid: message.guild.id}); : new GuildSettings({gid: message.guild.id});
if (tguild.vip === true) {return message.reply("This server is already a VIP server.");} if (tguild.vip === true) {return message.reply("This server is already a VIP server.");}
tguild.vip = true; tguild.vip = true;
tguild.save(); tguild.save();
client.guilds.cache.get('762707532417335296').channels.cache.get('762732961753595915').send(logemb("Added")); client.guilds.cache.get('762707532417335296').channels.cache.get('762732961753595915').send(logemb("Added"));
return message.reply("This server is now a VIP server!"); return message.reply("This server is now a VIP server!");
} else if (['remove', 'r', 'delete', 'd'].includes(args[0])) { } else if (['remove', 'r', 'delete', 'd'].includes(args[0])) {
let tguild = await GuildSettings.findOne({gid: message.guild.id}); let tguild = await GuildSettings.findOne({gid: message.guild.id});
if (tguild) { if (tguild) {
if (tguild.vip === false) {return message.reply("This server wasn't a VIP server anyways...");} if (tguild.vip === false) {return message.reply("This server wasn't a VIP server anyways...");}
await GuildSettings.findOneAndUpdate({gid: message.guild.id, vip: false}); await GuildSettings.findOneAndUpdate({gid: message.guild.id, vip: false});
client.guilds.cache.get('762707532417335296').channels.cache.get('762732961753595915').send(logemb("Removed")); client.guilds.cache.get('762707532417335296').channels.cache.get('762732961753595915').send(logemb("Removed"));
} else {return message.reply("This server wasn't a VIP server anyways...");} } else {return message.reply("This server wasn't a VIP server anyways...");}
return message.reply("This server is no longer a VIP server!"); return message.reply("This server is no longer a VIP server!");
} else if (['check', 'c', 'view', 'v'].includes(args[0])) { } else if (['check', 'c', 'view', 'v'].includes(args[0])) {
let tguild = await GuildSettings.findOne({gid: message.guild.id}); let tguild = await GuildSettings.findOne({gid: message.guild.id});
return message.reply((tguild && tguild.vip) ? 'This server is a VIP server.' : 'This server is not a VIP server.'); return message.reply((tguild && tguild.vip) ? 'This server is a VIP server.' : 'This server is not a VIP server.');
} }
} }
}; };

@ -1,35 +1,35 @@
const Discord = require("discord.js"); const Discord = require("discord.js");
module.exports = { module.exports = {
name: "8ball", name: "8ball",
aliases: ["8b"], aliases: ["8b"],
help: new Discord.MessageEmbed() help: new Discord.MessageEmbed()
.setTitle("Help -> 8ball") .setTitle("Help -> 8ball")
.setDescription("Gives you moral support, decides if you really do want that third taco, or helps you decide on your existential crisis. Answers come with an accuracy guarantee of 0%!") .setDescription("Gives you moral support, decides if you really do want that third taco, or helps you decide on your existential crisis. Answers come with an accuracy guarantee of 0%!")
.addField("Syntax", "`8ball <question>`"), .addField("Syntax", "`8ball <question>`"),
meta: { meta: {
category: 'Fun', category: 'Fun',
description: "Gives you moral support, decides if you really do want that third taco, or helps you decide on your existential crisis. Answers come with an accuracy guarantee of 0%!", description: "Gives you moral support, decides if you really do want that third taco, or helps you decide on your existential crisis. Answers come with an accuracy guarantee of 0%!",
syntax: '`8ball <question>`', syntax: '`8ball <question>`',
extra: null extra: null
}, },
execute(message, msg, args, cmd, prefix, mention, client) { execute(message, msg, args, cmd, prefix, mention, client) {
if (!args.length) {return message.channel.send(`Syntax: \`${prefix}8ball <question>\``);} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}8ball <question>\``);}
let question = args.join(" "); let question = args.join(" ");
if (question.length > 230) {return message.reply("Listen, I'm no fortune-teller. I can't help you with a question that long!");} if (question.length > 230) {return message.reply("Listen, I'm no fortune-teller. I can't help you with a question that long!");}
let responses = [ let responses = [
/*Positive Responses*/ "Yes!", "I think so", "Possibly", "Certainly", "Definitely", "Absolutely", "Sure!", "Most Likely", "I believe so", "If you're asking for my honest opinion... yes" /*Positive Responses*/ "Yes!", "I think so", "Possibly", "Certainly", "Definitely", "Absolutely", "Sure!", "Most Likely", "I believe so", "If you're asking for my honest opinion... yes"
/*Negative Responses*/ ,"No!", "I don't think so", "Probably not", "Impossible", "Nope", "Absolutely *not*", "Nah", "Doubt it", "I don't believe so", "If you're asking for my honest opinion... no" /*Negative Responses*/ ,"No!", "I don't think so", "Probably not", "Impossible", "Nope", "Absolutely *not*", "Nah", "Doubt it", "I don't believe so", "If you're asking for my honest opinion... no"
/*Neutral Responses */ ,"Maybe", "I'm not sure", "I'll think about it", "Uhh Natsuki isn't here right now. I can take a message?", "I'm sure if you look deep within your heart, which is currently all over that tree, you'll find the answer", "I mean, if you think so...", "I don't have an opinion on that.", "I'll choose to remain silent." /*Neutral Responses */ ,"Maybe", "I'm not sure", "I'll think about it", "Uhh Natsuki isn't here right now. I can take a message?", "I'm sure if you look deep within your heart, which is currently all over that tree, you'll find the answer", "I mean, if you think so...", "I don't have an opinion on that.", "I'll choose to remain silent."
]; ];
let name = message.guild ? message.member.displayName : message.author.username; let name = message.guild ? message.member.displayName : message.author.username;
return message.reply(new Discord.MessageEmbed() return message.reply(new Discord.MessageEmbed()
.setAuthor("8ball Question", message.author.avatarURL()) .setAuthor("8ball Question", message.author.avatarURL())
.setDescription("**Question:** " + question + "\n**Answer:** " + responses[Math.floor(Math.random() * responses.length)]) .setDescription("**Question:** " + question + "\n**Answer:** " + responses[Math.floor(Math.random() * responses.length)])
.setColor("c375f0") .setColor("c375f0")
.setFooter(`Asked by ${name} | Natsuki`) .setFooter(`Asked by ${name} | Natsuki`)
.setTimestamp()); .setTimestamp());
} }
}; };

@ -1,144 +1,144 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const moment = require('moment'); const moment = require('moment');
const VC = require('../models/vscount'); const VC = require('../../models/vscount');
const {Tag} = require('../util/tag'); const {Tag} = require('../../util/tag');
const {TagFilter} = require('../util/tagfilter'); const {TagFilter} = require('../../util/tagfilter');
const deaths = [ const deaths = [
"watching too much anime", "an overdose of waifus", "Hypotakunemia", "trying to self-isekai", "watching too much anime", "an overdose of waifus", "Hypotakunemia", "trying to self-isekai",
"Bass:tm:", "cranking the music just a little too loud", "trying to swim in lava", "an unknown cause", "Bass:tm:", "cranking the music just a little too loud", "trying to swim in lava", "an unknown cause",
"Despacito", "something really cliche and unoriginal", "'shrooms", "Despacito", "something really cliche and unoriginal", "'shrooms",
"clicking 'I agree' without reading the Terms of Service", "alchemy", "rusty spoons", "clicking 'I agree' without reading the Terms of Service", "alchemy", "rusty spoons",
"picking the wrong waifu", "body pillows", "fur-con", "something to do with lamb sauce", "picking the wrong waifu", "body pillows", "fur-con", "something to do with lamb sauce",
"grandma's cookies" "grandma's cookies"
]; // a list of preset death methods that can occur ]; // a list of preset death methods that can occur
const before = [ const before = [
"A name is being written...", "Someone will perish soon...", "A body is *about* to be discovered...", "A name is being written...", "Someone will perish soon...", "A body is *about* to be discovered...",
"{p} is scribbling something in their notebook...", "\*Manical laughter echoes around you*...", "{p} is scribbling something in their notebook...", "\*Manical laughter echoes around you*...",
"{p} laughs maniacally..." "{p} laughs maniacally..."
]; // things it says before the response is sent ]; // things it says before the response is sent
const responses = { const responses = {
/*an obj controlling the possible formats for the death note report*/ /*an obj controlling the possible formats for the death note report*/
news: { news: {
titles: ["Breaking News"], titles: ["Breaking News"],
texts: [ texts: [
"This just in: **{p}** was found dead at **{ds}** today.\n\nAfter some investigation, the authorities ruled the cause of death to be **{c}**.", "This just in: **{p}** was found dead at **{ds}** today.\n\nAfter some investigation, the authorities ruled the cause of death to be **{c}**.",
"We're now live at the crime scene where it is believed that **{p}** died because of **{c}**.", "We're now live at the crime scene where it is believed that **{p}** died because of **{c}**.",
"Authorities are reporting what is believed to be another Kira case, where **{c}** has taken the life of **{p}**." "Authorities are reporting what is believed to be another Kira case, where **{c}** has taken the life of **{p}**."
], ],
images: [], images: [],
}, // a news report of the dead body }, // a news report of the dead body
writes: { writes: {
titles: ["Something sinister just happened", "A name has been written", "Fate has been changed"], titles: ["Something sinister just happened", "A name has been written", "Fate has been changed"],
texts: [ texts: [
"With a maniacal laugh, **{w}** writes \"**{p}**\" in their Death Note. And the cause of death? They've written **{c}**.", "With a maniacal laugh, **{w}** writes \"**{p}**\" in their Death Note. And the cause of death? They've written **{c}**.",
"**{w}** has sealed **{pa}** fate to die by **{c}**." "**{w}** has sealed **{pa}** fate to die by **{c}**."
], ],
images: [] images: []
}, // "so-and-so writes blah blah blah's name in their death note" }, // "so-and-so writes blah blah blah's name in their death note"
/*hasdied: { /*hasdied: {
texts: [], texts: [],
images: [] images: []
}, // "so-and-so has died by...", }, // "so-and-so has died by...",
unserious: { unserious: {
texts: [], texts: [],
images: [] images: []
} // other methods, mainly the un-serious or joking ones */ } // other methods, mainly the un-serious or joking ones */
}; };
//responses.unserious.images = responses.hasdied.images; //responses.unserious.images = responses.hasdied.images;
module.exports = { module.exports = {
name: "deathnote", name: "deathnote",
aliases: ['dn'], aliases: ['dn'],
help: new Discord.MessageEmbed() help: new Discord.MessageEmbed()
.setTitle("Help -> Death Note") .setTitle("Help -> Death Note")
.setDescription("Congratulations! You've picked up a death note. Write someone's name in it, and see for yourself if it's the real deal...") .setDescription("Congratulations! You've picked up a death note. Write someone's name in it, and see for yourself if it's the real deal...")
.addField("Syntax", "\`deathnote <@member> [method of death]\`"), .addField("Syntax", "\`deathnote <@member> [method of death]\`"),
meta: { meta: {
category: 'Fun', category: 'Fun',
description: "Write someone's name in your deathnote. I'm not legally responsible for anything that happens after that.", description: "Write someone's name in your deathnote. I'm not legally responsible for anything that happens after that.",
syntax: '`deathnote <@member> [method of death]`', syntax: '`deathnote <@member> [method of death]`',
extra: null extra: null
}, },
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
if (!message.guild) {return message.reply("Unfortunately, this is a **guild-only** command!");} if (!message.guild) {return message.reply("Unfortunately, this is a **guild-only** command!");}
if (!args.length) {return message.channel.send(`Syntax: \`${prefix}deathnote <@member> [method of death]\``);} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}deathnote <@member> [method of death]\``);}
if (args[0] === "kill" || args[0] === "k") {args.shift();} // if someone adds in 'kill' it'll remove it and act like it wasn't there, proceeding as normal. if (args[0] === "kill" || args[0] === "k") {args.shift();} // if someone adds in 'kill' it'll remove it and act like it wasn't there, proceeding as normal.
//if (!args[0].trim().match(/^<@(?:\!?)\d+>$/)) {return message.reply("You have to mention someone!");} //if (!args[0].trim().match(/^<@(?:\!?)\d+>$/)) {return message.reply("You have to mention someone!");}
if (mention && mention.id === message.author.id) {return message.reply("Hehe I won't let you write your own name in the notebook! Just leave it somewhere for a few days and someone else will take it. Maybe they'll write your name...");} // users can't mention themselves if (mention && mention.id === message.author.id) {return message.reply("Hehe I won't let you write your own name in the notebook! Just leave it somewhere for a few days and someone else will take it. Maybe they'll write your name...");} // users can't mention themselves
if (mention && mention.id === client.user.id) {return message.reply("You can't kill me! Little did you know, I'm actually a death god!");} if (mention && mention.id === client.user.id) {return message.reply("You can't kill me! Little did you know, I'm actually a death god!");}
if (mention && mention.bot) {return message.reply("As a bot, I simply cannot let you attempt to kill another fellow bot!");} if (mention && mention.bot) {return message.reply("As a bot, I simply cannot let you attempt to kill another fellow bot!");}
let reptype = responses[Object.keys(responses)[Math.floor(Math.random() * Object.keys(responses).length)]]; // report type let reptype = responses[Object.keys(responses)[Math.floor(Math.random() * Object.keys(responses).length)]]; // report type
let title = reptype.titles[Math.floor(Math.random() * reptype.titles.length)]; let title = reptype.titles[Math.floor(Math.random() * reptype.titles.length)];
let options = new TagFilter([ let options = new TagFilter([
new Tag(['method', '-m', 'cause', '-c'], 'method', 'append'), new Tag(['method', '-m', 'cause', '-c'], 'method', 'append'),
new Tag(['victim', 'v', 'against', 'a', 'name', 'n'], 'victim', 'append') new Tag(['victim', 'v', 'against', 'a', 'name', 'n'], 'victim', 'append')
]).test(args.join(" ")); ]).test(args.join(" "));
let death = (!options.victim || (options.victim && !options.victim.length)) && (!options.method || (options.method && !options.method.length)) && args.length > 1 let death = (!options.victim || (options.victim && !options.victim.length)) && (!options.method || (options.method && !options.method.length)) && args.length > 1
? args.join(" ").slice(args[0].length + 1) ? args.join(" ").slice(args[0].length + 1)
: deaths[Math.floor(Math.random() * deaths.length)]; //kill method : deaths[Math.floor(Math.random() * deaths.length)]; //kill method
if (options.method && options.method.length) {death = options.method;} if (options.method && options.method.length) {death = options.method;}
if (death.length > 750) {return message.channel.send("I'd rather you didn't try to fill the death note with a 7-page double-spaced essay in Times New Roman containing an advanced trajectory theorem on the death of your poor target.");} if (death.length > 750) {return message.channel.send("I'd rather you didn't try to fill the death note with a 7-page double-spaced essay in Times New Roman containing an advanced trajectory theorem on the death of your poor target.");}
if (!mention && (!options.victim || !options.victim.length)) {return message.reply("You have to write their name down in order to kill them! (In other words, please mention the user whose name you wish to write.)");} if (!mention && (!options.victim || !options.victim.length)) {return message.reply("You have to write their name down in order to kill them! (In other words, please mention the user whose name you wish to write.)");}
if (options.victim && options.victim.length) { if (options.victim && options.victim.length) {
let vargs = options.victim.trim().split(/\s+/g); let vargs = options.victim.trim().split(/\s+/g);
let nvargs = []; let nvargs = [];
let varg; for (varg of vargs) { let varg; for (varg of vargs) {
if (varg.match(/^<@(?:!?)\d+>$/)) { if (varg.match(/^<@(?:!?)\d+>$/)) {
nvargs.push(message.guild.members.cache.has(varg.slice(varg.search(/\d/), varg.search('>'))) ? message.guild.members.cache.get(varg.slice(varg.search(/\d/), varg.search('>'))).displayName : varg); nvargs.push(message.guild.members.cache.has(varg.slice(varg.search(/\d/), varg.search('>'))) ? message.guild.members.cache.get(varg.slice(varg.search(/\d/), varg.search('>'))).displayName : varg);
} else {nvargs.push(varg);} } else {nvargs.push(varg);}
} }
options.victim = nvargs.join(" ").trim(); options.victim = nvargs.join(" ").trim();
} }
let victim = options.victim && options.victim.length ? options.victim : message.mentions.members.first().displayName; let victim = options.victim && options.victim.length ? options.victim : message.mentions.members.first().displayName;
let killer = message.member; let killer = message.member;
let pretext = before[Math.floor(Math.random() * before.length)].replace(/{p}/g, victim); let pretext = before[Math.floor(Math.random() * before.length)].replace(/{p}/g, victim);
let note = await message.channel.send(new Discord.MessageEmbed() let note = await message.channel.send(new Discord.MessageEmbed()
.setDescription(pretext) .setDescription(pretext)
.setColor('c375f0') .setColor('c375f0')
.setFooter("Natsuki", client.user.avatarURL()) .setFooter("Natsuki", client.user.avatarURL())
.setTimestamp() .setTimestamp()
); );
await require('../util/wait')(2500); await require('../../util/wait')(2500);
let text = reptype.texts[Math.floor(Math.random() * reptype.texts.length)] let text = reptype.texts[Math.floor(Math.random() * reptype.texts.length)]
.replace(/{p}/g, victim) //{p} = victim .replace(/{p}/g, victim) //{p} = victim
.replace(/{pa}/g, victim.toLowerCase().endsWith('s') ? `${victim}'` : `${victim}'s`) //{pa} = victim but with a formatted apostrophe like "WubzyGD's" .replace(/{pa}/g, victim.toLowerCase().endsWith('s') ? `${victim}'` : `${victim}'s`) //{pa} = victim but with a formatted apostrophe like "WubzyGD's"
.replace(/{c}/g, death) // {c} = death method .replace(/{c}/g, death) // {c} = death method
.replace(/{w}/g, killer.displayName) // {w} = killer or writer .replace(/{w}/g, killer.displayName) // {w} = killer or writer
.replace(/{ds}/g, moment().format("h:mm a")); // {ds} = date small, basically just the time. .replace(/{ds}/g, moment().format("h:mm a")); // {ds} = date small, basically just the time.
// Create and format the kill text // Create and format the kill text
let dns; let dns;
if (mention && mention.id) { if (mention && mention.id) {
dns = await VC.findOne({uid: message.author.id, countOf: 'dn'}) || new VC({uid: message.author.id, countOf: 'dn'}); dns = await VC.findOne({uid: message.author.id, countOf: 'dn'}) || new VC({uid: message.author.id, countOf: 'dn'});
dns.against[mention.id] = dns.against[mention.id] ? dns.against[mention.id] + 1 : 1; dns.against[mention.id] = dns.against[mention.id] ? dns.against[mention.id] + 1 : 1;
dns.total++; dns.total++;
dns.markModified(`against.${mention.id}`); dns.markModified(`against.${mention.id}`);
dns.save(); dns.save();
} }
let finalEmbed = new Discord.MessageEmbed() let finalEmbed = new Discord.MessageEmbed()
.setAuthor(title, message.author.avatarURL()) .setAuthor(title, message.author.avatarURL())
.setDescription(`${text}${dns ? `\n\n_Their name is in your deathnote **${dns.against[mention.id] === 1 ? 'once' : `${dns.against[mention.id]} times`}.**_` : ''}`) .setDescription(`${text}${dns ? `\n\n_Their name is in your deathnote **${dns.against[mention.id] === 1 ? 'once' : `${dns.against[mention.id]} times`}.**_` : ''}`)
.setColor('c375f0') .setColor('c375f0')
.setFooter(`Natsuki${dns ? ` | ${dns.total} name${dns.total === 1 ? ' has been' : 's'} written in your deathnote!` : ''}`) .setFooter(`Natsuki${dns ? ` | ${dns.total} name${dns.total === 1 ? ' has been' : 's'} written in your deathnote!` : ''}`)
.setTimestamp(); .setTimestamp();
if (mention) {finalEmbed.setThumbnail(mention.avatarURL({size: 1024}));} if (mention) {finalEmbed.setThumbnail(mention.avatarURL({size: 1024}));}
return note.edit(finalEmbed); return note.edit(finalEmbed);
} }
}; };

@ -1,7 +1,7 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const Saves = require('../models/saves'); const Saves = require('../../models/saves');
const UserData = require('../models/user'); const UserData = require('../../models/user');
const makeId = require('../util/makeid'); const makeId = require('../../util/makeid');
module.exports = { module.exports = {
name: "kiss", name: "kiss",

@ -1,7 +1,7 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const SS = require('../models/secretsanta'); const SS = require('../../models/secretsanta');
const ask = require('../util/ask'); const ask = require('../../util/ask');
module.exports = { module.exports = {
name: "secretsanta", name: "secretsanta",
@ -55,7 +55,7 @@ module.exports = {
let id; let id;
while (true) { while (true) {
id = require('../util/makeid')(6); id = require('../../util/makeid')(6);
let test = await SS.findOne({ssid: id}); let test = await SS.findOne({ssid: id});
if (!test) {break;} if (!test) {break;}
} }

@ -1,10 +1,10 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const Saves = require('../models/saves'); const Saves = require('../../models/saves');
const UserData = require('../models/user'); const UserData = require('../../models/user');
const VC = require('../models/vscount'); const VC = require('../../models/vscount');
const makeId = require('../util/makeid'); const makeId = require('../../util/makeid');
module.exports = { module.exports = {
name: "slap", name: "slap",

@ -1,7 +1,7 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const UserData = require('../models/user'); const UserData = require('../../models/user');
const LXP = require('../models/localxp'); const LXP = require('../../models/localxp');
module.exports = { module.exports = {
name: "levelchannel", name: "levelchannel",

@ -1,9 +1,9 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const GuildData = require('../models/guild'); const GuildData = require('../../models/guild');
const LR = require('../models/levelroles'); const LR = require('../../models/levelroles');
const ask = require('../util/ask'); const ask = require('../../util/ask');
module.exports = { module.exports = {
name: "levelrole", name: "levelrole",

@ -1,6 +1,6 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const LXP = require('../models/localxp'); const LXP = require('../../models/localxp');
module.exports = { module.exports = {
name: "setupleveling", name: "setupleveling",

@ -1,6 +1,6 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const LXP = require('../models/localxp'); const LXP = require('../../models/localxp');
module.exports = { module.exports = {
name: "stats", name: "stats",

@ -1,9 +1,9 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const AR = require('../models/ar'); const AR = require('../../models/ar');
const GuildData = require('../models/guild'); const GuildData = require('../../models/guild');
const ask = require('../util/ask'); const ask = require('../../util/ask');
module.exports = { module.exports = {
name: "ar", name: "ar",

@ -1,32 +1,32 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const {Tag} = require('../util/tag'); const {Tag} = require('../../util/tag');
const {TagFilter} = require('../util/tagfilter'); const {TagFilter} = require('../../util/tagfilter');
module.exports = { module.exports = {
name: "avatar", name: "avatar",
aliases: ['av', 'a', 'pfp'], aliases: ['av', 'a', 'pfp'],
help: "Use `{{p}}avatar` to get your own profile picture, or mention someone to get theirs!", help: "Use `{{p}}avatar` to get your own profile picture, or mention someone to get theirs!",
meta: { meta: {
category: 'Misc', category: 'Misc',
description: "Flare your avatar or peek at others'", description: "Flare your avatar or peek at others'",
syntax: '`avatar [@mention]`', syntax: '`avatar [@mention]`',
extra: null extra: null
}, },
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
let member = !args.length ? message.author : mention ? mention : client.users.cache.has(args[0]) ? client.users.cache.get(args[0]) : message.author; let member = !args.length ? message.author : mention ? mention : client.users.cache.has(args[0]) ? client.users.cache.get(args[0]) : message.author;
let name = !args.length ? message.member ? message.member.displayName : message.author.username : mention ? mention.username : client.users.cache.has(args[0]) ? client.users.cache.get(args[0]).username : message.author.username; let name = !args.length ? message.member ? message.member.displayName : message.author.username : mention ? mention.username : client.users.cache.has(args[0]) ? client.users.cache.get(args[0]).username : message.author.username;
let options = new TagFilter([ let options = new TagFilter([
new Tag(['small', 's', 'mini', 'm'], 'small', 'toggle'), new Tag(['small', 's', 'mini', 'm'], 'small', 'toggle'),
new Tag(['verysmall', 'vsmall', '-vs', 'xs'], 'vsmall', 'toggle') new Tag(['verysmall', 'vsmall', '-vs', 'xs'], 'vsmall', 'toggle')
]).test(args.join(" ")); ]).test(args.join(" "));
try { try {
let avem = new Discord.MessageEmbed() let avem = new Discord.MessageEmbed()
.setTitle(`${name.endsWith('s') ? `${name}'` : `${name}'s`} Avatar`) .setTitle(`${name.endsWith('s') ? `${name}'` : `${name}'s`} Avatar`)
.setImage(member.avatarURL({size: options.vsmall ? 128 : options.small ? 256 : 2048, dynamic: true})) .setImage(member.avatarURL({size: options.vsmall ? 128 : options.small ? 256 : 2048, dynamic: true}))
.setColor('c375f0') .setColor('c375f0')
.setFooter("Natsuki", client.user.avatarURL()) .setFooter("Natsuki", client.user.avatarURL())
if (!options.vsmall) {avem.setTimestamp();} if (!options.vsmall) {avem.setTimestamp();}
return message.channel.send(avem); return message.channel.send(avem);
} catch {return message.reply("Hmm, there seems to have been an error while I tried to show you that user's avatar.");} } catch {return message.reply("Hmm, there seems to have been an error while I tried to show you that user's avatar.");}
} }
}; };

@ -1,73 +1,73 @@
const Discord = require("discord.js"); const Discord = require("discord.js");
const {Pagination} = require('../util/pagination'); const {Pagination} = require('../../util/pagination');
const ask = require('../util/ask'); const ask = require('../../util/ask');
module.exports = { module.exports = {
name: "help", name: "help",
aliases: ["h", "commands", "cmds"], aliases: ["h", "commands", "cmds"],
help: 'you silly! What did you expect me to respond with?', help: 'you silly! What did you expect me to respond with?',
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
if (!args.length) { if (!args.length) {
let sorted = {}; let sorted = {};
await Array.from(client.commands.values()).forEach(command => {if (command.name !== "help" && command.meta) { await Array.from(client.commands.values()).forEach(command => {if (command.name !== "help" && command.meta) {
sorted[command.meta.category] = sorted[command.meta.category] ? sorted[command.meta.category] : {}; sorted[command.meta.category] = sorted[command.meta.category] ? sorted[command.meta.category] : {};
sorted[command.meta.category][command.name] = command; sorted[command.meta.category][command.name] = command;
}}); }});
let helpSorted = {}; let helpSorted = {};
let category; for (category of Object.keys(sorted)) { let category; for (category of Object.keys(sorted)) {
let categorySorted = []; let categorySorted = [];
let current = 1; let current = 1;
let currentEmbed = new Discord.MessageEmbed().setAuthor("Help Menu", message.author.avatarURL()).setTitle(category).setDescription("React to control the menu! You can also specify a command name when doing the help command to get more info about it.").setColor("c375f0"); let currentEmbed = new Discord.MessageEmbed().setAuthor("Help Menu", message.author.avatarURL()).setTitle(category).setDescription("React to control the menu! You can also specify a command name when doing the help command to get more info about it.").setColor("c375f0");
let commands = Object.keys(sorted[category]); let commands = Object.keys(sorted[category]);
let command; for (command of commands) { let command; for (command of commands) {
let aliases = ''; let aliases = '';
let a; if (sorted[category][command].aliases) {for (a of sorted[category][command].aliases) {aliases += `\`${a}\`, `}} let a; if (sorted[category][command].aliases) {for (a of sorted[category][command].aliases) {aliases += `\`${a}\`, `}}
aliases = aliases.length ? aliases.slice(0, aliases.length - 2) : 'None'; aliases = aliases.length ? aliases.slice(0, aliases.length - 2) : 'None';
currentEmbed.addField(`${command.slice(0,1).toUpperCase()}${command.slice(1)}`, `${sorted[category][command].meta.description}\n\nAliases: ${aliases}\nSyntax: ${sorted[category][command].meta.syntax}${sorted[category][command].meta.extra ? '\n\n' + sorted[category][command].meta.extra : ''}`); currentEmbed.addField(`${command.slice(0,1).toUpperCase()}${command.slice(1)}`, `${sorted[category][command].meta.description}\n\nAliases: ${aliases}\nSyntax: ${sorted[category][command].meta.syntax}${sorted[category][command].meta.extra ? '\n\n' + sorted[category][command].meta.extra : ''}`);
current += 1; current += 1;
if (current === 5) { if (current === 5) {
categorySorted.push(currentEmbed); categorySorted.push(currentEmbed);
current = 1; current = 1;
currentEmbed = new Discord.MessageEmbed().setAuthor("Help Menu", message.author.avatarURL()).setTitle(category).setDescription("React to control the menu! You can also specify a command name when doing the help command to get more info about it.").setColor("c375f0"); currentEmbed = new Discord.MessageEmbed().setAuthor("Help Menu", message.author.avatarURL()).setTitle(category).setDescription("React to control the menu! You can also specify a command name when doing the help command to get more info about it.").setColor("c375f0");
} }
} }
if (current > 1) {categorySorted.push(currentEmbed);} if (current > 1) {categorySorted.push(currentEmbed);}
helpSorted[category] = categorySorted; helpSorted[category] = categorySorted;
} }
let cat = await ask(message, "What would you like help with? (`Fun`|`Roleplay`|`Utility`|`Misc`|`Moderation`|`Social`|`Leveling`) or `all` if you'd like to browse all commands", 60000); if (!cat) {return;} let cat = await ask(message, "What would you like help with? (`Fun`|`Roleplay`|`Utility`|`Misc`|`Moderation`|`Social`|`Leveling`) or `all` if you'd like to browse all commands", 60000); if (!cat) {return;}
if (!['f', 'fun', 'rp', 'roleplay', 'dnd', 'role play', 'rpg', 'dice', 'u', 'util', 'utility', 'utilities', 'm', 'misc', 'miscellaneous', 'mod', 'moderation', 's', 'social', 'leveling', 'l', 'level', 'a', 'all'].includes(`${cat}`.trim().toLowerCase())) {return message.channel.send("That wasn't a valid response! Try again?");} if (!['f', 'fun', 'rp', 'roleplay', 'dnd', 'role play', 'rpg', 'dice', 'u', 'util', 'utility', 'utilities', 'm', 'misc', 'miscellaneous', 'mod', 'moderation', 's', 'social', 'leveling', 'l', 'level', 'a', 'all'].includes(`${cat}`.trim().toLowerCase())) {return message.channel.send("That wasn't a valid response! Try again?");}
let pages; let pages;
if (['f', 'fun'].includes(`${cat}`.trim().toLowerCase())) {pages = helpSorted['Fun'];} if (['f', 'fun'].includes(`${cat}`.trim().toLowerCase())) {pages = helpSorted['Fun'];}
if (['roleplay', 'dnd', 'role play', 'rpg', 'dice'].includes(`${cat}`.trim().toLowerCase())) {pages = helpSorted['RP'];} if (['roleplay', 'dnd', 'role play', 'rpg', 'dice'].includes(`${cat}`.trim().toLowerCase())) {pages = helpSorted['RP'];}
if (['u', 'util', 'utility', 'utilities'].includes(`${cat}`.trim().toLowerCase())) {pages = helpSorted['Utility'];} if (['u', 'util', 'utility', 'utilities'].includes(`${cat}`.trim().toLowerCase())) {pages = helpSorted['Utility'];}
if (['m', 'misc', 'miscellaneous'].includes(`${cat}`.trim().toLowerCase())) {pages = helpSorted['Misc'];} if (['m', 'misc', 'miscellaneous'].includes(`${cat}`.trim().toLowerCase())) {pages = helpSorted['Misc'];}
if (['d', 'dev', 'developer'].includes(`${cat}`.trim().toLowerCase())) {pages = helpSorted['Developer'];} if (['d', 'dev', 'developer'].includes(`${cat}`.trim().toLowerCase())) {pages = helpSorted['Developer'];}
if (['mod', 'moderation'].includes(`${cat}`.trim().toLowerCase())) {pages = helpSorted['Moderation'];} if (['mod', 'moderation'].includes(`${cat}`.trim().toLowerCase())) {pages = helpSorted['Moderation'];}
if (['s', 'social'].includes(`${cat}`.trim().toLowerCase())) {pages = helpSorted['Social'];} if (['s', 'social'].includes(`${cat}`.trim().toLowerCase())) {pages = helpSorted['Social'];}
if (['l', 'leveling', 'level'].includes(`${cat}`.trim().toLowerCase())) {pages = helpSorted['Leveling'];} if (['l', 'leveling', 'level'].includes(`${cat}`.trim().toLowerCase())) {pages = helpSorted['Leveling'];}
if (['a', 'all'].includes(`${cat}`.trim().toLowerCase())) {pages = []; let c; for (c of Object.values(helpSorted)) {let h; for (h of c) {pages.push(h)}}} if (['a', 'all'].includes(`${cat}`.trim().toLowerCase())) {pages = []; let c; for (c of Object.values(helpSorted)) {let h; for (h of c) {pages.push(h)}}}
await require('../util/wait')(500); await require('../../util/wait')(500);
if (pages.length > 1) { if (pages.length > 1) {
let help = new Pagination(message.channel, pages, message, client, true); let help = new Pagination(message.channel, pages, message, client, true);
return await help.start({endTime: 120000, user: message.author.id}); return await help.start({endTime: 120000, user: message.author.id});
} else {return message.channel.send(pages[0].setFooter("Natsuki", client.user.avatarURL()).setTimestamp());} } else {return message.channel.send(pages[0].setFooter("Natsuki", client.user.avatarURL()).setTimestamp());}
} else { } else {
let command; let command;
if (client.commands.has(args[0])) {command = client.commands.get(args[0]);} if (client.commands.has(args[0])) {command = client.commands.get(args[0]);}
else if (client.aliases.has(args[0])) {command = client.commands.get(client.aliases.get(args[0]));} else if (client.aliases.has(args[0])) {command = client.commands.get(client.aliases.get(args[0]));}
else {return message.reply("I don't have that command! Try using `" + prefix + "help` to get a list of my commands");} else {return message.reply("I don't have that command! Try using `" + prefix + "help` to get a list of my commands");}
return message.reply(command.help return message.reply(command.help
? command.help instanceof Discord.MessageEmbed ? command.help instanceof Discord.MessageEmbed
? command.help.setFooter("Natsuki | <required> [optional]", client.user.avatarURL()).setColor("c375f0").setTimestamp() ? command.help.setFooter("Natsuki | <required> [optional]", client.user.avatarURL()).setColor("c375f0").setTimestamp()
: command.help.replace(/{{p}}/g, prefix) : command.help.replace(/{{p}}/g, prefix)
: "I don't seem to have any help info available for that command." : "I don't seem to have any help info available for that command."
); );
} }
} }
}; };

@ -12,7 +12,7 @@ module.exports = {
extra: null extra: null
}, },
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
let botData = await require('../models/bot').findOne({finder: 'lel'}); let botData = await require('../../models/bot').findOne({finder: 'lel'});
return message.channel.send(new Discord.MessageEmbed() return message.channel.send(new Discord.MessageEmbed()
.setAuthor("About Me!", client.users.cache.get(client.developers[Math.floor(Math.random() * client.developers.length)]).avatarURL()) .setAuthor("About Me!", client.users.cache.get(client.developers[Math.floor(Math.random() * client.developers.length)]).avatarURL())

@ -1,7 +1,7 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const AR = require('../models/ar'); const AR = require('../../models/ar');
const GuildData = require('../models/guild'); const GuildData = require('../../models/guild');
module.exports = { module.exports = {
name: "ignorear", name: "ignorear",

@ -1,6 +1,6 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const mongoose = require('mongoose'); const mongoose = require('mongoose');
const GuildSettings = require('../models/guild'); const GuildSettings = require('../../models/guild');
module.exports = { module.exports = {
name: "prefix", name: "prefix",
@ -34,7 +34,7 @@ module.exports = {
} }
client.guildconfig.prefixes.set(message.guild.id, np); client.guildconfig.prefixes.set(message.guild.id, np);
let upm = await message.reply("sure thing!"); let upm = await message.reply("sure thing!");
await require('../util/wait')(1750); await require('../../util/wait')(1750);
return upm.edit(new Discord.MessageEmbed() return upm.edit(new Discord.MessageEmbed()
.setAuthor('Prefix updated!', message.author.avatarURL()) .setAuthor('Prefix updated!', message.author.avatarURL())
.setDescription(`New prefix: \`${np}\``) .setDescription(`New prefix: \`${np}\``)

@ -1,7 +1,7 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const moment = require('moment'); const moment = require('moment');
const mongoose = require('mongoose'); const mongoose = require('mongoose');
const UserData = require('../models/user'); const UserData = require('../../models/user');
module.exports = { module.exports = {
name: "userinfo", name: "userinfo",

@ -1,5 +1,5 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const GuildData = require('../models/guild'); const GuildData = require('../../models/guild');
module.exports = { module.exports = {
name: "autorole", name: "autorole",

@ -1,9 +1,9 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const Mod = require('../models/mod'); const Mod = require('../../models/mod');
const {Tag} = require('../util/tag'); const {Tag} = require('../../util/tag');
const {TagFilter} = require('../util/tagfilter'); const {TagFilter} = require('../../util/tagfilter');
module.exports = { module.exports = {
name: "ban", name: "ban",

@ -1,6 +1,6 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const Mod = require('../models/mod'); const Mod = require('../../models/mod');
module.exports = { module.exports = {
name: "clearwarnings", name: "clearwarnings",

@ -1,9 +1,9 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const Mod = require('../models/mod'); const Mod = require('../../models/mod');
const {Tag} = require('../util/tag'); const {Tag} = require('../../util/tag');
const {TagFilter} = require('../util/tagfilter'); const {TagFilter} = require('../../util/tagfilter');
module.exports = { module.exports = {
name: "kick", name: "kick",

@ -1,7 +1,7 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const GuildData = require('../models/guild'); const GuildData = require('../../models/guild');
const Responses = require('../models/responses'); const Responses = require('../../models/responses');
const sendResponse = require('../util/response/sendresponse'); const sendResponse = require('../../util/response/sendresponse');
module.exports = { module.exports = {
name: "leave", name: "leave",

@ -1,85 +1,85 @@
const Discord = require("discord.js"); const Discord = require("discord.js");
const GuildData = require('../models/guild'); const GuildData = require('../../models/guild');
const LogData = require('../models/log'); const LogData = require('../../models/log');
const ObjLogTypes = { const ObjLogTypes = {
mdelete: ['md', 'mdelete', 'messagedelete', 'deletemessage', 'deletemsg', 'msgdelete'], mdelete: ['md', 'mdelete', 'messagedelete', 'deletemessage', 'deletemsg', 'msgdelete'],
medit: ['me', 'medit', 'messageedit', 'editmessage', 'msgedit', 'editmsg'], medit: ['me', 'medit', 'messageedit', 'editmessage', 'msgedit', 'editmsg'],
chnew: ['chn', 'chc', 'newch', 'newchannel', 'chcreate', 'channelcreate'], chnew: ['chn', 'chc', 'newch', 'newchannel', 'chcreate', 'channelcreate'],
//chedit: ['channeledit'], //chedit: ['channeledit'],
chdelete: ['chd', 'channeldelete', 'deletechannel', 'deletech', 'chdelete'], chdelete: ['chd', 'channeldelete', 'deletechannel', 'deletech', 'chdelete'],
//vcjoin: [], //vcjoin: [],
//vcleave: [], //vcleave: [],
//servervcmute: [], //servervcmute: [],
//servervcdeafen: [], //servervcdeafen: [],
//kick: [], //kick: [],
//ban: [], //ban: [],
//mute: [], //mute: [],
//warn: [], //warn: [],
//giverole: [], //giverole: [],
//takerole: [], //takerole: [],
//addrole: [], //addrole: [],
//editrole: [], //editrole: [],
//deleterole: [], //deleterole: [],
//serverjoin: [], //serverjoin: [],
//serverleave: [], //serverleave: [],
//nickname: [], //nickname: [],
//username: [], //username: [],
//avatar: [] //avatar: []
}; const LogTypes = new Map(); }; const LogTypes = new Map();
let keys = Object.keys(ObjLogTypes); let keys = Object.keys(ObjLogTypes);
let key; for (key of keys) {let vs = ObjLogTypes[key]; let v; for (v of vs) {LogTypes.set(v, key);}} let key; for (key of keys) {let vs = ObjLogTypes[key]; let v; for (v of vs) {LogTypes.set(v, key);}}
module.exports = { module.exports = {
name: "logs", name: "logs",
aliases: ["log", "l", "modlog", "modlogs"], aliases: ["log", "l", "modlog", "modlogs"],
help: new Discord.MessageEmbed() help: new Discord.MessageEmbed()
.setTitle("Help -> Server Logs") .setTitle("Help -> Server Logs")
.setDescription("Configure your server's log settings.\n\nLogs will update you on events in your server that have the potential to require moderator intervention, like someone deleting a hateful message before you can see it or a misbehaving moderator kicking/banning a member when they aren't supposed to.") .setDescription("Configure your server's log settings.\n\nLogs will update you on events in your server that have the potential to require moderator intervention, like someone deleting a hateful message before you can see it or a misbehaving moderator kicking/banning a member when they aren't supposed to.")
.addField("Syntax", "`log <set|list|view|clear> [logType] [#channel]`") .addField("Syntax", "`log <set|list|view|clear> [logType] [#channel]`")
.addField("Notice", "You must be an admin or have the specified staff role in order to use this command."), .addField("Notice", "You must be an admin or have the specified staff role in order to use this command."),
meta: { meta: {
category: 'Moderation', category: 'Moderation',
description: "Configure your server's log settings, which allow mods to see potentially suspicious activity in the server.", description: "Configure your server's log settings, which allow mods to see potentially suspicious activity in the server.",
syntax: '`log <set|list|view|clear> [logType] [#channel]`', syntax: '`log <set|list|view|clear> [logType] [#channel]`',
extra: "**Please note** that this command is still in the works, and that not all log types are available. The currently existing ones have been thoroughly tested, though." extra: "**Please note** that this command is still in the works, and that not all log types are available. The currently existing ones have been thoroughly tested, though."
}, },
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
if (!message.guild) {return message.reply("This command is server-only!");} if (!message.guild) {return message.reply("This command is server-only!");}
let tg = await GuildData.findOne({gid: message.guild.id}); let tg = await GuildData.findOne({gid: message.guild.id});
if ((!message.member.permissions.has("ADMINISTRATOR")) && (!tg || !tg.staffrole || !tg.staffrole.length || !message.member.roles.cache.has(tg.staffrole))) {return message.reply("You must be an administrator or have the specified staff role in this server in order to edit or view log settings.");} if ((!message.member.permissions.has("ADMINISTRATOR")) && (!tg || !tg.staffrole || !tg.staffrole.length || !message.member.roles.cache.has(tg.staffrole))) {return message.reply("You must be an administrator or have the specified staff role in this server in order to edit or view log settings.");}
if (!args.length) {return message.channel.send(`Syntax: \`${prefix}log <set|list|view|clear> [logType] [#channel]\``);} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}log <set|list|view|clear> [logType] [#channel]\``);}
if (['s', 'set'].includes(args[0].toLowerCase())) { if (['s', 'set'].includes(args[0].toLowerCase())) {
if (args.length < 3) {return message.channel.send(`You must specify the log type and the channel to send the log to. Use \`${prefix}log list\` to see a list of valid log types.`);} if (args.length < 3) {return message.channel.send(`You must specify the log type and the channel to send the log to. Use \`${prefix}log list\` to see a list of valid log types.`);}
if (!LogTypes.has(args[1].toLowerCase())) {return message.channel.send("That's not a valid log type. Use \`${prefix}log list\` to see a list of valid log types.");} if (!LogTypes.has(args[1].toLowerCase())) {return message.channel.send("That's not a valid log type. Use \`${prefix}log list\` to see a list of valid log types.");}
let lt = LogTypes.get(args[1].toLowerCase()); let lt = LogTypes.get(args[1].toLowerCase());
let ch = args[2].match(/<\#(?:\d+)>/m) && message.guild.channels.cache.has(message.mentions.channels.first().id) ? message.mentions.channels.first() : message.guild.channels.cache.has(args[2]) ? message.guild.channels.cache.get(args[2]) : null; let ch = args[2].match(/<\#(?:\d+)>/m) && message.guild.channels.cache.has(message.mentions.channels.first().id) ? message.mentions.channels.first() : message.guild.channels.cache.has(args[2]) ? message.guild.channels.cache.get(args[2]) : null;
if (!ch) {return message.channel.send("I can't find that channel! Make sure that you've mentioned one, or that the ID you provided is correct, and that I can see it.");} if (!ch) {return message.channel.send("I can't find that channel! Make sure that you've mentioned one, or that the ID you provided is correct, and that I can see it.");}
if (!ch.permissionsFor(client.user.id).has("SEND_MESSAGES")) {return message.reply("I don't have permissions to send messages in that channel. Please give me access and try again.");} if (!ch.permissionsFor(client.user.id).has("SEND_MESSAGES")) {return message.reply("I don't have permissions to send messages in that channel. Please give me access and try again.");}
let tl = await LogData.findOne({gid: message.guild.id}) || new LogData({gid: message.guild.id}); let tl = await LogData.findOne({gid: message.guild.id}) || new LogData({gid: message.guild.id});
tl[lt] = ch.id; tl[lt] = ch.id;
tl.save(); tl.save();
if (!client.guildconfig.logs.has(message.guild.id)) {client.guildconfig.logs.set(message.guild.id, new Map());} if (!client.guildconfig.logs.has(message.guild.id)) {client.guildconfig.logs.set(message.guild.id, new Map());}
client.guildconfig.logs.get(message.guild.id).set(lt, ch.id); client.guildconfig.logs.get(message.guild.id).set(lt, ch.id);
return message.channel.send("Log settings updated!") return message.channel.send("Log settings updated!")
} }
if (['l', 'list'].includes(args[0].toLowerCase())) { if (['l', 'list'].includes(args[0].toLowerCase())) {
return message.channel.send("Valid log types:\n\n-`msgdelete` - Shows the content of a message that was deleted, in any channel.\n-`msgedit` - Shows both the old and new versions of a message when it is edited."); return message.channel.send("Valid log types:\n\n-`msgdelete` - Shows the content of a message that was deleted, in any channel.\n-`msgedit` - Shows both the old and new versions of a message when it is edited.");
} }
if (['v', 'view'].includes(args[0].toLowerCase())) { if (['v', 'view'].includes(args[0].toLowerCase())) {
if (client.guildconfig.logs.has(message.guild.id) && client.guildconfig.logs.get(message.guild.id).size) {return message.channel.send(`This server's logs: \n\n${function bonk(){let s = ''; Array.from(client.guildconfig.logs.get(message.guild.id).keys()).forEach(v => s+=`\`${v}\`: <#${client.guildconfig.logs.get(message.guild.id).get(v)}>, `); return s;}().slice(0, -2)}`);} if (client.guildconfig.logs.has(message.guild.id) && client.guildconfig.logs.get(message.guild.id).size) {return message.channel.send(`This server's logs: \n\n${function bonk(){let s = ''; Array.from(client.guildconfig.logs.get(message.guild.id).keys()).forEach(v => s+=`\`${v}\`: <#${client.guildconfig.logs.get(message.guild.id).get(v)}>, `); return s;}().slice(0, -2)}`);}
else {return message.channel.send("Your server doesn't have any logs set up at the moment, or they aren't cached. If you keep seeing this issue even after setting logs, please contact my developers!");} else {return message.channel.send("Your server doesn't have any logs set up at the moment, or they aren't cached. If you keep seeing this issue even after setting logs, please contact my developers!");}
} }
if (['c', 'clear'].includes(args[0].toLowerCase())) { if (['c', 'clear'].includes(args[0].toLowerCase())) {
} }
} }
}; };

@ -1,12 +1,12 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const GuildData = require('../models/guild'); const GuildData = require('../../models/guild');
const Responses = require('../models/responses'); const Responses = require('../../models/responses');
const sendResponse = require('../util/response/sendresponse'); const sendResponse = require('../../util/response/sendresponse');
const parseResponse = require('../util/response/parseresponse'); const parseResponse = require('../../util/response/parseresponse');
const saveResponse = require('../util/response/saveresponse'); const saveResponse = require('../../util/response/saveresponse');
const getResponse = require('../util/response/getresponse'); const getResponse = require('../../util/response/getresponse');
module.exports = { module.exports = {
name: "response", name: "response",

@ -1,7 +1,7 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const {Tag} = require("../util/tag"); const {Tag} = require("../../util/tag");
const {TagFilter} = require("../util/tagfilter"); const {TagFilter} = require("../../util/tagfilter");
module.exports = { module.exports = {
name: "softban", name: "softban",

@ -1,6 +1,6 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const mongoose = require('mongoose'); const mongoose = require('mongoose');
const GuildSettings = require('../models/guild'); const GuildSettings = require('../../models/guild');
module.exports = { module.exports = {
name: "staffrole", name: "staffrole",
@ -40,7 +40,7 @@ module.exports = {
tguild.staffrole = role.id; tguild.staffrole = role.id;
tguild.save(); tguild.save();
let upm = await message.reply("sure thing!"); let upm = await message.reply("sure thing!");
await require('../util/wait')(1750); await require('../../util/wait')(1750);
return upm.edit(new Discord.MessageEmbed() return upm.edit(new Discord.MessageEmbed()
.setAuthor('Staff role updated!', message.author.avatarURL()) .setAuthor('Staff role updated!', message.author.avatarURL())
.setDescription(`<@&${tguild.staffrole}> can now edit my settings in this server.`) .setDescription(`<@&${tguild.staffrole}> can now edit my settings in this server.`)

@ -1,27 +1,27 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const GuildSettings = require('../models/guild'); const GuildSettings = require('../../models/guild');
module.exports = { module.exports = {
name: "togglestatuses", name: "togglestatuses",
aliases: ['ts', 'tsw', 'togglestatuswarnings', 'togglestatus', 'statustoggle', 'statusestoggle'], aliases: ['ts', 'tsw', 'togglestatuswarnings', 'togglestatus', 'statustoggle', 'statusestoggle'],
help: new Discord.MessageEmbed() help: new Discord.MessageEmbed()
.setTitle("Help -> Server Status-Toggling") .setTitle("Help -> Server Status-Toggling")
.setDescription("Disables or enables the warning that appears when you ping someone that has a status set.") .setDescription("Disables or enables the warning that appears when you ping someone that has a status set.")
.addField("Syntax", "`togglestatuses [c]` (add `c` to the end of the message if you want to check if they're enabled or not.)"), .addField("Syntax", "`togglestatuses [c]` (add `c` to the end of the message if you want to check if they're enabled or not.)"),
meta: { meta: {
category: 'Moderation', category: 'Moderation',
description: "Toggle the warning I give members when they ping someone with a status. Some people find it annoying, but here's my mute button!", description: "Toggle the warning I give members when they ping someone with a status. Some people find it annoying, but here's my mute button!",
syntax: '`togglestatuses [-c]`', syntax: '`togglestatuses [-c]`',
extra: null extra: null
}, },
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
if (!message.guild) {return message.reply('You must be in a server to use this command.');} if (!message.guild) {return message.reply('You must be in a server to use this command.');}
let tg = await GuildSettings.findOne({gid: message.guild.id}); let tg = await GuildSettings.findOne({gid: message.guild.id});
if (!message.member.permissions.has('ADMINISTRATOR') && (tg && tg.staffrole.length && !message.member.roles.cache.has(tg.staffrole))) {return message.reply("You don't have permissions to use this command in your server.");} if (!message.member.permissions.has('ADMINISTRATOR') && (tg && tg.staffrole.length && !message.member.roles.cache.has(tg.staffrole))) {return message.reply("You don't have permissions to use this command in your server.");}
if (args[0] && ['c', 'check', 'v', 'view'].includes(args[0].toLowerCase())) {return message.channel.send(`I ${tg && !tg.nostatus ? 'will' : 'will not'} send a warning when pinging a member with a status.`);} if (args[0] && ['c', 'check', 'v', 'view'].includes(args[0].toLowerCase())) {return message.channel.send(`I ${tg && !tg.nostatus ? 'will' : 'will not'} send a warning when pinging a member with a status.`);}
if (!tg) {tg = new GuildSettings({gid: message.guild.id});} if (!tg) {tg = new GuildSettings({gid: message.guild.id});}
tg.nostatus = !tg.nostatus; tg.nostatus = !tg.nostatus;
tg.save(); tg.save();
return message.channel.send(`I ${!tg.nostatus ? 'will' : 'will not'} send a warning when pinging a member with a status.`); return message.channel.send(`I ${!tg.nostatus ? 'will' : 'will not'} send a warning when pinging a member with a status.`);
} }
}; };

@ -1,9 +1,9 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const Mod = require('../models/mod'); const Mod = require('../../models/mod');
const {TagFilter} = require('../util/tagfilter'); const {TagFilter} = require('../../util/tagfilter');
const {Tag} = require('../util/tag'); const {Tag} = require('../../util/tag');
module.exports = { module.exports = {
name: "warn", name: "warn",

@ -1,7 +1,7 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const GuildData = require('../models/guild'); const GuildData = require('../../models/guild');
const Responses = require('../models/responses'); const Responses = require('../../models/responses');
const sendResponse = require('../util/response/sendresponse'); const sendResponse = require('../../util/response/sendresponse');
module.exports = { module.exports = {
name: "welcome", name: "welcome",

@ -1,6 +1,6 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const mongoose = require('mongoose'); const mongoose = require('mongoose');
const UserData = require('../models/user'); const UserData = require('../../models/user');
module.exports = { module.exports = {
name: "afk", name: "afk",
@ -34,7 +34,7 @@ module.exports = {
let tempDate = new Date(); let tempDate = new Date();
tu.statusclearat = tempDate.setHours(tempDate.getHours() + 12); tu.statusclearat = tempDate.setHours(tempDate.getHours() + 12);
tu.save(); tu.save();
require('../util/cachestatus')(message.author.id, tempDate.setHours(tempDate.getHours() + 12)); require('../../util/cachestatus')(message.author.id, tempDate.setHours(tempDate.getHours() + 12));
return message.reply(`I set your ${tu.statusclearmode === 'auto' ? 'automatically' : 'manually'}-clearing AFK message to: ${reason.trim()}`); return message.reply(`I set your ${tu.statusclearmode === 'auto' ? 'automatically' : 'manually'}-clearing AFK message to: ${reason.trim()}`);
} }
}; };

@ -1,5 +1,5 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const UserData = require('../models/user'); const UserData = require('../../models/user');
module.exports = { module.exports = {
name: "bio", name: "bio",

@ -1,7 +1,7 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const mongooes = require('mongoose'); const mongooes = require('mongoose');
const UserData = require('../models/user'); const UserData = require('../../models/user');
module.exports = { module.exports = {
name: "clearstatus", name: "clearstatus",
@ -20,7 +20,7 @@ module.exports = {
tu.statusmsg = ''; tu.statusmsg = '';
tu.statustype = ''; tu.statustype = '';
tu.save(); tu.save();
require('../util/siftstatuses')(client, message.author.id, true); require('../../util/siftstatuses')(client, message.author.id, true);
return message.reply("welcome back! I cleared your status.").then(m => {m.delete({timeout: 5000}).then(() => {if (message.guild && message.guild.me.permissions.has("DELETE_MESSAGES")) {message.delete().catch(() => {});}})}); return message.reply("welcome back! I cleared your status.").then(m => {m.delete({timeout: 5000}).then(() => {if (message.guild && message.guild.me.permissions.has("DELETE_MESSAGES")) {message.delete().catch(() => {});}})});
} }
}; };

@ -1,7 +1,7 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const Saves = require('../models/saves'); const Saves = require('../../models/saves');
const UserData = require('../models/user'); const UserData = require('../../models/user');
const makeId = require('../util/makeid'); const makeId = require('../../util/makeid');
module.exports = { module.exports = {
name: "cry", name: "cry",

@ -1,6 +1,6 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const mongoose = require('mongoose'); const mongoose = require('mongoose');
const UserData = require('../models/user'); const UserData = require('../../models/user');
module.exports = { module.exports = {
name: "dnd", name: "dnd",
@ -34,7 +34,7 @@ module.exports = {
let tempDate = new Date(); let tempDate = new Date();
tu.statusclearat = tempDate.setHours(tempDate.getHours() + 12); tu.statusclearat = tempDate.setHours(tempDate.getHours() + 12);
tu.save(); tu.save();
require('../util/cachestatus')(message.author.id, tempDate.setHours(tempDate.getHours() + 12)); require('../../util/cachestatus')(message.author.id, tempDate.setHours(tempDate.getHours() + 12));
return message.reply(`I set your ${tu.statusclearmode === 'auto' ? 'automatically' : 'manually'}-clearing Do not Disturb message to: ${reason.trim()}`); return message.reply(`I set your ${tu.statusclearmode === 'auto' ? 'automatically' : 'manually'}-clearing Do not Disturb message to: ${reason.trim()}`);
} }
}; };

@ -1,10 +1,10 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const Saves = require('../models/saves'); const Saves = require('../../models/saves');
const UserData = require('../models/user'); const UserData = require('../../models/user');
const VC = require('../models/vscount'); const VC = require('../../models/vscount');
const makeId = require('../util/makeid'); const makeId = require('../../util/makeid');
module.exports = { module.exports = {
name: "hug", name: "hug",

@ -1,7 +1,7 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const Saves = require('../models/saves'); const Saves = require('../../models/saves');
const UserData = require('../models/user'); const UserData = require('../../models/user');
const makeId = require('../util/makeid'); const makeId = require('../../util/makeid');
module.exports = { module.exports = {
name: "sip", name: "sip",

@ -1,6 +1,6 @@
const Discord = require('discord.js'); const Discord = require('discord.js');
const GuildData = require('../models/guild'); const GuildData = require('../../models/guild');
const ask = require('../util/ask'); const ask = require('../../util/ask');
module.exports = { module.exports = {
name: "starboard", name: "starboard",

@ -4,7 +4,8 @@ const chalk = require('chalk');
//const ora = require('ora'); //const ora = require('ora');
module.exports = client => { module.exports = client => {
var commands = fs.readdirSync('./commands').filter(file => file.endsWith('.js')); let commands = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
fs.readdirSync('./commands').filter(file => !file.includes('.')).forEach(dir => fs.readdirSync(`./commands/${dir}`).filter(file => file.endsWith('.js')).forEach(x => commands.push(x)));
//console.log(''); //console.log('');
//let cora = ora(`${chalk.white("Loading commands into client.")} ${chalk.blue("[")}${chalk.blueBright("0")}${chalk.blue("/")}${chalk.blueBright(`${commands.length}`)}${chalk.blue("]")}`).start(); //let cora = ora(`${chalk.white("Loading commands into client.")} ${chalk.blue("[")}${chalk.blueBright("0")}${chalk.blue("/")}${chalk.blueBright(`${commands.length}`)}${chalk.blue("]")}`).start();
@ -17,12 +18,12 @@ module.exports = client => {
var command = require(`../commands/${commandf}`); var command = require(`../commands/${commandf}`);
client.commands.set(command.name, command); client.commands.set(command.name, command);
if (command.aliases) {command.aliases.forEach(a => client.aliases.set(a, command.name));} if (command.aliases) {command.aliases.forEach(a => client.aliases.set(a, command.name));}
console.log(`${chalk.gray('[LOG] ')} >> ${chalk.blueBright('Loaded Command')} ${chalk.white(command.name)} ${chalk.blueBright('with')} ${chalk.white(command.aliases && command.aliases.length ? command.aliases.length : 0)} ${chalk.blueBright('aliases')}`); console.log(`${chalk.gray('[LOAD]')} >> ${chalk.blueBright('Loaded Command')} ${chalk.white(command.name)} ${chalk.blueBright('with')} ${chalk.white(command.aliases && command.aliases.length ? command.aliases.length : 0)} ${chalk.blueBright('aliases')}`);
} }
/*cora.stop(); cora.clear(); /*cora.stop(); cora.clear();
console.log(`${chalk.gray('[BOOT]')} >> ${chalk.blue('Getting Commands...')}\n`); console.log(`${chalk.gray('[BOOT]')} >> ${chalk.blue('Getting Commands...')}\n`);
Array.from(client.commands.values()).forEach(command => { Array.from(client.commands.values()).forEach(command => {
console.log(`${chalk.gray('[LOG] ')} >> ${chalk.blueBright('Loaded Command')} ${chalk.white(command.name)} ${chalk.blueBright('with')} ${chalk.white(command.aliases && command.aliases.length ? command.aliases.length : 0)} ${chalk.blueBright('aliases')}`); console.log(`${chalk.gray('[LOAD]')} >> ${chalk.blueBright('Loaded Command')} ${chalk.white(command.name)} ${chalk.blueBright('with')} ${chalk.white(command.aliases && command.aliases.length ? command.aliases.length : 0)} ${chalk.blueBright('aliases')}`);
});*/ });*/
console.log(`\n${chalk.gray('[BOOT]')} >> ${chalk.blue('Loaded all Commands')}`); console.log(`\n${chalk.gray('[BOOT]')} >> ${chalk.blue('Loaded all Commands')}`);
}; };

@ -11,7 +11,7 @@ module.exports = client => {
let evt = require('../events/' + file); let evt = require('../events/' + file);
client.removeAllListeners(evtName); client.removeAllListeners(evtName);
client.on(evtName, evt.bind(null, client)); client.on(evtName, evt.bind(null, client));
console.log(`${chalk.gray('[LOG] ')} >> ${chalk.blueBright('Loaded Event')} ${chalk.white(evtName)}`); console.log(`${chalk.gray('[LOAD]')} >> ${chalk.blueBright('Loaded Event')} ${chalk.white(evtName)}`);
} }
console.log(`\n${chalk.gray('[BOOT]')} >> ${chalk.blue('Loaded all Events')}`); console.log(`\n${chalk.gray('[BOOT]')} >> ${chalk.blue('Loaded all Events')}`);
}; };

@ -10,7 +10,7 @@ module.exports = client => {
var response = require(`../responses/${responsef}`); var response = require(`../responses/${responsef}`);
client.responses.triggers.push([response.name, response.condition]); client.responses.triggers.push([response.name, response.condition]);
client.responses.commands.set(response.name, response); client.responses.commands.set(response.name, response);
console.log(`${chalk.gray('[LOG] ')} >> ${chalk.blueBright('Loaded Response')} ${chalk.white(response.name)}`); console.log(`${chalk.gray('[LOAD]')} >> ${chalk.blueBright('Loaded Response')} ${chalk.white(response.name)}`);
} }
console.log(`\n${chalk.gray('[BOOT]')} >> ${chalk.blue('Loaded all Responses')}`); console.log(`\n${chalk.gray('[BOOT]')} >> ${chalk.blue('Loaded all Responses')}`);
}; };

@ -22,5 +22,5 @@ module.exports = async (client) => {
let ora_lrCache = ora("Caching Level Roles...").start(); let ora_lrCache = ora("Caching Level Roles...").start();
await require('./cache/lr')(client); await require('./cache/lr')(client);
ora_lrCache.stop(); ora_lrCache.clear(); ora_lrCache.stop(); ora_lrCache.clear();
console.log(`${chalk.gray('[PROC]')} >> ${chalk.blueBright(`Cached`)} ${chalk.white(`${client.misc.cache.lxp.enabled.length}`)} ${chalk.blueBright(`guilds with Level Roles enabled.`)}`); console.log(`${chalk.gray('[PROC]')} >> ${chalk.blueBright(`Cached`)} ${chalk.white(`${client.misc.cache.lxp.hasLevelRoles.length}`)} ${chalk.blueBright(`guilds with Level Roles enabled.`)}`);
}; };
Loading…
Cancel
Save