Finish base help command and suffer with metadata

master
Kit Kasune 4 years ago
parent 5f06a6c63e
commit d71fb2ec74
  1. 6
      commands/8ball.js
  2. 6
      commands/admin.js
  3. 6
      commands/afk.js
  4. 6
      commands/autorole.js
  5. 8
      commands/avatar.js
  6. 6
      commands/bio.js
  7. 6
      commands/clearstatus.js
  8. 12
      commands/clearwarnings.js
  9. 6
      commands/cry.js
  10. 6
      commands/deathnote.js
  11. 6
      commands/developer.js
  12. 6
      commands/dnd.js
  13. 6
      commands/eval.js
  14. 48
      commands/help.js
  15. 6
      commands/hug.js
  16. 6
      commands/info.js
  17. 6
      commands/kiss.js
  18. 6
      commands/leave.js
  19. 14
      commands/logs.js
  20. 6
      commands/prefix.js
  21. 8
      commands/pull.js
  22. 6
      commands/randnum.js
  23. 6
      commands/reload.js
  24. 6
      commands/response.js
  25. 10
      commands/secretsanta.js
  26. 15
      commands/setstatus.js
  27. 6
      commands/sip.js
  28. 7
      commands/slap.js
  29. 6
      commands/staff.js
  30. 6
      commands/staffrole.js
  31. 6
      commands/starboard.js
  32. 6
      commands/support.js
  33. 44
      commands/testpage.js
  34. 6
      commands/togglestatuses.js
  35. 6
      commands/userinfo.js
  36. 6
      commands/vip.js
  37. 8
      commands/warn.js
  38. 6
      commands/welcome.js
  39. 12
      events/message.js
  40. 1
      util/pagination.js
  41. 3
      util/ts/pagination.ts

@ -7,6 +7,12 @@ module.exports = {
.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: {
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%!",
syntax: '`8ball <question>`',
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(" ");

@ -8,6 +8,12 @@ module.exports = {
.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: {
category: 'Developer',
description: "Add or remove users as Natsuki admins",
syntax: '`admin <add|remove|check> <@user|userID>`',
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}\``);}

@ -10,6 +10,12 @@ module.exports = {
.setDescription("Set your status within the bot as AFK and specify a reason. Then, when other people ping you, I can let them know that you're not available!") .setDescription("Set your status within the bot as AFK and specify a reason. Then, when other people ping you, I can let them know that you're not available!")
.addField("Syntax", "`afk [clearMode] <reason>`") .addField("Syntax", "`afk [clearMode] <reason>`")
.addField("Notice","Your status clear mode can be set to either 'auto' or 'manual'. If not specified, it will clear next time you send a message (auto)."), .addField("Notice","Your status clear mode can be set to either 'auto' or 'manual'. If not specified, it will clear next time you send a message (auto)."),
meta: {
category: 'Social',
description: "Tell others that you're AFK so that they'll be notified when you ping them.",
syntax: '`afk [clearMode] <reason>`',
extra: null
},
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
if (!args.length) {return message.channel.send(`Syntax: \`${prefix}afk [clearMode] <reason>\``);} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}afk [clearMode] <reason>\``);}
let tu = await UserData.findOne({uid: message.author.id}) let tu = await UserData.findOne({uid: message.author.id})

@ -9,6 +9,12 @@ module.exports = {
.setDescription("Set a role to be automatically added to users when they join the server.") .setDescription("Set a role to be automatically added to users when they join the server.")
.addField("Syntax", "`autorole <set|clear|view>`") .addField("Syntax", "`autorole <set|clear|view>`")
.addField('Notice', "This command can only be used by server staff members and admins."), .addField('Notice', "This command can only be used by server staff members and admins."),
meta: {
category: 'Moderation',
description: "Set a role to be automatically added when a member joins the server.",
syntax: '`autorole <set|clear|view>`',
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("This command is only available in servers.");} if (!message.guild) {return message.reply("This command is only available in servers.");}
if (!args.length) {return message.channel.send(`Syntax: \`${prefix}autorole <set|clear|view>\``);} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}autorole <set|clear|view>\``);}

@ -6,6 +6,12 @@ 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: {
category: 'Misc',
description: "Flare your avatar or peek at others'",
syntax: '`avatar [@mention]`',
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;
@ -16,7 +22,7 @@ module.exports = {
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})) .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();}

@ -7,6 +7,12 @@ module.exports = {
.setTitle("Help -> Bio") .setTitle("Help -> Bio")
.setDescription("Set and view user bios, which are fun ways to express yourself!") .setDescription("Set and view user bios, which are fun ways to express yourself!")
.addField("Syntax", "`bio <set|view|clear>`"), .addField("Syntax", "`bio <set|view|clear>`"),
meta: {
category: 'Social',
description: "Set your own user bio, which can be seen by everyone!",
syntax: '`bio <set|view|clear>`',
extra: null
},
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
if (!args.length) {return message.channel.send(`Syntax: \`${prefix}bio <set|view|clear>\``);} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}bio <set|view|clear>\``);}
let tu = await UserData.findOne({uid: message.author.id}) ? await UserData.findOne({uid: message.author.id}) : new UserData({uid: message.author.id}); let tu = await UserData.findOne({uid: message.author.id}) ? await UserData.findOne({uid: message.author.id}) : new UserData({uid: message.author.id});

@ -7,6 +7,12 @@ module.exports = {
name: "clearstatus", name: "clearstatus",
aliases: ['statusclear', 'cs'], aliases: ['statusclear', 'cs'],
help: "Clears your status, if you have one set. Does not take any arguments.", help: "Clears your status, if you have one set. Does not take any arguments.",
meta: {
category: 'Social',
description: "Clear your status, if you have one set.",
syntax: '`clearstatus`',
extra: null
},
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
let tu = await UserData.findOne({uid: message.author.id}); let tu = await UserData.findOne({uid: message.author.id});
if (!tu && !tu.statusmsg.length) { if (!tu && !tu.statusmsg.length) {

@ -6,15 +6,11 @@ module.exports = {
name: "clearwarnings", name: "clearwarnings",
aliases: ['clearwarn', 'cw', 'warnclear', 'wc', 'clearwarning'], aliases: ['clearwarn', 'cw', 'warnclear', 'wc', 'clearwarning'],
meta: { meta: {
category: "", category: 'Moderation',
perms: "", description: "Clear a user's warnings in your server.",
staff: false, syntax: '`clearwarnings <@user|userID>`',
vip: "", extra: null
serverPerms: [],
writtenBy: "",
serverOnly: false
}, },
tags: [],
help: new Discord.MessageEmbed() help: new Discord.MessageEmbed()
.setTitle("Help -> Warn Clearing") .setTitle("Help -> Warn Clearing")
.setDescription("Clears the warnigns of a user") .setDescription("Clears the warnigns of a user")

@ -7,6 +7,12 @@ module.exports = {
name: "cry", name: "cry",
aliases: ['sob'], aliases: ['sob'],
help: "Tell others that you're crying with `{{p}}cry`. We're here for you!", help: "Tell others that you're crying with `{{p}}cry`. We're here for you!",
meta: {
category: 'Social',
description: "Tell others that you're not feeling so well using this command.",
syntax: '`cry`',
extra: null
},
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
let savess = await Saves.findOne({name: 'cry'}) ? await Saves.findOne({name: 'cry'}) : new Saves({name: 'cry'}); let savess = await Saves.findOne({name: 'cry'}) ? await Saves.findOne({name: 'cry'}) : new Saves({name: 'cry'});
let saves = savess.saves; let saves = savess.saves;

@ -56,6 +56,12 @@ module.exports = {
.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: {
category: 'Fun',
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]`',
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]\``);}

@ -10,6 +10,12 @@ module.exports = {
.setDescription("Add or remove users as Natsuki developers.") .setDescription("Add or remove users as Natsuki developers.")
.addField("Syntax", "`developer <add|remove> <@user|userID>`") .addField("Syntax", "`developer <add|remove> <@user|userID>`")
.addField("Notice", "You must already be a developer of Natsuki in order to use this command."), .addField("Notice", "You must already be a developer of Natsuki in order to use this command."),
meta: {
category: 'Developer',
description: "Add or remove users as Natsuki developers",
syntax: '`developer <add|remove|check> <@user|userID>`',
extra: "You can check if a user is a developer 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}developer <add|remove> <@user|userID>\``);} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}developer <add|remove> <@user|userID>\``);}

@ -10,6 +10,12 @@ module.exports = {
.setDescription("Set your status within the bot as DnD and specify a reason. Then, when other people ping you, I can let them know that you don't want to be disturbed!") .setDescription("Set your status within the bot as DnD and specify a reason. Then, when other people ping you, I can let them know that you don't want to be disturbed!")
.addField("Syntax", "`dnd [clearMode] <reason>`") .addField("Syntax", "`dnd [clearMode] <reason>`")
.addField("Notice","Your status clear mode can be set to either 'auto' or 'manual'. If not specified, it will clear when you use `n?clearstatus`."), .addField("Notice","Your status clear mode can be set to either 'auto' or 'manual'. If not specified, it will clear when you use `n?clearstatus`."),
meta: {
category: 'Social',
description: "Tell others not to disturb you so that they'll know not to ping you.",
syntax: '`dnd [clearMode] <reason>`',
extra: null
},
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
if (!args.length) {return message.channel.send(`Syntax: \`${prefix}dnd [clearMode] <reason>\``);} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}dnd [clearMode] <reason>\``);}
let tu = await UserData.findOne({uid: message.author.id}) let tu = await UserData.findOne({uid: message.author.id})

@ -8,6 +8,12 @@ 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: {
category: 'Developer',
description: "Evaluates raw JavaScript code. Nerd access only.",
syntax: '`eval <code>`',
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.");};

@ -1,6 +1,7 @@
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');
module.exports = { module.exports = {
name: "help", name: "help",
@ -8,7 +9,52 @@ module.exports = {
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) {
return message.channel.send("Heya! My help command is currently under construction since my devs are hard at work on my commands and they haven't released me to the full public yet! Consider yourself lucky..."); let sorted = {};
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][command.name] = command;
}});
let helpSorted = {};
let category; for (category of Object.keys(sorted)) {
let categorySorted = [];
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 commands = Object.keys(sorted[category]);
let command; for (command of commands) {
let aliases = '';
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';
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;
if (current === 5) {
categorySorted.push(currentEmbed);
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");
}
}
if (current > 1) {categorySorted.push(currentEmbed);}
helpSorted[category] = categorySorted;
}
let cat = await ask(message, "What would you like help with? (`Fun`|`Roleplay`|`Utility`|`Misc`|`Moderation`|`Social`) 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', 'a', 'all'].includes(`${cat}`.trim().toLowerCase())) {return message.channel.send("That wasn't a valid response! Try again?");}
let pages;
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 (['m', 'misc', 'miscellaneous'].includes(`${cat}`.trim().toLowerCase())) {pages = helpSorted['Misc'];}
if (['d', 'dev', 'developer'].includes(`${cat}`.trim().toLowerCase())) {pages = helpSorted['Developer'];}
if (['mod', 'moderation'].includes(`${cat}`.trim().toLowerCase())) {pages = helpSorted['Moderation'];}
if (['s', 'social'].includes(`${cat}`.trim().toLowerCase())) {pages = helpSorted['Social'];}
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);
if (pages.length > 1) {
let help = new Pagination(message.channel, pages, message, client, true);
return await help.start({endTime: 120000, user: message.author.id});
} 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]);}

@ -6,6 +6,12 @@ const makeId = require('../util/makeid');
module.exports = { module.exports = {
name: "hug", name: "hug",
help: "Tell others that you need a hug with `{{p}}hug`, or give one by mentioning someone to hug!", help: "Tell others that you need a hug with `{{p}}hug`, or give one by mentioning someone to hug!",
meta: {
category: 'Social',
description: "Give someone a hug, or tell others that you need one! We've got your back :p",
syntax: '`hug <@user>`',
extra: null
},
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
let savess = await Saves.findOne({name: 'hug'}) ? await Saves.findOne({name: 'hug'}) : new Saves({name: 'hug'}); let savess = await Saves.findOne({name: 'hug'}) ? await Saves.findOne({name: 'hug'}) : new Saves({name: 'hug'});
let saves = savess.saves; let saves = savess.saves;

@ -5,6 +5,12 @@ module.exports = {
name: "info", name: "info",
aliases: ["i", "botinfo", "bot"], aliases: ["i", "botinfo", "bot"],
help: "There's not really anything to help with here! Just use `{{p}}info` to learn more about me!", help: "There's not really anything to help with here! Just use `{{p}}info` to learn more about me!",
meta: {
category: 'Misc',
description: "Get info about me, my creators, and my status.",
syntax: '`info`',
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'});

@ -6,6 +6,12 @@ const makeId = require('../util/makeid');
module.exports = { module.exports = {
name: "kiss", name: "kiss",
help: "Ask for a kiss with `{{p}}kiss`, or give one by mentioning someone!", help: "Ask for a kiss with `{{p}}kiss`, or give one by mentioning someone!",
meta: {
category: 'Fun',
description: "Give someone a kiss, or show that you're looking for one. Best of luck pal!",
syntax: '`kiss <@user>`',
extra: null
},
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
let savess = await Saves.findOne({name: 'kiss'}) ? await Saves.findOne({name: 'kiss'}) : new Saves({name: 'kiss'}); let savess = await Saves.findOne({name: 'kiss'}) ? await Saves.findOne({name: 'kiss'}) : new Saves({name: 'kiss'});
let saves = savess.saves; let saves = savess.saves;

@ -12,6 +12,12 @@ module.exports = {
.addField("Syntax", "`leave <set|clear|view|test>`") .addField("Syntax", "`leave <set|clear|view|test>`")
.addField("Notice", "You must be a staff or admin in your server to edit these settings.") .addField("Notice", "You must be a staff or admin in your server to edit these settings.")
.addField("Responses", "Your leave message should be generated through a response using my `response` command, and then bound to the leave message by providing your response's name."), .addField("Responses", "Your leave message should be generated through a response using my `response` command, and then bound to the leave message by providing your response's name."),
meta: {
category: 'Moderation',
description: "Set the channel and message to be sent when a user leaves the server.",
syntax: '`leave <set|clear|view|test>`',
extra: "You must use the `response` command to create a response. The response's name is what will be given in this command."
},
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}) ? await GuildData.findOne({gid: message.guild.id}) : new GuildData({gid: message.guild.id}); let tg = await GuildData.findOne({gid: message.guild.id}) ? await GuildData.findOne({gid: message.guild.id}) : new GuildData({gid: message.guild.id});

@ -38,10 +38,16 @@ 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: {
category: 'Moderation',
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]`',
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});

@ -10,6 +10,12 @@ module.exports = {
.addField("Syntax", "`prefix <newPrefix|clear>`") .addField("Syntax", "`prefix <newPrefix|clear>`")
.addField("Staff Command", "This command requires you to either be admin, or to have the designated staff role.") .addField("Staff Command", "This command requires you to either be admin, or to have the designated staff role.")
.addField("Notice", "Prefixes are cached, and may take up to a minute to update."), .addField("Notice", "Prefixes are cached, and may take up to a minute to update."),
meta: {
category: 'Misc',
description: "Change my prefix in your server.",
syntax: '`prefix <newPrefix|clear>`',
extra: "You can always mention me and then type your command in place of a prefix in case you forget it."
},
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!");}
let tguild = await GuildSettings.findOne({gid: message.guild.id}) let tguild = await GuildSettings.findOne({gid: message.guild.id})

@ -9,8 +9,14 @@ module.exports = {
help: new Discord.MessageEmbed() help: new Discord.MessageEmbed()
.setTitle("Help -> VCS Pull") .setTitle("Help -> VCS Pull")
.setDescription("Pulls new commits from VCS") .setDescription("Pulls new commits from VCS")
.addField("Syntax", "`refresh`") .addField("Syntax", "`pull`")
.addField("Notice", "This command is only available to Natsuki developers."), .addField("Notice", "This command is only available to Natsuki developers."),
meta: {
category: 'Developer',
description: "Pull new commits from VSC and update the bot. Otaku zone, non-otakus not allowed.",
syntax: '`pull`',
extra: "You'll still need to use `reload` afterwards"
},
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
const tu = await UserData.findOne({uid: message.author.id}); const tu = await UserData.findOne({uid: message.author.id});
if (!tu || !tu.developer) {return message.channel.send("You must be a Natsuki developer in order to do this!");} if (!tu || !tu.developer) {return message.channel.send("You must be a Natsuki developer in order to do this!");}

@ -17,6 +17,12 @@ module.exports = {
.setTitle("Help -> Random Numbers") .setTitle("Help -> Random Numbers")
.setDescription("Generates a Random Number in the specified range.") .setDescription("Generates a Random Number in the specified range.")
.addField("Syntax", "`randnum <min> <max> [count]`"), .addField("Syntax", "`randnum <min> <max> [count]`"),
meta: {
category: 'Utility',
description: "Generate a random number... or a lot of them. It's up to you, really.",
syntax: '`randnum <min> <max> [count]`',
extra: null
},
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
if (!args.length) {return message.channel.send(`Syntax: \`${prefix}randnum <min> <max> [count]\``);} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}randnum <min> <max> [count]\``);}
if (args.length < 2) {return message.channel.send("You have to specify two numbers");} if (args.length < 2) {return message.channel.send("You have to specify two numbers");}

@ -11,6 +11,12 @@ module.exports = {
.setDescription("Reloads the system extensions by refreshing all command and event files into client without terminating the node process. *Hi I'm Wubzy and this makes no sense to anyone but discord.js devs because we're nerds*") .setDescription("Reloads the system extensions by refreshing all command and event files into client without terminating the node process. *Hi I'm Wubzy and this makes no sense to anyone but discord.js devs because we're nerds*")
.addField("Syntax", "`refresh [log]`. Adding 'log' will log to the console as though the bot were in startup.") .addField("Syntax", "`refresh [log]`. Adding 'log' will log to the console as though the bot were in startup.")
.addField("Notice", "This command is only available to Natsuki developers."), .addField("Notice", "This command is only available to Natsuki developers."),
meta: {
category: 'Developer',
description: "Refresh all client commands and events and clear most of the require cache. Only two people can use this command and they're probably not you.",
syntax: '`reload`',
extra: null
},
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
if (!args.length) { if (!args.length) {
const tu = await UserData.findOne({uid: message.author.id}); const tu = await UserData.findOne({uid: message.author.id});

@ -15,6 +15,12 @@ module.exports = {
.setDescription("Configure your server's saved responses. These are reusable and editable, and can be placed in things like welcome messages and used for announcements.") .setDescription("Configure your server's saved responses. These are reusable and editable, and can be placed in things like welcome messages and used for announcements.")
.addField("Syntax", "`response <new|edit|view|list|delete|test|quick>`") .addField("Syntax", "`response <new|edit|view|list|delete|test|quick>`")
.addField("Notice", "You must have your server's staff role or be an admin to use this command."), .addField("Notice", "You must have your server's staff role or be an admin to use this command."),
meta: {
category: 'Moderation',
description: "Set responses that can be used for various purposes in your server, namely welcome and leave messages.",
syntax: '`response <new|edit|view|list|delete|test|quick>`',
extra: "Response editing is currently not available and will be Soon:tm:"
},
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 GuildData.findOne({gid: message.guild.id}); let tg = await GuildData.findOne({gid: message.guild.id});

@ -9,9 +9,15 @@ module.exports = {
help: new Discord.MessageEmbed() help: new Discord.MessageEmbed()
.setTitle("Help -> Secret Santa") .setTitle("Help -> Secret Santa")
.setDescription("Create a secret santa for all of your friends or for your server! Whether you celebrate the holidays or not, this can still be loads of fun!") .setDescription("Create a secret santa for all of your friends or for your server! Whether you celebrate the holidays or not, this can still be loads of fun!")
.addField("Syntax", "``"), .addField("Syntax", "`secretsanta <create|join|start|end|kick>`"),
meta: {
category: 'Fun',
description: "Create and join fully-functioning secret santas. I even randomize the assignments for you, how neat!",
syntax: '`secretsanta <create|join|start|end|kick>`',
extra: "It's not Christmas anymore, but you know what, who cares. Some features of this command, such as `end` and `kick` are not available/not working."
},
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
if (!args.length) {return message.channel.send(`Syntax: \`${prefix}\``);} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}secretsanta <create|join|start|end|kick>\``);}
if (['create', 'new', 'c', 'n', 's'].includes(args[0].toLowerCase())) { if (['create', 'new', 'c', 'n', 's'].includes(args[0].toLowerCase())) {
function clearDM() {client.misc.activeDMs.delete(message.author.id);} function clearDM() {client.misc.activeDMs.delete(message.author.id);}
if (client.misc.activeDMs.has(message.author.id)) {return message.reply("I'm already asking you questions in DM for a separate command! Finish that command before using this one.");} if (client.misc.activeDMs.has(message.author.id)) {return message.reply("I'm already asking you questions in DM for a separate command! Finish that command before using this one.");}

@ -9,22 +9,19 @@ module.exports = {
name: "setstatus", name: "setstatus",
aliases: ['sst'], aliases: ['sst'],
meta: { meta: {
category: "", category: 'Developer',
perms: "", description: "Set my public status. Don't make me say something weird! (Also only available to devs, of course.)",
staff: false, syntax: '`setstatus <-s status> <-t type>`',
vip: "", extra: "You can check if a user is an admin without being a developer."
serverPerms: [],
writtenBy: "",
serverOnly: false
}, },
tags: [], tags: [],
help: new Discord.MessageEmbed() help: new Discord.MessageEmbed()
.setTitle("Help -> Status-Setting") .setTitle("Help -> Status-Setting")
.setDescription("Sets the bot's status") .setDescription("Sets the bot's status")
.addField("Syntax", "`setstatus <status> [type]`") .addField("Syntax", "`setstatus <-s status> <-t type>`")
.addField('Notice', "This command is **developer-only**"), .addField('Notice', "This command is **developer-only**"),
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
if (!args.length) {return message.channel.send(`Syntax: \`${prefix}setstatus <status> [type]\``);} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}setstatus <-s status> <-t type>\``);}
let tu = await UserData.findOne({uid: message.author.id}); let tu = await UserData.findOne({uid: message.author.id});
if (!tu || !tu.developer) {return message.channel.send("You must be a Natsuki developer in order to do that!");} if (!tu || !tu.developer) {return message.channel.send("You must be a Natsuki developer in order to do that!");}

@ -6,6 +6,12 @@ const makeId = require('../util/makeid');
module.exports = { module.exports = {
name: "sip", name: "sip",
help: "Take a sip and watch the shenanigans unfold using `{{p}}sip`.", help: "Take a sip and watch the shenanigans unfold using `{{p}}sip`.",
meta: {
category: 'Social',
description: "Take a sip and watch the shenanigans unfold. Slurp if you're feeling... risqué.",
syntax: '`sip`',
extra: null
},
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
let savess = await Saves.findOne({name: 'sip'}) ? await Saves.findOne({name: 'sip'}) : new Saves({name: 'sip'}); let savess = await Saves.findOne({name: 'sip'}) ? await Saves.findOne({name: 'sip'}) : new Saves({name: 'sip'});
let saves = savess.saves; let saves = savess.saves;

@ -5,7 +5,14 @@ const makeId = require('../util/makeid');
module.exports = { module.exports = {
name: "slap", name: "slap",
aliases: ['hit'],
help: "Use `{{p}}slap @person` to have me personally deliver your anger to them with a nice s l a p.", 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) { async execute(message, msg, args, cmd, prefix, mention, client) {
let savess = await Saves.findOne({name: 'slap'}) ? await Saves.findOne({name: 'slap'}) : new Saves({name: 'slap'}); let savess = await Saves.findOne({name: 'slap'}) ? await Saves.findOne({name: 'slap'}) : new Saves({name: 'slap'});
let saves = savess.saves; let saves = savess.saves;

@ -8,6 +8,12 @@ module.exports = {
.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: {
category: 'Developer',
description: "Add or remove users as Natsuki staff",
syntax: '`staff <add|remove|check> <@user|userID>`',
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}\``);}

@ -6,6 +6,12 @@ module.exports = {
name: "staffrole", name: "staffrole",
aliases: ['sr', 'setstaffrole'], aliases: ['sr', 'setstaffrole'],
help: "Set your server's staff role, which allows users with that role to modify my settings in this server. You must be an admin in the server to change this setting.", help: "Set your server's staff role, which allows users with that role to modify my settings in this server. You must be an admin in the server to change this setting.",
meta: {
category: 'Moderation',
description: "Set the role that can edit my settings for the server",
syntax: '`staffrole <@role|roleID|clear|view>`',
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("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}staffrole <@role|roleID|clear|view>\``);} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}staffrole <@role|roleID|clear|view>\``);}

@ -10,6 +10,12 @@ module.exports = {
.setDescription("Setup and view information on this server's starboard! This allows messages to be sent to a dedicated channel when they receive a set number of star messages.") .setDescription("Setup and view information on this server's starboard! This allows messages to be sent to a dedicated channel when they receive a set number of star messages.")
.addField("Syntax", "`starboard <setup|view|enable|disable|toggle>`") .addField("Syntax", "`starboard <setup|view|enable|disable|toggle>`")
.addField("Notice", "You must have the staff-role or be an admin in order to set up or toggle the starboard"), .addField("Notice", "You must have the staff-role or be an admin in order to set up or toggle the starboard"),
meta: {
category: 'Social',
description: "Set up a star board to feature users' messages in",
syntax: '`starboard <setup|view|enable|disable|toggle>`',
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 in order to use this command.");} if (!message.guild) {return message.reply("You must be in a server in order to use this command.");}
if (!args.length) {return message.channel.send(`Syntax: \`${prefix}starboard <setup|view|enable|disable|toggle>\``);} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}starboard <setup|view|enable|disable|toggle>\``);}

@ -8,6 +8,12 @@ module.exports = {
.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: {
category: 'Developer',
description: "Add or remove users as Natsuki support",
syntax: '`support <add|remove|check> <@user|userID>`',
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}\``);}

@ -1,44 +0,0 @@
const Discord = require('discord.js');
const {Pagination} = require('../util/pagination');
module.exports = {
name: "testpage",
aliases: ['tp'],
meta: {
category: "",
perms: "",
staff: false,
vip: "",
serverPerms: [],
writtenBy: "",
serverOnly: false
},
tags: [],
help: new Discord.MessageEmbed()
.setTitle("Help -> ")
.setDescription("")
.addField("Syntax", "``"),
async execute(message, msg, args, cmd, prefix, mention, client) {
let p = await new Pagination(message.channel, [
new Discord.MessageEmbed()
.setTitle("bonk")
.setDescription("bonk horny jail")
.addField("bonk", "you have been bonked")
.setColor('c375f0'),
new Discord.MessageEmbed()
.setTitle("stonks")
.setDescription("yeet")
.setColor('c375f0'),
new Discord.MessageEmbed()
.setTitle("honks")
.setDescription("such wow many honks")
.addField("aye", "lul text")
.setColor('c375f0'),
new Discord.MessageEmbed()
.setTitle("yoink")
.setDescription("give me the vibes")
.addField("vibecheck", "your vibe will now be checked.")
.setColor('c375f0'),
], message, client).start({endTime: 60000, user: message.author.id});
}
};

@ -8,6 +8,12 @@ module.exports = {
.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: {
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!",
syntax: '`togglestatuses [-c]`',
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});

@ -7,6 +7,12 @@ module.exports = {
name: "userinfo", name: "userinfo",
aliases: ['ui', 'memberinfo', 'user'], aliases: ['ui', 'memberinfo', 'user'],
help: "Shows your info, or shows the info of a user you ping.", help: "Shows your info, or shows the info of a user you ping.",
meta: {
category: 'Misc',
description: "See some info about a user",
syntax: '`userinfo [@user]`',
extra: null
},
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
let person = message.guild ? mention ? message.guild.members.cache.get(mention.id) : args[0] ? message.guild.members.cache.has(args[0]) ? message.guild.members.cache.get(args[0]) : message.member : message.member : message.author; let person = message.guild ? mention ? message.guild.members.cache.get(mention.id) : args[0] ? message.guild.members.cache.has(args[0]) ? message.guild.members.cache.get(args[0]) : message.member : message.member : message.author;
let name = message.guild ? person.displayName : person.username; let name = message.guild ? person.displayName : person.username;

@ -8,6 +8,12 @@ module.exports = {
.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: {
category: 'Developer',
description: "Set server VIP status",
syntax: '`vip <add|remove|check>`',
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>\``);}

@ -9,9 +9,15 @@ module.exports = {
name: "warn", name: "warn",
help: new Discord.MessageEmbed() help: new Discord.MessageEmbed()
.setTitle("Help -> Warnings") .setTitle("Help -> Warnings")
.setDescription("") .setDescription("Warn misbehaving members that what they are doing is wrong, and have it stored in a database in order to see a list of all their past warnings")
.addField("Syntax", "`warn <@member> <warningMessage|check|clear>`") .addField("Syntax", "`warn <@member> <warningMessage|check|clear>`")
.addField("Notice", "You must be a server administrator in order to use this command."), .addField("Notice", "You must be a server administrator in order to use this command."),
meta: {
category: 'Moderation',
description: "Warn misbehaving members that what they are doing is wrong, and have it stored in a database in order to see a list of all their past warnings",
syntax: '`warn <@member> <warningMessage|check|clear>`',
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.channel.send("This is a server-only command.");} if (!message.guild) {return message.channel.send("This is a server-only command.");}
if (!args.length) {return message.channel.send(`Syntax: \`${prefix}warn <@member> <warningMessage|check|clear>\``);} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}warn <@member> <warningMessage|check|clear>\``);}

@ -12,6 +12,12 @@ module.exports = {
.addField("Syntax", "`welcome <set|clear|view|test>`") .addField("Syntax", "`welcome <set|clear|view|test>`")
.addField("Notice", "You must be a staff or admin in your server to edit these settings.") .addField("Notice", "You must be a staff or admin in your server to edit these settings.")
.addField("Responses", "Your welcome message should be generated through a response using my `response` command, and then bound to the welcome message by providing your response's name."), .addField("Responses", "Your welcome message should be generated through a response using my `response` command, and then bound to the welcome message by providing your response's name."),
meta: {
category: 'Moderation',
description: "Set the channel and message to be sent when a user joins the server.",
syntax: '`welcome <set|clear|view|test>`',
extra: "You'll need to use `response` to configure the message that you want sent with this command. The name you give the response is what you'll give to this command"
},
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}) ? await GuildData.findOne({gid: message.guild.id}) : new GuildData({gid: message.guild.id}); let tg = await GuildData.findOne({gid: message.guild.id}) ? await GuildData.findOne({gid: message.guild.id}) : new GuildData({gid: message.guild.id});

@ -14,16 +14,16 @@ module.exports = async (client, message) => {
if (message.guild && !message.member.permissions.has("SEND_MESSAGES")) {return undefined;} if (message.guild && !message.member.permissions.has("SEND_MESSAGES")) {return undefined;}
var prefix = message.guild ? client.guildconfig.prefixes.has(message.guild.id) ? client.guildconfig.prefixes.get(message.guild.id) !== null ? client.guildconfig.prefixes.get(message.guild.id) : 'n?' : 'n?' : 'n?'; let prefix = message.guild ? client.guildconfig.prefixes.has(message.guild.id) ? client.guildconfig.prefixes.get(message.guild.id) !== null ? client.guildconfig.prefixes.get(message.guild.id) : 'n?' : 'n?' : 'n?';
var msg = message.content.toLowerCase(); let msg = message.content.toLowerCase();
var mention = message.mentions.users.first(); let mention = message.mentions.users.first();
var args = msg.startsWith(prefix) let args = msg.startsWith(prefix)
? message.content.slice(prefix.length).trim().split(/\s+/g) ? message.content.slice(prefix.length).trim().split(/\s+/g)
: msg.startsWith('<@!') : msg.startsWith('<@!')
? message.content.slice(4 + client.user.id.length).trim().split(/\s+/g) ? message.content.slice(4 + client.user.id.length).trim().split(/\s+/g)
: message.content.slice(3 + client.user.id.length).trim().split(/\s+/g); : message.content.slice(3 + client.user.id.length).trim().split(/\s+/g);
var cmd = args.shift().toLowerCase().trim(); let cmd = args.shift().toLowerCase().trim();
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()
@ -58,7 +58,7 @@ module.exports = async (client, message) => {
} }
let trigger; for (trigger of client.responses.triggers) {if (await trigger[1](message, msg, args, cmd, prefix, mention, client)) {await client.responses.commands.get(trigger[0]).execute(message, msg, args, cmd, prefix, mention, client); break;}} let trigger; for (trigger of client.responses.triggers) {if (await trigger[1](message, msg, args, cmd, prefix, mention, client)) {await client.responses.commands.get(trigger[0]).execute(message, msg, args, cmd, prefix, mention, client); break;}}
} catch (e) { } catch (e) {
var 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}] | In ${message.guild.name}\n`)}`, e); console.error(`\n${chalk.red('[ERROR]')} >> ${chalk.yellow(`At [${date}] | In ${message.guild.name}\n`)}`, e);
} }
}; };

@ -88,7 +88,6 @@ class Pagination {
: (r) => { return emoji.includes(r.emoji.name); }; : (r) => { return emoji.includes(r.emoji.name); };
this.controllers.collector = this.message.createReactionCollector(filter, { time: 450000 }); this.controllers.collector = this.message.createReactionCollector(filter, { time: 450000 });
this.controllers.collector.on('collect', async (r) => { this.controllers.collector.on('collect', async (r) => {
console.log(r);
let functions = { let functions = {
'⬅': () => { return this.prevPage(); }, '⬅': () => { return this.prevPage(); },
'➡': () => { return this.nextPage(); }, '➡': () => { return this.nextPage(); },

@ -31,7 +31,7 @@ export class Pagination {
if (!this.message) { if (!this.message) {
let tempm = await this.channel.send("One moment...") let tempm = await this.channel.send("One moment...")
.catch(() => {this.originalMessage.reply("There seemed to be a problem doing that..."); return this;}); .catch(() => {this.originalMessage.reply("There seemed to be a problem doing that..."); return this;});
if (tempm instanceof Pagination) {return this;} if (tempm instanceof Pagination) {return this;}
else {this.message = tempm;} else {this.message = tempm;}
} }
@ -98,7 +98,6 @@ export class Pagination {
this.controllers.collector = this.message.createReactionCollector(filter, {time: 450000}); this.controllers.collector = this.message.createReactionCollector(filter, {time: 450000});
this.controllers.collector.on('collect', async (r: MessageReaction) => { this.controllers.collector.on('collect', async (r: MessageReaction) => {
console.log(r);
let functions = { let functions = {
'⬅': () => {return this.prevPage();}, '⬅': () => {return this.prevPage();},
'➡': () => {return this.nextPage();}, '➡': () => {return this.nextPage();},

Loading…
Cancel
Save