master
Kit Kasune 4 years ago
parent 170f7437f8
commit c41b19858e
  1. 2
      bot.js
  2. 4
      commands/dev/reload.js
  3. 47
      commands/fun/bite.js
  4. 2
      commands/misc/ar.js
  5. 5
      commands/misc/help.js
  6. 2
      events/message.js

@ -6,7 +6,7 @@ const ora = require('ora');
const mongoose = require('mongoose'); const mongoose = require('mongoose');
client.misc = { client.misc = {
savers: ['497598953206841375'], savers: ['497598953206841375', '480535078150340609'],
activeDMs: new Discord.Collection(), activeDMs: new Discord.Collection(),
statusPings: new Discord.Collection(), statusPings: new Discord.Collection(),
startup: new Date(), startup: new Date(),

@ -43,7 +43,7 @@ module.exports = {
let eventFilter = fs.readdirSync('./events/').filter(x => x.endsWith('.js')); let eventFilter = fs.readdirSync('./events/').filter(x => x.endsWith('.js'));
for (let file of eventFilter) { for (let file of eventFilter) {
let evtName = file.split('.')[0]; let evtName = file.split('.')[0];
if (Object.keys(require.cache).includes(require.resolve('../events/' + file))) {delete require.cache[require.resolve('../events/' + file)];} if (Object.keys(require.cache).includes(require.resolve('../../events/' + file))) {delete require.cache[require.resolve('../../events/' + file)];}
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));
@ -55,7 +55,7 @@ module.exports = {
let responses = fs.readdirSync('./responses').filter(file => file.endsWith('.js')); let responses = fs.readdirSync('./responses').filter(file => file.endsWith('.js'));
client.responses.triggers = []; client.responses.triggers = [];
for (let responsef of responses) { for (let responsef of responses) {
if (Object.keys(require.cache).includes(require.resolve(`../responses/${responsef}`))) {delete require.cache[require.resolve(`../responses/${responsef}`)];} if (Object.keys(require.cache).includes(require.resolve(`../responses/${responsef}`))) {delete require.cache[require.resolve(`../../responses/${responsef}`)];}
let response = require(`../responses/${responsef}`); let 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);

@ -0,0 +1,47 @@
const Discord = require('discord.js');
const Saves = require('../../models/saves');
const UserData = require('../../models/user');
const makeId = require('../../util/makeid');
module.exports = {
name: "bite",
aliases: [],
help: "Use `{{p}}slap @person` to have me personally deliver your anger to them with a nice s l a p.",
meta: {
category: 'Fun',
description: "Slap another user! Virtually, of course.",
syntax: '`slap <@user>`',
extra: null
},
async execute(message, msg, args, cmd, prefix, mention, client) {
let savess = await Saves.findOne({name: 'bite'}) || new Saves({name: 'bite'});
let saves = savess.saves;
if (!args.length) {
return message.channel.send(message.guild ? "Please mention someone to bite!" : "Oi! I get it if you don't like me but you can't just waltz into my DMs and bite me!");}
if (mention && args[0].match(/^<@(?:!?)(?:\d+)>$/)) {
if (!message.guild) {return message.reply("Oi! I get it if you don't like me but you can't just waltz into my DMs and bite me!");}
if (!message.guild.members.cache.has(mention.id)) {return message.reply("That user is not in this server!");}
if (message.author.id === mention.id) {return message.reply("Ew quit tryna bite yourself, that's weird.");}
return message.channel.send(new Discord.MessageEmbed()
.setAuthor(`${message.guild ? message.member.displayName : message.author.username} bites ${message.guild.members.cache.get(mention.id).displayName}`, message.author.avatarURL())
.setImage(String(Array.from(saves.values())[Math.floor(Math.random() * saves.size)]))
.setColor('d93846')
);
}
if (['s', 'save', 'n', 'new', 'a', 'add'].includes(args[0].toLowerCase())) {
if (!args[1]) {return message.channel.send('oi there cunt, give me a link of an image to add!');}
let tu = await UserData.findOne({uid: message.author.id});
if ((!tu || !tu.developer) && !client.misc.savers.includes(message.author.id)) {return message.reply("You must be a Natsuki Developer in order to add new bite GIFs.");}
let e = true;
let id;
while (e === true) {id = makeId(6); if (!saves.has(id)) {e = false;}}
args.shift();
saves.set(id, args.join(" ").trim());
savess.saves = saves;
savess.save();
return message.channel.send("Save added!");
}
}
};

@ -21,7 +21,7 @@ module.exports = {
.addField("Notice", "This command is server-only, and requires you to be an administrator or have the staff role."), .addField("Notice", "This command is server-only, and requires you to be an administrator or have the staff role."),
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
if (!message.guild) {return message.channel.send("You must be in a server in order to use this command.");} if (!message.guild) {return message.channel.send("You must be in a server in order to use this command.");}
if (!args.length) {return message.channel.send(`Syntax: \`${prefix}<add|edit|delete|settings|list>\``);} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}ar <add|edit|delete|settings|list>\``);}
const tg = await GuildData.findOne({gid: message.guild.id}); const tg = await GuildData.findOne({gid: message.guild.id});
if (['a', 'add', 'e', 'edit', 'delete', 'd', 's', 'settings'].includes(args[0].toLowerCase()) && ((!tg || !tg.staffrole || !tg.staffrole.length || !message.member.roles.cache.has(tg.staffrole)) && !message.member.permissions.has("ADMINISTRATOR"))) {return message.channel.send("You must have the staff role or be an administrator in this server in order to edit AR settings.");} if (['a', 'add', 'e', 'edit', 'delete', 'd', 's', 'settings'].includes(args[0].toLowerCase()) && ((!tg || !tg.staffrole || !tg.staffrole.length || !message.member.roles.cache.has(tg.staffrole)) && !message.member.permissions.has("ADMINISTRATOR"))) {return message.channel.send("You must have the staff role or be an administrator in this server in order to edit AR settings.");}

@ -36,12 +36,11 @@ module.exports = {
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`|`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', '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 (['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'];}

@ -26,6 +26,8 @@ module.exports = async (client, message) => {
: message.content.slice(3 + client.user.id.length).trim().split(/\s+/g); : message.content.slice(3 + client.user.id.length).trim().split(/\s+/g);
let cmd = args.shift().toLowerCase().trim(); let cmd = args.shift().toLowerCase().trim();
if (message.content.includes("@everyone")) {return;}
if ([`<@${client.user.id}>`, `<@!${client.user.id}>`].includes(msg)) { if ([`<@${client.user.id}>`, `<@!${client.user.id}>`].includes(msg)) {
return message.channel.send(new Discord.MessageEmbed() return message.channel.send(new Discord.MessageEmbed()
.setTitle(["Yep, that's me!", "^^ Hiya!", "Oh, hi there!", "Sure, what's up?", "How can I help!", "Natsuki is busy, but I can take a message for you!", "Teehee that's me!", "You were looking for Natsuki Tivastl, right?", "Sure! What's up?", "Pong!"][Math.floor(Math.random() * 10)]) .setTitle(["Yep, that's me!", "^^ Hiya!", "Oh, hi there!", "Sure, what's up?", "How can I help!", "Natsuki is busy, but I can take a message for you!", "Teehee that's me!", "You were looking for Natsuki Tivastl, right?", "Sure! What's up?", "Pong!"][Math.floor(Math.random() * 10)])

Loading…
Cancel
Save