diff --git a/commands/message/core/help.js b/commands/message/core/help.js index fcccb9d..8cb3ede 100644 --- a/commands/message/core/help.js +++ b/commands/message/core/help.js @@ -1,4 +1,4 @@ -const { codeblock, highlight, icon, link, pill } = require('../../../labscore/utils/markdown') +const { codeblock, highlight, icon, link, pill, smallPill } = require('../../../labscore/utils/markdown') const { createEmbed, formatPaginationEmbeds } = require('../../../labscore/utils/embed') const { DISCORD_INVITES } = require('../../../labscore/constants') @@ -45,8 +45,24 @@ function createCommandPage(context, prefix, command){ alias += "\n" } + let explicit = ''; + if(command.metadata.explicit) explicit = `\n${icon('nsfw')} This command contains explicit content and can only be used in Age-Restricted channels. ${link("https://support.discord.com/hc/en-us/articles/115000084051-Age-Restricted-Channels-and-Content", "Learn More")}\n` + + // Render argument pills if present + let args = []; + if(command.argParser.args){ + for(const a of command.argParser.args){ + let argument = `-${a._name} <${a._type.replace('bool','true/false')}>` + argument = pill(argument) + if(a.help) argument += ` ${a.help}` + argument += `\n ​ ​ ​ ​ ${smallPill(`default: ${a.default}`)} ​ ​ ` + if(!a.required) argument += smallPill('optional') + args.push(argument) + } + } + let page = createEmbed("default", context, { - description: `${icon("command")} ${pill(command.name)}\n${alias}\n${command.metadata.description}`, + description: `${icon("command")} ${pill(command.name)}\n${alias}${explicit}\n${command.metadata.description}\n\n${args.join('\n\n')}`, fields: [] }) @@ -86,6 +102,7 @@ module.exports = { label: 'command', metadata: { description: 'List all commands, get more information about individual commands.', + description_short: 'Display dommand list', examples: ['help ping'], category: 'core', usage: 'help []' @@ -96,7 +113,10 @@ module.exports = { let results = [] for(const c of context.commandClient.commands){ - if(c.name.includes(args.command) || c.aliases.filter((f)=>{return f.includes(args.command)}).length >= 1) results.push(c) + if(c.name.includes(args.command) || c.aliases.filter((f)=>{return f.includes(args.command)}).length >= 1){ + if(c.metadata.explicit && !context.channel.nsfw) continue; + results.push(c) + } } let pages = [] @@ -109,7 +129,7 @@ module.exports = { // Command overview let cmds = results.map((m)=>{return m.name}) - let dscs = results.map((m)=>{return m.metadata.description}) + let dscs = results.map((m)=>{return m.metadata.description_short}) pages.push({embeds:[ createEmbed("default", context, { description: `Check pages for detailed command descriptions.\n\n` + renderCommandList(cmds, dscs, 15) + `\n\n${icon("question")} Need help with something else? Contact us via our ${link(DISCORD_INVITES.support, "Support Server")}.` @@ -141,10 +161,11 @@ module.exports = { let prefix = context.commandClient.prefixes.custom.first() for(const c of context.commandClient.commands){ if(!categories[c.metadata.category]) continue; + if(c.metadata.explicit && !context.channel.nsfw) continue; if(!commands[c.metadata.category]) commands[c.metadata.category] = [] if(!descriptions[c.metadata.category]) descriptions[c.metadata.category] = [] commands[c.metadata.category].push(`${c.name}`); - descriptions[c.metadata.category].push(`${c.metadata.description}`); + descriptions[c.metadata.category].push(`${c.metadata.description_short}`); } let pages = [] diff --git a/commands/message/core/ping.js b/commands/message/core/ping.js index 07dbc5b..6f2bdb5 100644 --- a/commands/message/core/ping.js +++ b/commands/message/core/ping.js @@ -7,7 +7,8 @@ module.exports = { description: 'ping!', name: 'ping', metadata: { - description: 'Displays information about the bots connection to discord..', + description: 'Displays information about the bots connection to discord.', + description_short: 'Bot connection details', examples: ['ping'], category: 'core', usage: 'ping' diff --git a/commands/message/core/privacy.js b/commands/message/core/privacy.js index 8098659..f0745a8 100644 --- a/commands/message/core/privacy.js +++ b/commands/message/core/privacy.js @@ -7,6 +7,7 @@ module.exports = { name: 'privacy', metadata: { description: 'Shows the bots privacy policy.', + description_short: 'Privacy policy', examples: ['privacy'], category: 'core', usage: 'privacy' diff --git a/commands/message/core/shard.js b/commands/message/core/shard.js index c9a40db..e262cd2 100644 --- a/commands/message/core/shard.js +++ b/commands/message/core/shard.js @@ -7,6 +7,7 @@ module.exports = { name: 'shard', metadata: { description: 'Details about the bots connection to this server.', + description_short: 'Shard information', examples: ['shard'], category: 'core', usage: 'shard' diff --git a/commands/message/core/undo.js b/commands/message/core/undo.js index 668ce67..ab4486a 100644 --- a/commands/message/core/undo.js +++ b/commands/message/core/undo.js @@ -7,6 +7,7 @@ module.exports = { label: 'amount', metadata: { description: 'Remove recent command responses from chat.', + description_short: 'Undo last command', examples: ['undo 5'], category: 'core', usage: 'undo []' diff --git a/commands/message/dev/debug/test.js b/commands/message/dev/debug/test.js index 0f493bd..ae58c2a 100644 --- a/commands/message/dev/debug/test.js +++ b/commands/message/dev/debug/test.js @@ -8,10 +8,16 @@ module.exports = { label: 'text', metadata: { description: 'test', + description_short: 'Bot test', examples: ['test'], category: 'dev', usage: 'test' }, + args: [ + { default: false, name: "noreply", type: "bool", help: "Should this command return the output?" }, + { default: 2, name: "jsonspacing", type: "number", help: "JSON spacing sizes" }, + { default: true, name: "async", type: "bool", help: "Compute async?" } + ], run: async (context, args) => { if(context.user.id !== "223518178100248576") return; let image = await getRecentImage(context, 50) diff --git a/commands/message/dev/eval.js b/commands/message/dev/eval.js index 0190828..0e97f64 100644 --- a/commands/message/dev/eval.js +++ b/commands/message/dev/eval.js @@ -9,14 +9,15 @@ module.exports = { name: "dev", metadata: { description: 'Evaluate code.', + description_short: 'Bot eval', examples: ['dev console.log(\'ping\'); -async false'], category: 'dev', usage: 'eval [-async ] [-noreply ] [-jsonspacing ]' }, args: [ - { default: false, name: "noreply", type: "bool" }, - { default: 2, name: "jsonspacing", type: "number" }, - { default: true, name: "async", type: "bool" } + { default: false, name: "noreply", type: "bool", help: "Reply with evaluated output" }, + { default: 2, name: "jsonspacing", type: "number", help: "Spacing for formatted json" }, + { default: true, name: "async", type: "bool", help: "Async evaluation" } ], onBefore: context => context.user.isClientOwner, onCancel: context => diff --git a/commands/message/dev/reload.js b/commands/message/dev/reload.js index 8e84544..fb70063 100644 --- a/commands/message/dev/reload.js +++ b/commands/message/dev/reload.js @@ -5,6 +5,7 @@ module.exports = { aliases: ["rl"], metadata: { description: 'Reloads commands on all shards.', + description_short: 'Bot reload', examples: ['reload'], category: 'dev', usage: 'reload' diff --git a/commands/message/dev/update.js b/commands/message/dev/update.js index 6e02c80..44836e0 100644 --- a/commands/message/dev/update.js +++ b/commands/message/dev/update.js @@ -8,12 +8,13 @@ module.exports = { name: "update", metadata: { description: 'Fetches latest bot version.', + description_short: 'Bot update', examples: ['update'], category: 'dev', usage: 'update [-force true]' }, args: [ - { default: false, name: "force", type: "bool" } + { default: false, name: "force", type: "bool", help: "Force update" } ], onBefore: context => context.user.isClientOwner, onCancel: context => diff --git a/commands/message/dev/uptime.js b/commands/message/dev/uptime.js index c5dbe2d..6314bec 100644 --- a/commands/message/dev/uptime.js +++ b/commands/message/dev/uptime.js @@ -16,6 +16,7 @@ module.exports = { name: "uptime", metadata: { description: 'Displays the bots uptime.', + description_short: 'Bot uptime', examples: ['uptime'], category: 'dev', usage: 'uptime' diff --git a/commands/message/fun/art.js b/commands/message/fun/art.js index 88b574b..fc18926 100644 --- a/commands/message/fun/art.js +++ b/commands/message/fun/art.js @@ -20,16 +20,17 @@ module.exports = { name: 'art', aliases: ['wallpaper'], metadata: { - description: 'Creates colorful generative art created by JetBrains LIMB.', + description: 'Creates colorful generative art using JetBrains LIMB.', + description_short: 'AI wallpaper generation', examples: ['art -type wallpaper -seed 839648 -variance 8866 -rotate 1', 'wallpaper -type phone'], category: 'fun', usage: `art [-type <${Object.keys(SIZES).join('|')}>] [-seed <10000-999999>] [-variance <1000-9999>] [-rotate <0-360>]` }, args: [ - { name: 'type', default: 'wallpaper', required: false }, - { name: 'seed', default: 'rand', required: false }, - { name: 'variance', default: 'rand', required: false }, - { name: 'rotate', default: 'rand', required: false } + { name: 'type', default: 'wallpaper', required: false, help: `Image Type \` ${Object.keys(SIZES).join(', ')} \`` }, + { name: 'seed', default: 'rand', required: false, help: "Image Seed (10000-999999)" }, + { name: 'variance', default: 'rand', required: false, help: "Variance (1000-9999)" }, + { name: 'rotate', default: 'rand', required: false, help: "Rotation amount (0-360)" } ], run: async (context, args) => { let response = await editOrReply(context, createEmbed("loading", context, `Generating image...`)) diff --git a/commands/message/fun/inferkit.js b/commands/message/fun/inferkit.js index 95262e4..48f1462 100644 --- a/commands/message/fun/inferkit.js +++ b/commands/message/fun/inferkit.js @@ -12,6 +12,7 @@ module.exports = { label: 'text', metadata: { description: 'Uses InferKit to generate text from a small input snippet.', + description_short: 'AI text generation', examples: ['complete The Fitness Gram Pacer'], category: 'fun', usage: 'inferkit ' diff --git a/commands/message/fun/otter.js b/commands/message/fun/otter.js index c8a7526..581dc78 100644 --- a/commands/message/fun/otter.js +++ b/commands/message/fun/otter.js @@ -7,6 +7,7 @@ module.exports = { name: 'otter', metadata: { description: 'Displays a random image containing otters.', + description_short: 'Otter images', examples: ['otter'], category: 'fun', usage: `otter` diff --git a/commands/message/google/labels.js b/commands/message/google/labels.js index ed43ab2..54e7e24 100644 --- a/commands/message/google/labels.js +++ b/commands/message/google/labels.js @@ -8,6 +8,7 @@ module.exports = { name: 'labels', metadata: { description: 'Applies labels to an image based on its visual contents.', + description_short: 'Image content label detection', examples: ['labels'], category: 'utils', usage: 'labels ' diff --git a/commands/message/google/safetylabels.js b/commands/message/google/safetylabels.js index e556b07..75d8acd 100644 --- a/commands/message/google/safetylabels.js +++ b/commands/message/google/safetylabels.js @@ -8,6 +8,7 @@ module.exports = { name: 'safetylabels', metadata: { description: 'Applies detection labels for potentially sensitive content of an image.', + description_short: 'Sentivite content detection labels', examples: ['safetylabels'], category: 'utils', usage: 'safetylabels ' diff --git a/commands/message/image/dalle.js b/commands/message/image/dalle.js index d553eef..c7dd053 100644 --- a/commands/message/image/dalle.js +++ b/commands/message/image/dalle.js @@ -9,6 +9,7 @@ module.exports = { aliases: ['craiyon'], metadata: { description: 'Uses Craiyon to generate four images from a text prompt.', + description_short: 'Craiyon AI image generation', examples: ['dalle'], category: 'image', usage: 'dalle ' diff --git a/commands/message/image/deepai/deepdream.js b/commands/message/image/deepai/deepdream.js index 3dd2844..0153eb2 100644 --- a/commands/message/image/deepai/deepdream.js +++ b/commands/message/image/deepai/deepdream.js @@ -9,6 +9,7 @@ module.exports = { aliases: ['dd'], metadata: { description: 'Processes an image with DeepAI DeepDream.', + description_short: 'DeepDream image processing', examples: ['deepdream'], category: 'image', usage: 'deepdream ' diff --git a/commands/message/image/deepai/superresolution.js b/commands/message/image/deepai/superresolution.js index 9f63467..d7eb36d 100644 --- a/commands/message/image/deepai/superresolution.js +++ b/commands/message/image/deepai/superresolution.js @@ -9,6 +9,7 @@ module.exports = { aliases: ['sr'], metadata: { description: 'Upscales an image with SuperResolution.', + description_short: 'SuperResolution upscaling', examples: ['superresolution'], category: 'image', usage: 'superresolution ' diff --git a/commands/message/image/deepai/text2image.js b/commands/message/image/deepai/text2image.js index db691a8..dde69cb 100644 --- a/commands/message/image/deepai/text2image.js +++ b/commands/message/image/deepai/text2image.js @@ -10,6 +10,7 @@ module.exports = { aliases: ['t2i'], metadata: { description: 'Generates an image with DeepAI Text2Image using a text prompt.', + description_short: 'Image from text prompt', examples: ['text2image Mushroom'], category: 'image', usage: 'text2image ' diff --git a/commands/message/image/deepai/waifu2x.js b/commands/message/image/deepai/waifu2x.js index eb2fc01..907c78c 100644 --- a/commands/message/image/deepai/waifu2x.js +++ b/commands/message/image/deepai/waifu2x.js @@ -9,6 +9,7 @@ module.exports = { aliases: ['w2x'], metadata: { description: 'Processes an image with Waifu2x.', + description_short: 'Waifu2x upscaling', examples: ['waifu2x'], category: 'image', usage: 'waifu2x ' diff --git a/commands/message/image/makesweet/billboard.js b/commands/message/image/makesweet/billboard.js index c086647..e67192a 100644 --- a/commands/message/image/makesweet/billboard.js +++ b/commands/message/image/makesweet/billboard.js @@ -11,6 +11,7 @@ module.exports = { label: 'text', metadata: { description: 'Generates an animated gif with the MakeSweet billboard template.', + description_short: 'Animated billboard generation', examples: ['billboard'], category: 'image', usage: 'billboard' diff --git a/commands/message/image/makesweet/circuitboard.js b/commands/message/image/makesweet/circuitboard.js index 2428c86..626ccd4 100644 --- a/commands/message/image/makesweet/circuitboard.js +++ b/commands/message/image/makesweet/circuitboard.js @@ -11,6 +11,7 @@ module.exports = { label: 'text', metadata: { description: 'Generates an animated gif with the MakeSweet circuit board template.', + description_short: 'Animated circuit board generation', examples: ['circuitboard'], category: 'image', usage: 'circuitboard' diff --git a/commands/message/image/makesweet/flag.js b/commands/message/image/makesweet/flag.js index 8554168..3ccc722 100644 --- a/commands/message/image/makesweet/flag.js +++ b/commands/message/image/makesweet/flag.js @@ -11,6 +11,7 @@ module.exports = { label: 'text', metadata: { description: 'Generates an animated gif with the MakeSweet flag template.', + description_short: 'Animated flag generation', examples: ['flag'], category: 'image', usage: 'flag' diff --git a/commands/message/image/makesweet/heartlocket.js b/commands/message/image/makesweet/heartlocket.js index 19d5c46..7574511 100644 --- a/commands/message/image/makesweet/heartlocket.js +++ b/commands/message/image/makesweet/heartlocket.js @@ -11,6 +11,7 @@ module.exports = { label: 'text', metadata: { description: 'Generates an animated gif with the MakeSweet heart locket template. Accepts text as an optional input.', + description_short: 'Animated heart locket generation', examples: ['heartlocket Big Nutty'], category: 'image', usage: 'heartlocket []' diff --git a/commands/message/image/photofunia/retro-wave.js b/commands/message/image/photofunia/retro-wave.js index a52d6ae..4904b1d 100644 --- a/commands/message/image/photofunia/retro-wave.js +++ b/commands/message/image/photofunia/retro-wave.js @@ -9,13 +9,14 @@ module.exports = { label: 'text', metadata: { description: 'Generates an image with a retro style.', + description_short: 'Retro-styled text', examples: ['retro cyberspace|chaos|crazy'], category: 'image', usage: 'retro [-background <1-5>] [-style <1-4>]' }, args: [ - {default: 5, name: 'background', type: 'integer'}, - {default: 4, name: 'style', type: 'integer'}, + {default: 5, name: 'background', type: 'integer', help: "Background Style ` 1, 2, 3, 4, 5 `"}, + {default: 4, name: 'style', type: 'integer', help: "Text Style ` 1, 2, 3, 4 `"}, ], run: async (context, args) => { context.triggerTyping(); diff --git a/commands/message/image/photofunia/yacht.js b/commands/message/image/photofunia/yacht.js index 39a3b61..2012ac3 100644 --- a/commands/message/image/photofunia/yacht.js +++ b/commands/message/image/photofunia/yacht.js @@ -9,6 +9,7 @@ module.exports = { label: 'text', metadata: { description: 'Generates an image with custom text on a yacht.', + description_short: 'Custom text on a yacht', examples: ['yacht Im on a boat.'], category: 'image', usage: 'yacht ' diff --git a/commands/message/info/appinfo.js b/commands/message/info/appinfo.js index 380ee6e..a951963 100644 --- a/commands/message/info/appinfo.js +++ b/commands/message/info/appinfo.js @@ -37,6 +37,7 @@ module.exports = { aliases: ['ai'], metadata: { description: 'Displays information about a discord application.', + description_short: 'Discord application information', examples: ['ai 682654466453012553'], category: 'info', usage: 'appinfo ' diff --git a/commands/message/info/avatar.js b/commands/message/info/avatar.js index 26eea1e..cc9eed3 100644 --- a/commands/message/info/avatar.js +++ b/commands/message/info/avatar.js @@ -8,9 +8,10 @@ module.exports = { aliases: ['a'], metadata: { description: 'Displays someones discord avatar. Accepts IDs, Mentions, or Usernames.', + description_short: 'User avatar', examples: ['avatar labsCore'], category: 'info', - usage: 'avatar []' + usage: 'avatar []' }, run: async (context, args) => { context.triggerTyping(); diff --git a/commands/message/info/guild.js b/commands/message/info/guild.js index b98d03f..64b7404 100644 --- a/commands/message/info/guild.js +++ b/commands/message/info/guild.js @@ -9,6 +9,7 @@ module.exports = { aliases: ['guild', 'guildinfo'], metadata: { description: 'Displays information about the server.', + description_short: 'Server information', examples: ['guild'], category: 'info', usage: 'server' diff --git a/commands/message/info/guildicon.js b/commands/message/info/guildicon.js index 31d0935..437aedc 100644 --- a/commands/message/info/guildicon.js +++ b/commands/message/info/guildicon.js @@ -6,6 +6,7 @@ module.exports = { aliases: ["guildicon","gi","si","groupicon"], metadata: { description: 'Displays the server icon.', + description_short: 'Server Icon', examples: ['gi'], category: 'info', usage: 'guildicon' diff --git a/commands/message/info/invite.js b/commands/message/info/invite.js index 2742977..22f3ebc 100644 --- a/commands/message/info/invite.js +++ b/commands/message/info/invite.js @@ -9,6 +9,7 @@ module.exports = { aliases: ['inviteinfo'], metadata: { description: 'Displays information about a discord invite code.', + description_short: 'Invite link information', examples: ['invite discord-townhall'], category: 'info', usage: 'invite ' diff --git a/commands/message/info/user.js b/commands/message/info/user.js index f99cd33..aa20107 100644 --- a/commands/message/info/user.js +++ b/commands/message/info/user.js @@ -12,9 +12,10 @@ module.exports = { aliases: ['u', 'profile'], metadata: { description: 'Displays information about a discord user. Accepts IDs, Mentions and Usernames.', + description_short: 'User information', examples: ['user labsCore'], category: 'info', - usage: 'user []' + usage: 'user []' }, run: async (context, args) => { context.triggerTyping(); diff --git a/commands/message/mod/purge.js b/commands/message/mod/purge.js index e5445da..7f2bfdb 100644 --- a/commands/message/mod/purge.js +++ b/commands/message/mod/purge.js @@ -1,7 +1,7 @@ const { Constants } = require("detritus-client"); const Permissions = Constants.Permissions; -const { icon } = require("../../../labscore/utils/markdown"); +const { icon, pill } = require("../../../labscore/utils/markdown"); // TODO: copy pasted from v1, rework this eventually @@ -9,14 +9,15 @@ module.exports = { label: "filter", name: "purge", metadata: { - description: 'Removes recent messages in chat. Allows you to optionally filter by message content to remove spam.\n\n`-amount` allows you to specify how many messages should be searched (default: 20)\n`-case` specifies if the provided query should be case sensitive or not (default: true)', + description: `Removes recent messages in chat. Allows you to optionally filter by message content to remove spam.`, + description_short: 'Mass-delete recent messages', examples: ['purge Spam -amount 25'], category: 'mod', usage: 'purge [] [-amount <1-50>] [-case ]' }, args: [ - {default: 20, name: 'amount', type: 'integer'}, - {default: true, name: 'case', type: 'bool'}, + {default: 20, name: 'amount', type: 'integer', help: "Amount of messages to be checked (1-20)"}, + {default: true, name: 'case', type: 'bool', help: "If provided, should the search query be case sensitive"}, ], permissionsClient: [Permissions.MANAGE_MESSAGES], permissions: [Permissions.MANAGE_MESSAGES], diff --git a/commands/message/search/audio.js b/commands/message/search/audio.js index 6c098db..4497139 100644 --- a/commands/message/search/audio.js +++ b/commands/message/search/audio.js @@ -14,6 +14,7 @@ module.exports = { aliases: ['aud'], metadata: { description: '**Audio Detection**\nUsing the audio command without replying to a message will try to identify the song in the most recent video in chat.\n\n**Music Platform Links**\n__Replying__ to a message while using this command will return a list of music platforms the provided music (link) is available on.', + description_short: 'Audio detection', examples: ['aud'], category: 'search', usage: 'audio' diff --git a/commands/message/search/bing-images.js b/commands/message/search/bing-images.js index ba6e784..bf28389 100644 --- a/commands/message/search/bing-images.js +++ b/commands/message/search/bing-images.js @@ -31,6 +31,7 @@ module.exports = { aliases: ['bi', 'img2'], metadata: { description: 'Returns image search results from Microsoft Bing.', + description_short: 'Bing Image Search', examples: ['bing Large Magenta Sphere'], category: 'search', usage: 'bing ' diff --git a/commands/message/search/bing.js b/commands/message/search/bing.js index 2940eb1..85b56b4 100644 --- a/commands/message/search/bing.js +++ b/commands/message/search/bing.js @@ -27,6 +27,7 @@ module.exports = { aliases: ['b', 'search2'], metadata: { description: 'Returns search results from Microsoft Bing.', + description_short: 'Bing Search', examples: ['bing Flask'], category: 'search', usage: 'bing ' diff --git a/commands/message/search/google-images.js b/commands/message/search/google-images.js index 8bc7ec3..ace394c 100644 --- a/commands/message/search/google-images.js +++ b/commands/message/search/google-images.js @@ -31,6 +31,7 @@ module.exports = { aliases: ['i', 'img'], metadata: { description: 'Returns image search results from Google.', + description_short: 'Google Image Search', examples: ['image Large Magenta Sphere'], category: 'search', usage: 'image ' diff --git a/commands/message/search/google.js b/commands/message/search/google.js index 8e1bf7a..ca13633 100644 --- a/commands/message/search/google.js +++ b/commands/message/search/google.js @@ -28,6 +28,7 @@ module.exports = { aliases: ['g', 'search'], metadata: { description: 'Returns search results from Google.', + description_short: 'Google Search', examples: ['google Flask'], category: 'search', usage: 'google ' diff --git a/commands/message/search/lyrics.js b/commands/message/search/lyrics.js index 6ba605c..c3616fe 100644 --- a/commands/message/search/lyrics.js +++ b/commands/message/search/lyrics.js @@ -23,6 +23,7 @@ module.exports = { label: 'query', metadata: { description: 'Searches for song lyrics on Genius.', + description_short: 'Lyric/Song Search', examples: ['lyrics desert bloom man'], category: 'search', usage: 'lyrics ' diff --git a/commands/message/search/reddit.js b/commands/message/search/reddit.js index b4331ae..4ca26ef 100644 --- a/commands/message/search/reddit.js +++ b/commands/message/search/reddit.js @@ -48,12 +48,13 @@ module.exports = { aliases: ['r'], metadata: { description: 'Returns search results from reddit. Allows global and subreddit-specific search.', + description_short: 'Reddit Search', examples: ['reddit r/otters'], category: 'search', usage: 'reddit [r/] [-type image]' }, args: [ - { default: "all", name: "type", type: "image" } + { default: "all", name: "type", type: "image", help: "Types of post the search query should return" } ], run: async (context, args) => { context.triggerTyping(); diff --git a/commands/message/search/reverse-image.js b/commands/message/search/reverse-image.js index fa82d7e..497ab90 100644 --- a/commands/message/search/reverse-image.js +++ b/commands/message/search/reverse-image.js @@ -34,6 +34,7 @@ module.exports = { aliases: ['reverse', 'tineye','reverseimage'], metadata: { description: 'Performs a reverse-image-search.', + description_short: 'Reverse Image Search', examples: ['reverseimage'], category: 'search', usage: 'reverse ' diff --git a/commands/message/search/rule34.js b/commands/message/search/rule34.js index 9b758a1..5b189dd 100644 --- a/commands/message/search/rule34.js +++ b/commands/message/search/rule34.js @@ -46,13 +46,15 @@ module.exports = { label: 'query', aliases: ['r34'], metadata: { - description: 'Returns image search results from various rule34-focused sites.\n\nSupported Sites: `' + Object.keys(SITES).join(', ') + '`', + description: 'Returns image search results from various rule34-focused sites.', + description_short: 'Rule34 Search', + explicit: true, examples: ['r34 sex -site rule34'], category: 'search', usage: 'rule34 [-site ]' }, args: [ - {name: 'site', default: 'rule34'} + {name: 'site', default: 'rule34', type: 'string', help: `Site to search on \` ${Object.keys(SITES).join(', ')} \``} ], run: async (context, args) => { context.triggerTyping(); diff --git a/commands/message/search/urbandictionary.js b/commands/message/search/urbandictionary.js index dbc5688..3d9e023 100644 --- a/commands/message/search/urbandictionary.js +++ b/commands/message/search/urbandictionary.js @@ -40,6 +40,7 @@ module.exports = { aliases: ['urban', 'ud'], metadata: { description: 'Returns search results from UrbanDictionary. Might include profanity.\nProviding no search query will return random results.', + description_short: 'UrbanDictionary Search', examples: ['ud Flask'], category: 'search', usage: 'urbandictionary ' diff --git a/commands/message/search/weather.js b/commands/message/search/weather.js index 066774d..dc1c8ba 100644 --- a/commands/message/search/weather.js +++ b/commands/message/search/weather.js @@ -10,6 +10,7 @@ module.exports = { label: 'query', metadata: { description: 'Displays information about the weather.', + description_short: 'Weather information', examples: ['weather Berlin'], category: 'search', usage: 'weather ' diff --git a/commands/message/search/wikihow.js b/commands/message/search/wikihow.js index 5ce957b..c3c4dd0 100644 --- a/commands/message/search/wikihow.js +++ b/commands/message/search/wikihow.js @@ -27,6 +27,7 @@ module.exports = { aliases: ['wh', 'how'], metadata: { description: 'Returns search results from WikiHow.', + description_short: 'WikiHow Search', examples: ['wh download'], category: 'search', usage: 'wikihow ' diff --git a/commands/message/search/wolfram-alpha.js b/commands/message/search/wolfram-alpha.js index 11956af..d6dbbbe 100644 --- a/commands/message/search/wolfram-alpha.js +++ b/commands/message/search/wolfram-alpha.js @@ -28,6 +28,7 @@ module.exports = { aliases: ['wa', 'wolfram-alpha'], metadata: { description: 'Computes a query using Wolfram|Alpha.', + description_short: 'Compute Wolfram|Alpha queries', examples: ['wa 1+1'], category: 'search', usage: 'wolframalpha ' diff --git a/commands/message/search/youtube.js b/commands/message/search/youtube.js index 020beca..018fff1 100644 --- a/commands/message/search/youtube.js +++ b/commands/message/search/youtube.js @@ -30,6 +30,7 @@ module.exports = { aliases: ['yt'], metadata: { description: 'Returns search results from YouTube.', + description_short: 'YouTube Search', examples: ['youtube Google'], category: 'search', usage: 'youtube ' diff --git a/commands/message/utils/define.js b/commands/message/utils/define.js index 772fb7c..f658cf1 100644 --- a/commands/message/utils/define.js +++ b/commands/message/utils/define.js @@ -38,6 +38,7 @@ module.exports = { aliases: ['dictionary', 'dict'], metadata: { description: 'Returns dictionary definitions for words.', + description_short: 'Dictionary definitions.', examples: ['dictionary Flask'], category: 'search', usage: 'define ' diff --git a/commands/message/utils/emoji.js b/commands/message/utils/emoji.js index de03a96..cc72b5f 100644 --- a/commands/message/utils/emoji.js +++ b/commands/message/utils/emoji.js @@ -14,12 +14,13 @@ module.exports = { aliases: ['e', 'emote', 'enlarge', 'em', 'emojimix'], metadata: { description: 'Displays information about emoji. Supports regular emoji and discord emoji.\n\nUsing two emoji will mix the two emoji together.', + description_short: 'Emoji Information, Emoji Mixing', examples: ['enlarge 😀', 'emojimix 🐱 🍞'], category: 'utils', usage: 'emoji []' }, args: [ - {name: 'type', default: 'twitter'} + {name: 'type', default: 'twitter', type: 'string', help: `Emoji platform type`} ], run: async (context, args) => { await context.triggerTyping() diff --git a/commands/message/utils/ocr.js b/commands/message/utils/ocr.js index 6053a19..7c1b3cd 100644 --- a/commands/message/utils/ocr.js +++ b/commands/message/utils/ocr.js @@ -9,6 +9,7 @@ module.exports = { name: 'ocr', metadata: { description: 'Uses Optical Character Recognition to detect text in images.', + description_short: 'Image Text Recognition', examples: ['ocr'], category: 'utils', usage: 'ocr ' diff --git a/commands/message/utils/ocrtr.js b/commands/message/utils/ocrtr.js index 44d377b..36f78fd 100644 --- a/commands/message/utils/ocrtr.js +++ b/commands/message/utils/ocrtr.js @@ -11,12 +11,13 @@ module.exports = { label: 'to', metadata: { description: 'Uses Optical Character Recognition to translate text in an image.', + description_short: 'Image Text Translation', examples: ['ocrtr en'], category: 'utils', usage: 'ocrtr [-from ]' }, args: [ - {name: 'from', default: 'auto'} + {name: 'from', default: 'auto', type: 'string', help: "Language to translate from"} ], run: async (context, args) => { context.triggerTyping(); diff --git a/commands/message/utils/qr.js b/commands/message/utils/qr.js index bcc3df3..601dd1c 100644 --- a/commands/message/utils/qr.js +++ b/commands/message/utils/qr.js @@ -12,6 +12,7 @@ module.exports = { aliases: ['scan'], metadata: { description: 'Generates a QR code. If no input is provided acts as a QR code scanner.', + description_short: 'QR Code Scanner/Creator', examples: ['qr big nutty'], category: 'utils', usage: `qr ` diff --git a/commands/message/utils/screenshot.js b/commands/message/utils/screenshot.js index 9793be0..bcdf349 100644 --- a/commands/message/utils/screenshot.js +++ b/commands/message/utils/screenshot.js @@ -17,6 +17,7 @@ module.exports = { aliases: ['ss'], metadata: { description: 'Takes screenshots of a website.', + description_short: 'Screenshot websites.', examples: ['ss google.com'], category: 'utils', usage: 'screenshot ' diff --git a/commands/message/utils/translate.js b/commands/message/utils/translate.js index 8b83667..76abe52 100644 --- a/commands/message/utils/translate.js +++ b/commands/message/utils/translate.js @@ -13,13 +13,14 @@ module.exports = { aliases: ['tr'], metadata: { description: 'Translates text. Supports automatic source language detection.', + description_short: 'Translates text', examples: ['tr groß nussig -from de -to en'], category: 'utils', usage: `tr [-to ] [-from ]` }, args: [ - {name: 'to', default: 'en'}, - {name: 'from', default: 'auto'} + {name: 'to', default: 'en', type: 'language', help: "Target Language"}, + {name: 'from', default: 'auto', type: 'language', help: "Source Language"} ], run: async (context, args) => { await context.triggerTyping(); diff --git a/labscore/utils/markdown.js b/labscore/utils/markdown.js index c2ee3a4..20c19d9 100644 --- a/labscore/utils/markdown.js +++ b/labscore/utils/markdown.js @@ -27,6 +27,10 @@ module.exports.pill = function(content){ return " **` " + content + " `**" } +module.exports.smallPill = function(content){ + return " ` " + content + " `" +} + module.exports.iconPill = function(icon, content){ if(!ICONS[icon]) icon = "question" return ICONS[icon] + " **` " + content + " `**"