diff --git a/commands/8ball.js b/commands/8ball.js index 4e45f48..8a6920c 100644 --- a/commands/8ball.js +++ b/commands/8ball.js @@ -7,6 +7,12 @@ module.exports = { .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%!") .addField("Syntax", "`8ball `"), + 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 `', + extra: null + }, execute(message, msg, args, cmd, prefix, mention, client) { if (!args.length) {return message.channel.send(`Syntax: \`${prefix}8ball \``);} let question = args.join(" "); diff --git a/commands/admin.js b/commands/admin.js index d82f594..6934843 100644 --- a/commands/admin.js +++ b/commands/admin.js @@ -8,6 +8,12 @@ module.exports = { .setDescription("Make a user a Natsuki admin") .addField("Syntax", "`admin <@user|userID>`") .addField("Notice", "This command is only available to Natsuki developers."), + meta: { + category: 'Developer', + description: "Add or remove users as Natsuki admins", + syntax: '`admin <@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) { if (!message.guild) {return message.reply("This is a guild-only command.");} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}\``);} diff --git a/commands/afk.js b/commands/afk.js index d73f251..9a9e795 100644 --- a/commands/afk.js +++ b/commands/afk.js @@ -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!") .addField("Syntax", "`afk [clearMode] `") .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] `', + extra: null + }, async execute(message, msg, args, cmd, prefix, mention, client) { if (!args.length) {return message.channel.send(`Syntax: \`${prefix}afk [clearMode] \``);} let tu = await UserData.findOne({uid: message.author.id}) diff --git a/commands/autorole.js b/commands/autorole.js index d8ee895..05b757d 100644 --- a/commands/autorole.js +++ b/commands/autorole.js @@ -9,6 +9,12 @@ module.exports = { .setDescription("Set a role to be automatically added to users when they join the server.") .addField("Syntax", "`autorole `") .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 `', + extra: null + }, async execute(message, msg, args, cmd, prefix, mention, client) { if (!message.guild) {return message.reply("This command is only available in servers.");} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}autorole \``);} diff --git a/commands/avatar.js b/commands/avatar.js index 8f474cc..e920a6e 100644 --- a/commands/avatar.js +++ b/commands/avatar.js @@ -6,6 +6,12 @@ module.exports = { name: "avatar", aliases: ['av', 'a', 'pfp'], 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) { 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; @@ -16,7 +22,7 @@ module.exports = { try { let avem = new Discord.MessageEmbed() .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') .setFooter("Natsuki", client.user.avatarURL()) if (!options.vsmall) {avem.setTimestamp();} diff --git a/commands/bio.js b/commands/bio.js index fc8486d..ea81b0d 100644 --- a/commands/bio.js +++ b/commands/bio.js @@ -7,6 +7,12 @@ module.exports = { .setTitle("Help -> Bio") .setDescription("Set and view user bios, which are fun ways to express yourself!") .addField("Syntax", "`bio `"), + meta: { + category: 'Social', + description: "Set your own user bio, which can be seen by everyone!", + syntax: '`bio `', + extra: null + }, async execute(message, msg, args, cmd, prefix, mention, client) { if (!args.length) {return message.channel.send(`Syntax: \`${prefix}bio \``);} let tu = await UserData.findOne({uid: message.author.id}) ? await UserData.findOne({uid: message.author.id}) : new UserData({uid: message.author.id}); diff --git a/commands/clearstatus.js b/commands/clearstatus.js index 4692d56..dd06cff 100644 --- a/commands/clearstatus.js +++ b/commands/clearstatus.js @@ -7,6 +7,12 @@ module.exports = { name: "clearstatus", aliases: ['statusclear', 'cs'], 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) { let tu = await UserData.findOne({uid: message.author.id}); if (!tu && !tu.statusmsg.length) { diff --git a/commands/clearwarnings.js b/commands/clearwarnings.js index d50dbb0..eea040c 100644 --- a/commands/clearwarnings.js +++ b/commands/clearwarnings.js @@ -6,15 +6,11 @@ module.exports = { name: "clearwarnings", aliases: ['clearwarn', 'cw', 'warnclear', 'wc', 'clearwarning'], meta: { - category: "", - perms: "", - staff: false, - vip: "", - serverPerms: [], - writtenBy: "", - serverOnly: false + category: 'Moderation', + description: "Clear a user's warnings in your server.", + syntax: '`clearwarnings <@user|userID>`', + extra: null }, - tags: [], help: new Discord.MessageEmbed() .setTitle("Help -> Warn Clearing") .setDescription("Clears the warnigns of a user") diff --git a/commands/cry.js b/commands/cry.js index d16a876..1ed3b9d 100644 --- a/commands/cry.js +++ b/commands/cry.js @@ -7,6 +7,12 @@ module.exports = { name: "cry", aliases: ['sob'], 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) { let savess = await Saves.findOne({name: 'cry'}) ? await Saves.findOne({name: 'cry'}) : new Saves({name: 'cry'}); let saves = savess.saves; diff --git a/commands/deathnote.js b/commands/deathnote.js index f2a51e0..80af634 100644 --- a/commands/deathnote.js +++ b/commands/deathnote.js @@ -56,6 +56,12 @@ module.exports = { .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...") .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) { 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]\``);} diff --git a/commands/developer.js b/commands/developer.js index f04a2a2..61d85fb 100644 --- a/commands/developer.js +++ b/commands/developer.js @@ -10,6 +10,12 @@ module.exports = { .setDescription("Add or remove users as Natsuki developers.") .addField("Syntax", "`developer <@user|userID>`") .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 <@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) { if (!message.guild) {return message.reply("This is a guild-only command!");} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}developer <@user|userID>\``);} diff --git a/commands/dnd.js b/commands/dnd.js index b19057f..96633ee 100644 --- a/commands/dnd.js +++ b/commands/dnd.js @@ -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!") .addField("Syntax", "`dnd [clearMode] `") .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] `', + extra: null + }, async execute(message, msg, args, cmd, prefix, mention, client) { if (!args.length) {return message.channel.send(`Syntax: \`${prefix}dnd [clearMode] \``);} let tu = await UserData.findOne({uid: message.author.id}) diff --git a/commands/eval.js b/commands/eval.js index 0e3c8af..03ab1c5 100644 --- a/commands/eval.js +++ b/commands/eval.js @@ -8,6 +8,12 @@ module.exports = { name: 'eval', aliases: ['ev', ':', 'e'], help: "Evaluates raw JavaScript code. *This is a __developer-only__ command.* Usage: `{{p}}eval `", + meta: { + category: 'Developer', + description: "Evaluates raw JavaScript code. Nerd access only.", + syntax: '`eval `', + extra: null + }, execute(message, msg, args, cmd, prefix, mention, client) { 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.");}; diff --git a/commands/help.js b/commands/help.js index 454d7c2..2a7db91 100644 --- a/commands/help.js +++ b/commands/help.js @@ -1,6 +1,7 @@ const Discord = require("discord.js"); const {Pagination} = require('../util/pagination'); +const ask = require('../util/ask'); module.exports = { name: "help", @@ -8,7 +9,52 @@ module.exports = { help: 'you silly! What did you expect me to respond with?', async execute(message, msg, args, cmd, prefix, mention, client) { 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 { let command; if (client.commands.has(args[0])) {command = client.commands.get(args[0]);} diff --git a/commands/hug.js b/commands/hug.js index 41dae4b..340fe5b 100644 --- a/commands/hug.js +++ b/commands/hug.js @@ -6,6 +6,12 @@ const makeId = require('../util/makeid'); module.exports = { name: "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) { let savess = await Saves.findOne({name: 'hug'}) ? await Saves.findOne({name: 'hug'}) : new Saves({name: 'hug'}); let saves = savess.saves; diff --git a/commands/info.js b/commands/info.js index c76710a..56b0935 100644 --- a/commands/info.js +++ b/commands/info.js @@ -5,6 +5,12 @@ module.exports = { name: "info", aliases: ["i", "botinfo", "bot"], 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) { let botData = await require('../models/bot').findOne({finder: 'lel'}); diff --git a/commands/kiss.js b/commands/kiss.js index 97b3339..c8c31bf 100644 --- a/commands/kiss.js +++ b/commands/kiss.js @@ -6,6 +6,12 @@ const makeId = require('../util/makeid'); module.exports = { name: "kiss", 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) { let savess = await Saves.findOne({name: 'kiss'}) ? await Saves.findOne({name: 'kiss'}) : new Saves({name: 'kiss'}); let saves = savess.saves; diff --git a/commands/leave.js b/commands/leave.js index c5a919e..c73aae0 100644 --- a/commands/leave.js +++ b/commands/leave.js @@ -12,6 +12,12 @@ module.exports = { .addField("Syntax", "`leave `") .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."), + meta: { + category: 'Moderation', + description: "Set the channel and message to be sent when a user leaves the server.", + syntax: '`leave `', + 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) { 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}); diff --git a/commands/logs.js b/commands/logs.js index 1d558ca..8cda3bf 100644 --- a/commands/logs.js +++ b/commands/logs.js @@ -38,10 +38,16 @@ module.exports = { name: "logs", aliases: ["log", "l", "modlog", "modlogs"], help: new Discord.MessageEmbed() - .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.") - .addField("Syntax", "`log [logType] [#channel]`") - .addField("Notice", "You must be an admin or have the specified staff role in order to use this command."), + .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.") + .addField("Syntax", "`log [logType] [#channel]`") + .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 [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) { if (!message.guild) {return message.reply("This command is server-only!");} let tg = await GuildData.findOne({gid: message.guild.id}); diff --git a/commands/prefix.js b/commands/prefix.js index e8d115f..78f9bb5 100644 --- a/commands/prefix.js +++ b/commands/prefix.js @@ -10,6 +10,12 @@ module.exports = { .addField("Syntax", "`prefix `") .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."), + meta: { + category: 'Misc', + description: "Change my prefix in your server.", + syntax: '`prefix `', + 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) { if (!message.guild) {return message.reply("This is a guild-only command!");} let tguild = await GuildSettings.findOne({gid: message.guild.id}) diff --git a/commands/pull.js b/commands/pull.js index 7daab80..401b22b 100644 --- a/commands/pull.js +++ b/commands/pull.js @@ -9,8 +9,14 @@ module.exports = { help: new Discord.MessageEmbed() .setTitle("Help -> VCS Pull") .setDescription("Pulls new commits from VCS") - .addField("Syntax", "`refresh`") + .addField("Syntax", "`pull`") .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) { 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!");} diff --git a/commands/randnum.js b/commands/randnum.js index 24197ce..8f17250 100644 --- a/commands/randnum.js +++ b/commands/randnum.js @@ -17,6 +17,12 @@ module.exports = { .setTitle("Help -> Random Numbers") .setDescription("Generates a Random Number in the specified range.") .addField("Syntax", "`randnum [count]`"), + meta: { + category: 'Utility', + description: "Generate a random number... or a lot of them. It's up to you, really.", + syntax: '`randnum [count]`', + extra: null + }, async execute(message, msg, args, cmd, prefix, mention, client) { if (!args.length) {return message.channel.send(`Syntax: \`${prefix}randnum [count]\``);} if (args.length < 2) {return message.channel.send("You have to specify two numbers");} diff --git a/commands/reload.js b/commands/reload.js index a76eb8e..03fa52f 100644 --- a/commands/reload.js +++ b/commands/reload.js @@ -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*") .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."), + 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) { if (!args.length) { const tu = await UserData.findOne({uid: message.author.id}); diff --git a/commands/response.js b/commands/response.js index e285dd9..b1dcd99 100644 --- a/commands/response.js +++ b/commands/response.js @@ -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.") .addField("Syntax", "`response `") .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 `', + extra: "Response editing is currently not available and will be Soon:tm:" + }, 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.");} let tg = await GuildData.findOne({gid: message.guild.id}); diff --git a/commands/secretsanta.js b/commands/secretsanta.js index aeb5147..a97e61e 100644 --- a/commands/secretsanta.js +++ b/commands/secretsanta.js @@ -9,9 +9,15 @@ module.exports = { help: new Discord.MessageEmbed() .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!") - .addField("Syntax", "``"), + .addField("Syntax", "`secretsanta `"), + meta: { + category: 'Fun', + description: "Create and join fully-functioning secret santas. I even randomize the assignments for you, how neat!", + syntax: '`secretsanta `', + 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) { - if (!args.length) {return message.channel.send(`Syntax: \`${prefix}\``);} + if (!args.length) {return message.channel.send(`Syntax: \`${prefix}secretsanta \``);} if (['create', 'new', 'c', 'n', 's'].includes(args[0].toLowerCase())) { 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.");} diff --git a/commands/setstatus.js b/commands/setstatus.js index 6c100f7..d143653 100644 --- a/commands/setstatus.js +++ b/commands/setstatus.js @@ -9,22 +9,19 @@ module.exports = { name: "setstatus", aliases: ['sst'], meta: { - category: "", - perms: "", - staff: false, - vip: "", - serverPerms: [], - writtenBy: "", - serverOnly: false + category: 'Developer', + description: "Set my public status. Don't make me say something weird! (Also only available to devs, of course.)", + syntax: '`setstatus <-s status> <-t type>`', + extra: "You can check if a user is an admin without being a developer." }, tags: [], help: new Discord.MessageEmbed() .setTitle("Help -> Status-Setting") .setDescription("Sets the bot's status") - .addField("Syntax", "`setstatus [type]`") + .addField("Syntax", "`setstatus <-s status> <-t type>`") .addField('Notice', "This command is **developer-only**"), async execute(message, msg, args, cmd, prefix, mention, client) { - if (!args.length) {return message.channel.send(`Syntax: \`${prefix}setstatus [type]\``);} + if (!args.length) {return message.channel.send(`Syntax: \`${prefix}setstatus <-s status> <-t type>\``);} 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!");} diff --git a/commands/sip.js b/commands/sip.js index e5dd740..4ddd0c0 100644 --- a/commands/sip.js +++ b/commands/sip.js @@ -6,6 +6,12 @@ const makeId = require('../util/makeid'); module.exports = { name: "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) { let savess = await Saves.findOne({name: 'sip'}) ? await Saves.findOne({name: 'sip'}) : new Saves({name: 'sip'}); let saves = savess.saves; diff --git a/commands/slap.js b/commands/slap.js index a94a622..6700f24 100644 --- a/commands/slap.js +++ b/commands/slap.js @@ -5,7 +5,14 @@ const makeId = require('../util/makeid'); module.exports = { 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.", + 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: 'slap'}) ? await Saves.findOne({name: 'slap'}) : new Saves({name: 'slap'}); let saves = savess.saves; diff --git a/commands/staff.js b/commands/staff.js index 48b3477..e14c06e 100644 --- a/commands/staff.js +++ b/commands/staff.js @@ -8,6 +8,12 @@ module.exports = { .setDescription("Make a user a Natsuki staff member") .addField("Syntax", "`staff <@user|userID>`") .addField("Notice", "This command is only available to Natsuki developers."), + meta: { + category: 'Developer', + description: "Add or remove users as Natsuki staff", + syntax: '`staff <@user|userID>`', + extra: "You can check if a user is staff without being a developer." + }, async execute(message, msg, args, cmd, prefix, mention, client) { if (!message.guild) {return message.reply("This is a guild-only command.");} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}\``);} diff --git a/commands/staffrole.js b/commands/staffrole.js index 4b2e494..05235d6 100644 --- a/commands/staffrole.js +++ b/commands/staffrole.js @@ -6,6 +6,12 @@ module.exports = { name: "staffrole", 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.", + 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) { 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>\``);} diff --git a/commands/starboard.js b/commands/starboard.js index 217154d..2846603 100644 --- a/commands/starboard.js +++ b/commands/starboard.js @@ -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.") .addField("Syntax", "`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 `', + extra: null + }, 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 (!args.length) {return message.channel.send(`Syntax: \`${prefix}starboard \``);} diff --git a/commands/support.js b/commands/support.js index 490bbc1..16b7863 100644 --- a/commands/support.js +++ b/commands/support.js @@ -8,6 +8,12 @@ module.exports = { .setDescription("Make a user a Natsuki Support Team member") .addField("Syntax", "`support <@user|userID>`") .addField("Notice", "This command is only available to Natsuki admin."), + meta: { + category: 'Developer', + description: "Add or remove users as Natsuki support", + syntax: '`support <@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) { if (!message.guild) {return message.reply("This is a guild-only command.");} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}\``);} diff --git a/commands/testpage.js b/commands/testpage.js deleted file mode 100644 index b2562dd..0000000 --- a/commands/testpage.js +++ /dev/null @@ -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}); - } -}; \ No newline at end of file diff --git a/commands/togglestatuses.js b/commands/togglestatuses.js index f2284be..74fc4e6 100644 --- a/commands/togglestatuses.js +++ b/commands/togglestatuses.js @@ -8,6 +8,12 @@ module.exports = { .setTitle("Help -> Server Status-Toggling") .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.)"), + 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) { 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}); diff --git a/commands/userinfo.js b/commands/userinfo.js index 9ce5d9b..fc8f627 100644 --- a/commands/userinfo.js +++ b/commands/userinfo.js @@ -7,6 +7,12 @@ module.exports = { name: "userinfo", aliases: ['ui', 'memberinfo', 'user'], 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) { 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; diff --git a/commands/vip.js b/commands/vip.js index 55cc1a8..b594d78 100644 --- a/commands/vip.js +++ b/commands/vip.js @@ -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.") .addField("Syntax", "`vip `") .addField("Notice", "This command is **developer-only**."), + meta: { + category: 'Developer', + description: "Set server VIP status", + syntax: '`vip `', + extra: "This command is mostly cosmetic as there are no real perks *yet*" + }, async execute(message, msg, args, cmd, prefix, mention, client) { if (!message.guild) {return message.reply("This command is server-only!");} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}vip \``);} diff --git a/commands/warn.js b/commands/warn.js index 3b76ece..f1b8122 100644 --- a/commands/warn.js +++ b/commands/warn.js @@ -9,9 +9,15 @@ module.exports = { name: "warn", help: new Discord.MessageEmbed() .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> `") .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> `', + extra: null + }, async execute(message, msg, args, cmd, prefix, mention, client) { if (!message.guild) {return message.channel.send("This is a server-only command.");} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}warn <@member> \``);} diff --git a/commands/welcome.js b/commands/welcome.js index 3ddade7..682028d 100644 --- a/commands/welcome.js +++ b/commands/welcome.js @@ -12,6 +12,12 @@ module.exports = { .addField("Syntax", "`welcome `") .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."), + meta: { + category: 'Moderation', + description: "Set the channel and message to be sent when a user joins the server.", + syntax: '`welcome `', + 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) { 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}); diff --git a/events/message.js b/events/message.js index a0220fa..41ed36a 100644 --- a/events/message.js +++ b/events/message.js @@ -14,16 +14,16 @@ module.exports = async (client, message) => { 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(); - var mention = message.mentions.users.first(); - var args = msg.startsWith(prefix) + let msg = message.content.toLowerCase(); + let mention = message.mentions.users.first(); + let args = msg.startsWith(prefix) ? message.content.slice(prefix.length).trim().split(/\s+/g) : msg.startsWith('<@!') ? message.content.slice(4 + 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)) { 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;}} } 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); } }; \ No newline at end of file diff --git a/util/pagination.js b/util/pagination.js index 154cc21..9123e5f 100644 --- a/util/pagination.js +++ b/util/pagination.js @@ -88,7 +88,6 @@ class Pagination { : (r) => { return emoji.includes(r.emoji.name); }; this.controllers.collector = this.message.createReactionCollector(filter, { time: 450000 }); this.controllers.collector.on('collect', async (r) => { - console.log(r); let functions = { '⬅': () => { return this.prevPage(); }, '➡': () => { return this.nextPage(); }, diff --git a/util/ts/pagination.ts b/util/ts/pagination.ts index ae786f6..d27561a 100644 --- a/util/ts/pagination.ts +++ b/util/ts/pagination.ts @@ -31,7 +31,7 @@ export class Pagination { if (!this.message) { 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;} else {this.message = tempm;} } @@ -98,7 +98,6 @@ export class Pagination { this.controllers.collector = this.message.createReactionCollector(filter, {time: 450000}); this.controllers.collector.on('collect', async (r: MessageReaction) => { - console.log(r); let functions = { '⬅': () => {return this.prevPage();}, '➡': () => {return this.nextPage();},