diff --git a/commands/message/core/help.js b/commands/message/core/help.js index 11d4d64..9dc0661 100644 --- a/commands/message/core/help.js +++ b/commands/message/core/help.js @@ -1,4 +1,4 @@ -const { codeblock, highlight, icon, link, pill, smallPill } = require('../../../labscore/utils/markdown') +const { codeblock, highlight, icon, link, pill, smallPill, iconPill } = require('../../../labscore/utils/markdown') const { createEmbed, formatPaginationEmbeds } = require('../../../labscore/utils/embed') const { DISCORD_INVITES, DEFAULT_BOT_PREFIX } = require('../../../labscore/constants') @@ -7,7 +7,7 @@ const { paginator } = require('../../../labscore/client'); const { editOrReply } = require('../../../labscore/utils/message'); const { Permissions } = require("detritus-client/lib/constants"); -const { canUseLimitedTestCommands } = require('../utils/testing'); +const { canUseLimitedTestCommands } = require('../../../labscore/utils/testing'); function createHelpPage(context, title, contents, descriptions){ return { @@ -15,7 +15,7 @@ function createHelpPage(context, title, contents, descriptions){ createEmbed("default", context, { description: `${title}\n\n` + renderCommandList(contents, descriptions) + - `\n\n${icon("question")} Use ${pill(`${DEFAULT_BOT_PREFIX}help `)} to view more information about a command.` + `\n\n${icon("question")} Use ${smallPill(`${DEFAULT_BOT_PREFIX}help `)} to view more information about a command.` }) ] } @@ -32,7 +32,7 @@ function renderCommandList(commands, descriptions, limit){ if(desc.includes('\n')) desc = desc.split('\n')[0] if(desc.length >= 41) desc = desc.substr(0, 40) + '...' - render.push(` ​ ​ **​\` ${c}${' '.repeat(pad)}\`** ​ ​ ​ ​ ​${desc}`) + render.push(` ​ ​ \` ${c}${' '.repeat(pad)}\` ​ ​ ​ ​ ​${desc}`) i++ } @@ -49,7 +49,7 @@ function createCommandPage(context, prefix, command){ } 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` + if(command.metadata.explicit) explicit = `\n${icon('channel_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 = []; @@ -66,13 +66,13 @@ function createCommandPage(context, prefix, command){ } let page = createEmbed("default", context, { - description: `${icon("command")} ${pill(command.name)}\n${alias}${explicit}\n${command.metadata.description}\n\n${args.join('\n\n')}`, + description: `${icon("slash")} ${smallPill(command.name)}\n${alias}${explicit}\n${command.metadata.description}\n\n${args.join('\n\n')}`, fields: [] }) // TODO: maybe try building a little parser that highlights things via ansi if(command.metadata.usage) page.fields.push({ - name: `${icon("util")} Usage`, + name: `${icon("settings")} Usage`, value: codeblock("py", [prefix + command.metadata.usage]), inline: true }) @@ -81,7 +81,7 @@ function createCommandPage(context, prefix, command){ let ex = [] for(const e of command.metadata.examples) ex.push(prefix + e) page.fields.push({ - name: `${icon("info")} Examples`, + name: `${icon("example")} Examples`, value: '```' + ex.join('``````') + '```', inline: false }) @@ -93,13 +93,13 @@ function createCommandPage(context, prefix, command){ // These categories will be displayed to users, add them in the correct order const categories = { - "core": `${icon("house")} Core Commands`, - "info": `${icon("info")} Information Commands`, - "search": `${icon("search")} Search Commands`, - "utils": `${icon("utils")} Utility Commands`, - "fun": `${icon("fun")} Fun Commands`, - "image": `${icon("image")} Image Commands`, - "mod": `${icon("moderation")} Moderation Commands` + "core": `${iconPill("home", "Core Commands")}`, + "info": `${iconPill("information", "Information Commands")}`, + "search": `${iconPill("search", "Search Commands")}`, + "utils": `${iconPill("tools", "Utility Commands")}`, + "fun": `${iconPill("stars", "Fun Commands")}`, + "image": `${iconPill("image", "Image Commands")}`, + "mod": `${iconPill("shield", "Moderation Commands")}` } module.exports = { @@ -115,7 +115,7 @@ module.exports = { }, permissionsClient: [Permissions.EMBED_LINKS, Permissions.SEND_MESSAGES, Permissions.USE_EXTERNAL_EMOJIS, Permissions.READ_MESSAGE_HISTORY], run: async (context, args) => { - if(canUseLimitedTestCommands(context)) categories["limited"] = `${icon("fun")} Limited Test Commands`; + if(canUseLimitedTestCommands(context)) categories["limited"] = `${icon("stars")} Limited Test Commands`; if(args.command){ await context.triggerTyping() // Detailed command view diff --git a/commands/message/core/ping.js b/commands/message/core/ping.js index 6aebd7c..557b24d 100644 --- a/commands/message/core/ping.js +++ b/commands/message/core/ping.js @@ -20,7 +20,7 @@ module.exports = { ping = await context.client.ping() editOrReply(context, { embeds: [createEmbed("default", context, { - description: `${icon("connection")} **Pong!**\n` + codeblock("ansi", [`rest ${format(`${ping.rest}ms`, "m")}`, `gateway ${format(`${ping.gateway}ms`, "m")}`]) + description: `${icon("latency")} **Pong!**\n` + codeblock("ansi", [`rest ${format(`${ping.rest}ms`, "m")}`, `gateway ${format(`${ping.gateway}ms`, "m")}`]) })] }) }, diff --git a/commands/message/core/privacy.js b/commands/message/core/privacy.js index 1868b3c..9bab9ba 100644 --- a/commands/message/core/privacy.js +++ b/commands/message/core/privacy.js @@ -17,7 +17,7 @@ module.exports = { run: async (context) => { return await editOrReply(context, createEmbed("default", context, { - description: `${icon("rules")} **labsCore Privacy Policy**\n*Last Updated: ${timestamp(PRIVACY_POLICY_LAST_UPDATE, "f")}*\n\n${PRIVACY_POLICY_SECTIONS.join('\n\n')}\n\nIf you have any further questions, please contact us via our ${link(DISCORD_INVITES.privacy, "Support Server")}`, + description: `${icon("agreements")} **labsCore Privacy Policy**\n*Last Updated: ${timestamp(PRIVACY_POLICY_LAST_UPDATE, "f")}*\n\n${PRIVACY_POLICY_SECTIONS.join('\n\n')}\n\nIf you have any further questions, please contact us via our ${link(DISCORD_INVITES.privacy, "Support Server")}`, color: COLORS.brand }) ) diff --git a/commands/message/core/stats.js b/commands/message/core/stats.js index 331d408..4939221 100644 --- a/commands/message/core/stats.js +++ b/commands/message/core/stats.js @@ -57,10 +57,10 @@ module.exports = { } const display = [ - `${iconPill("house", "Servers ")} ${highlight(` ${formatted.guilds} `)}`, - `${iconPill("robot", "Shard ")} ${highlight(` ${context.shardId + 1}/${context.manager.cluster.shardCount} `)}`, - `${iconPill("connection", "Memory Usage")} ${highlight(` ${Math.round(formatted.usage / 1024 / 1024)}MB `)}`, - `${iconPill("timer", "Uptime ")} ${highlight(` ${format(process.uptime())} `)}`, + `${iconPill("home", "Servers ")} ${highlight(` ${formatted.guilds} `)}`, + `${iconPill("robot", "Shard ")} ${highlight(` ${context.shardId + 1}/${context.manager.cluster.shardCount} `)}`, + `${iconPill("latency", "Memory Usage")} ${highlight(` ${Math.round(formatted.usage / 1024 / 1024)}MB `)}`, + `${iconPill("clock", "Uptime ")} ${highlight(` ${format(process.uptime())} `)}`, ``, `${iconLinkPill('gitlab', OPEN_SOURCE_REPOSITORY_URL, 'Source Code')} ​ ​ ${iconLinkPill('link', context.application.oauth2UrlFormat({ scope: 'bot applications.commands', permissions: 412317248576 }), `Invite ${context.client.user.username}`)}` ] diff --git a/commands/message/fun/chat.js b/commands/message/fun/chat.js index d6450ae..0dd784a 100644 --- a/commands/message/fun/chat.js +++ b/commands/message/fun/chat.js @@ -1,21 +1,18 @@ const { createEmbed } = require('../../../labscore/utils/embed') -const { format } = require('../../../labscore/utils/ansi') const { editOrReply } = require('../../../labscore/utils/message') const superagent = require('superagent') -const { codeblock, iconPill } = require('../../../labscore/utils/markdown') +const { iconPill, smallIconPill } = require('../../../labscore/utils/markdown') const { Permissions } = require("detritus-client/lib/constants"); -const { canUseLimitedTestCommands } = require('../utils/testing') -const { Regexes } = require('detritus-client/lib/utils/markup') -const { DiscordRegexNames } = require('detritus-client/lib/constants') +const { canUseLimitedTestCommands } = require('../../../labscore/utils/testing') const { STATICS } = require('../../../labscore/utils/statics') module.exports = { name: 'chat', label: 'text', metadata: { - description: `${iconPill("fun", "LIMITED TESTING")}\n\nTalk to ChatGPT.\n\n<:bonzi:1138585089891106836> He will explore the Internet with you as your very own friend and sidekick! He can talk, walk, and joke like no other friend you've ever had!`, + description: `${iconPill("generative_ai", "LIMITED TESTING")}\n\nTalk to ChatGPT.\n\n<:bonzi:1138585089891106836> He will explore the Internet with you as your very own friend and sidekick! He can talk, walk, and joke like no other friend you've ever had!`, description_short: 'Talk to ChatGPT.', examples: ['chat How many otter species are there?'], category: 'limited', @@ -47,7 +44,7 @@ module.exports = { model: "CHATGPT" }) - let description = [codeblock("ansi", ["👤 " + format(args.text, "cyan")])] + let description = [smallIconPill("generative_ai", args.text), ''] description.push(res.body.output.substr(0, 2000 - args.text.length)) return editOrReply(context, {embeds:[createEmbed("default", context, { diff --git a/commands/message/fun/disstrack.js b/commands/message/fun/disstrack.js index ba0722d..24eb91f 100644 --- a/commands/message/fun/disstrack.js +++ b/commands/message/fun/disstrack.js @@ -1,19 +1,18 @@ const { createEmbed } = require('../../../labscore/utils/embed') -const { format } = require('../../../labscore/utils/ansi') const { editOrReply } = require('../../../labscore/utils/message') const superagent = require('superagent') -const { codeblock, iconPill } = require('../../../labscore/utils/markdown') +const { codeblock, iconPill, smallIconPill } = require('../../../labscore/utils/markdown') const { Permissions } = require("detritus-client/lib/constants"); -const { canUseLimitedTestCommands } = require('../utils/testing') +const { canUseLimitedTestCommands } = require('../../../labscore/utils/testing') const { STATICS } = require('../../../labscore/utils/statics') module.exports = { name: 'disstrack', label: 'text', metadata: { - description: `${iconPill("fun", "LIMITED TESTING")}\n\nAI Generated Disstracks, powered by ChatGPT`, + description: `${iconPill("generative_ai", "LIMITED TESTING")}\n\nAI Generated Disstracks, powered by ChatGPT`, description_short: 'AI generated disstracks.', examples: ['disstrack'], category: 'limited', @@ -38,7 +37,7 @@ module.exports = { model: "CHATGPT" }) return editOrReply(context, {embeds:[createEmbed("default", context, { - description: codeblock("ansi", [res.body.output.substr(0, 2020)]), + description: smallIconPill("generative_ai", args.text) + '\n' + codeblock("ansi", [res.body.output.substr(0, 2020 - args.text.length)]), footer: { text: `🗣🗣📢🔥🔥🔥🔥💯 • ${context.application.name}`, iconUrl: STATICS.openai diff --git a/commands/message/fun/texttomusic.js b/commands/message/fun/texttomusic.js index f855291..179628e 100644 --- a/commands/message/fun/texttomusic.js +++ b/commands/message/fun/texttomusic.js @@ -46,7 +46,7 @@ module.exports = { clearTimeout(noticeTimer) await response.edit({ - embeds: [createEmbed("defaultNoFooter", context, { description: `${icon("audio")} Audio Generated in ${highlight(((Date.now() - t) / 1000).toFixed(2) + "s")}.` })], + embeds: [createEmbed("defaultNoFooter", context, { description: `${icon("note")} Audio Generated in ${highlight(((Date.now() - t) / 1000).toFixed(2) + "s")}.` })], file: { value: img.body, filename: "music.mp3" } }) diff --git a/commands/message/info/appinfo.js b/commands/message/info/appinfo.js index 52b59aa..aa7beb4 100644 --- a/commands/message/info/appinfo.js +++ b/commands/message/info/appinfo.js @@ -31,7 +31,7 @@ const applicationFlagNames = { GATEWAY_MESSAGE_CONTENT: "Message Content Intent", GATEWAY_MESSAGE_CONTENT_LIMITED: "Message Content Intent (Not approved)", EMBEDDED_FIRST_PARTY: "Embedded First Party", - APPLICATION_COMMAND_BADGE: `Has Slash Commands ${icon("badge_slash")}` + APPLICATION_COMMAND_BADGE: `Has Slash Commands ${icon("slash")}` } module.exports = { @@ -76,8 +76,8 @@ module.exports = { if(application.terms_of_service_url || application.privacy_policy_url){ let content = [] - if(application.terms_of_service_url) content.push(`${icon("rules")} ${link(application.terms_of_service_url, "Terms of Service")}`) - if(application.privacy_policy_url) content.push(`${icon("lock")} ${link(application.privacy_policy_url, "Privacy Policy")}`) + if(application.terms_of_service_url) content.push(`${icon("agreements")} ${link(application.terms_of_service_url, "Terms of Service")}`) + if(application.privacy_policy_url) content.push(`${icon("padlock")} ${link(application.privacy_policy_url, "Privacy Policy")}`) embed.fields.push({ name: `${icon("link")} Links`, @@ -88,13 +88,13 @@ module.exports = { if("bot_public" in application){ let content = [] - if(application.bot_public) content.push(`• Bot is public`) - if(application.custom_install_url) content.push(`${icon("link")} ${link(application.custom_install_url, "Invite Bot")}`) - if(application.install_params) content.push(`${icon("downloading")} ${link(`https://discord.com/api/oauth2/authorize?client_id=${application.id}&permissions=${application.install_params.permissions}&scope=${application.install_params.scopes.join('+')}`, "Invite Bot")}`) - if(application.bot_require_code_grant) content.push(`\n• Bot requires code grant`) + if(application.bot_public) content.push(`• App is public`) + if(application.custom_install_url) content.push(`${icon("link")} ${link(application.custom_install_url, "Invite App")}`) + if(application.install_params) content.push(`${icon("link")} ${link(`https://discord.com/api/oauth2/authorize?client_id=${application.id}&permissions=${application.install_params.permissions}&scope=${application.install_params.scopes.join('+')}`, "OAuth2 Invite URL")}`) + if(application.bot_require_code_grant) content.push(`\n• App requires code grant`) if(content.length) embed.fields.push({ - name: `${icon("robouser")} Bot`, + name: `${icon("user")} Bot`, value: content.join('\n'), inline: true }) @@ -102,7 +102,7 @@ module.exports = { if(application.tags){ embed.fields.push({ - name: `${icon("activity")} Tags`, + name: `${icon("list")} Tags`, value: application.tags.map(t => highlight(t)).join(', '), inline: true }) diff --git a/commands/message/info/guild.js b/commands/message/info/guild.js index 7e1bab3..06f87ae 100644 --- a/commands/message/info/guild.js +++ b/commands/message/info/guild.js @@ -34,7 +34,7 @@ module.exports = { const g = context.guild // Guild Card let guildCard = createEmbed("default", context, { - description: `${icon("house")} **${g.name}** ${highlight(`(${g.id})`)}\n\n${icon("calendar")} **Created at: **${timestamp(g.createdAt, "f")}`, + description: `${icon("home")} **${g.name}** ${highlight(`(${g.id})`)}\n\n${icon("calendar")} **Created at: **${timestamp(g.createdAt, "f")}`, fields: [] }) @@ -91,11 +91,11 @@ module.exports = { let i = 0; let ic = Math.ceil(featureCards.length / 2); - if(ic == 1) featureCards[0].name = `${icon("activity")} Guild Features` + if(ic == 1) featureCards[0].name = `${icon("list")} Guild Features` while(featureCards.length >= 1){ i++; const sub = featureCards.splice(0, 2) - sub[0].name = `${icon("activity")} Guild Features (${i}/${ic})` + sub[0].name = `${icon("list")} Guild Features (${i}/${ic})` pages.push(page(JSON.parse(JSON.stringify(Object.assign({ ...guildCard }, { fields: sub }))))) } diff --git a/commands/message/info/invite.js b/commands/message/info/invite.js index 188e4fc..1f4371b 100644 --- a/commands/message/info/invite.js +++ b/commands/message/info/invite.js @@ -28,7 +28,7 @@ module.exports = { '​', icon('link') + ` You can invite ${context.client.user.username} with ${link(context.application.oauth2UrlFormat({ scope: 'bot applications.commands', permissions: 412317248576 }), 'this link')}.`, '', - icon('robouser') + ` Need help? Join our ${link(DISCORD_INVITES.support, 'Support Server')}.`, + icon('robot') + ` Need help? Join our ${link(DISCORD_INVITES.support, 'Support Server')}.`, '', iconLinkPill('gitlab', OPEN_SOURCE_REPOSITORY_URL, 'Source Code'), ].join('\n'), @@ -43,7 +43,7 @@ module.exports = { const g = invite.guild // Guild Card let inviteCard = createEmbed("default", context, { - description: `${icon("link")} **https://discord.gg/${inviteCode[1]}**\n\n​${icon("house")} **${g.name}** ${highlight(`(${g.id})`)}\n${icon("calendar")} **Created at: **${timestamp(g.createdAt, "f")}\n\n${iconPill("people", invite.approximateMemberCount.toLocaleString())} ​ ​ ​ ​ ​ ${iconPill("online", invite.approximatePresenceCount.toLocaleString())}​ ​ ​ ${iconPill("offline", invite.approximateMemberCount - invite.approximatePresenceCount).toLocaleString()}`, + description: `${icon("link")} **https://discord.gg/${inviteCode[1]}**\n\n​${icon("home")} **${g.name}** ${highlight(`(${g.id})`)}\n${icon("calendar")} **Created at: **${timestamp(g.createdAt, "f")}\n\n${iconPill("user_multiple", invite.approximateMemberCount.toLocaleString())} ​ ​ ​ ​ ​ ${iconPill("online", invite.approximatePresenceCount.toLocaleString())}​ ​ ​ ${iconPill("offline", invite.approximateMemberCount - invite.approximatePresenceCount).toLocaleString()}`, fields: [] }) @@ -67,11 +67,11 @@ module.exports = { let i = 0; let ic = Math.ceil(featureCards.length / 2); - if(ic == 1) featureCards[0].name = `${icon("activity")} Guild Features` + if(ic == 1) featureCards[0].name = `${icon("list")} Guild Features` while(featureCards.length >= 1){ i++; const sub = featureCards.splice(0, 2) - sub[0].name = `${icon("activity")} Guild Features (${i}/${ic})` + sub[0].name = `${icon("list")} Guild Features (${i}/${ic})` pages.push(page(JSON.parse(JSON.stringify(Object.assign({ ...inviteCard }, { fields: sub }))))) } diff --git a/commands/message/info/user.js b/commands/message/info/user.js index fce987a..479eb82 100644 --- a/commands/message/info/user.js +++ b/commands/message/info/user.js @@ -41,7 +41,7 @@ module.exports = { if(u.discriminator && u.discriminator !== "0") usernameDisplay += `#${u.discriminator}` let userCard = createEmbed("default", context, { - description: `${icon("person")} **${usernameDisplay}**${botTag} ${highlight(`(${u.id})`)}`, + description: `${icon("user")} **${usernameDisplay}**${botTag} ${highlight(`(${u.id})`)}`, thumbnail: { url: u.avatarUrl + `?size=4096` }, @@ -62,7 +62,7 @@ module.exports = { if(m.roles.length >= 1) guildFields.push(`**Roles: ** ${m.roles.length}/${context.guild.roles.length}`) if(m.premiumSince) guildFields.push(`**Boosting since: ** ${timestamp(m.premiumSince, 'f')}`) userCard.fields.push({ - name: `${icon("house")} Server`, + name: `${icon("home")} Server`, value: guildFields.join('\n'), inline: true }) diff --git a/commands/message/mod/perspective.js b/commands/message/mod/perspective.js index 657f532..13728bc 100644 --- a/commands/message/mod/perspective.js +++ b/commands/message/mod/perspective.js @@ -54,14 +54,14 @@ module.exports = { if (context.message.messageReference) { msg = await context.message.channel.fetchMessage(context.message.messageReference.messageId) args.input = msg.content - msg = `${icon("robouser")} <@${msg.author.id}> (${msg.author.id})\n${codeblock("ansi", [msg.content])}\n` + msg = `${icon("robot")} <@${msg.author.id}> (${msg.author.id})\n${codeblock("ansi", [msg.content])}\n` } let perspectiveApi = await perspective(context, [args.input]) return await editOrReply(context, { embeds: [createEmbed("default", context, { - description: `${msg}${iconPill("rules", "Scores")} ${codeblock("ansi", formatPerspectiveScores(perspectiveApi.response.body))}`, + description: `${msg}${iconPill("agreements", "Scores")} ${codeblock("ansi", formatPerspectiveScores(perspectiveApi.response.body))}`, footer: { iconUrl: STATICS.perspectiveapi, text: `Perspective • ${context.application.name}` diff --git a/commands/message/search/reddit.js b/commands/message/search/reddit.js index 1136a41..bff4eb2 100644 --- a/commands/message/search/reddit.js +++ b/commands/message/search/reddit.js @@ -31,14 +31,14 @@ function createRedditPage(context, result){ let awardData = [] // Awards - for(const a of Object.keys(result.awards)){ - awardData.push(`${icon(`reddit_${a}`)}${highlight(result.awards[a])}`) - } + //for(const a of Object.keys(result.awards)){ + // awardData.push(`${icon(`reddit_${a}`)}${highlight(result.awards[a])}`) + //} if(awardData.length >= 1) description.push(`${awardData.join(' ')}`) description.push(``) - description.push(`${iconPill("upvote", result.post.score)} ​ ${icon("person")} ${link(result.author.link, `u/${result.author.name}`)}`) + description.push(`${iconPill("upvote", result.post.score)} ​ ${icon("user")} ${link(result.author.link, `u/${result.author.name}`)}`) res.embeds[0].description = description.join('\n') return res; diff --git a/commands/message/search/youtube.js b/commands/message/search/youtube.js index a99c652..c7ca970 100644 --- a/commands/message/search/youtube.js +++ b/commands/message/search/youtube.js @@ -36,9 +36,9 @@ function createYoutubePage(context, result){ case 1: //video iconHeader = [] - iconHeader.push(iconPill("eye", intToString(parseInt(result.metadata.views).toLocaleString('en-US')) + ' Views')) - if(result.metadata.likes >= 1) iconHeader.push(iconPill("like", intToString(parseInt(result.metadata.likes)) + ' Likes')) - if(result.metadata.comments >= 1) iconHeader.push('\n' + iconPill("message", intToString(parseInt(result.metadata.comments)) + ' Comments')) + iconHeader.push(iconPill("stat_views", intToString(parseInt(result.metadata.views).toLocaleString('en-US')) + ' Views')) + if(result.metadata.likes >= 1) iconHeader.push(iconPill("stat_likes", intToString(parseInt(result.metadata.likes)) + ' Likes')) + if(result.metadata.comments >= 1) iconHeader.push('\n' + iconPill("stat_comments", intToString(parseInt(result.metadata.comments)) + ' Comments')) res = page(createEmbed("default", context, { author: { @@ -59,10 +59,10 @@ function createYoutubePage(context, result){ case 2: // channel iconHeader = [] - iconHeader.push(iconPill("people", intToString(parseInt(result.metadata.subscribers).toLocaleString('en-US')) + ' Subscribers')) - iconHeader.push(iconPill("eye", intToString(parseInt(result.metadata.views).toLocaleString('en-US')) + ' Views')) + iconHeader.push(iconPill("stat_people", intToString(parseInt(result.metadata.subscribers).toLocaleString('en-US')) + ' Subscribers')) + iconHeader.push(iconPill("stat_views", intToString(parseInt(result.metadata.views).toLocaleString('en-US')) + ' Views')) - iconHeader.push('\n' + iconPill("videos", intToString(parseInt(result.metadata.videos).toLocaleString('en-US')) + ' Videos')) + iconHeader.push('\n' + iconPill("stat_videos", intToString(parseInt(result.metadata.videos).toLocaleString('en-US')) + ' Videos')) res = page(createEmbed("default", context, { author: { @@ -83,7 +83,7 @@ function createYoutubePage(context, result){ case 3: // playlist iconHeader = [ '', - iconPill("videos", intToString(parseInt(result.metadata.videos).toLocaleString('en-US')) + ' Videos') + iconPill("stat_videos", intToString(parseInt(result.metadata.videos).toLocaleString('en-US')) + ' Videos') ] res = page(createEmbed("default", context, { author: { diff --git a/commands/message/utils/dictionary.js b/commands/message/utils/dictionary.js index 9ffc656..f63d7c1 100644 --- a/commands/message/utils/dictionary.js +++ b/commands/message/utils/dictionary.js @@ -12,7 +12,7 @@ function createDictionaryPage(context, result, word){ if(result.phonetic) phon = `\n*${result.phonetic}*` let e = createEmbed("default", context, { - description: `${icon("book")} **${link(`https://en.wiktionary.org/wiki/${encodeURIComponent(word.word)}`, word.word, "Definition on Wiktionary")}**`, + description: `${icon("definition")} **${link(`https://en.wiktionary.org/wiki/${encodeURIComponent(word.word)}`, word.word, "Definition on Wiktionary")}**`, fields: [] }) @@ -28,7 +28,7 @@ function createDictionaryPage(context, result, word){ defItms.push(d.definition, citation(ref, d.src)) if(d.examples) defItms.push(`\n ​ ​ ${icon("message")} *${d.examples.join(`*\n ​ ​ ${icon("message")} *`)}*`) // Synonyms are limited to 5 to prevent overflow - if(d.synonyms) defItms.push(`\n ​ ​ ${iconPill("book", "Synonyms")} ${d.synonyms.splice(0, 5).map((s)=>smallPill(s)).join(' ')}`) + if(d.synonyms) defItms.push(`\n ​ ​ ${iconPill("definition", "Synonyms")} ${d.synonyms.splice(0, 5).map((s)=>smallPill(s)).join(' ')}`) ref++; if([...defDesc, defItms.join(' ')].join('\n\n').length >= 1024) continue; diff --git a/commands/message/utils/emoji.js b/commands/message/utils/emoji.js index faf8f82..0e2e4f6 100644 --- a/commands/message/utils/emoji.js +++ b/commands/message/utils/emoji.js @@ -80,7 +80,7 @@ module.exports = { if(matches[0].animated) form = '.gif' let tagline = '' - if(context.guild.emojis.find((e)=>e.id == matches[0].id)) tagline = `\n${icon("house")} This emoji is from ${bold(context.guild.name)}` + if(context.guild.emojis.find((e)=>e.id == matches[0].id)) tagline = `\n${icon("home")} This emoji is from ${bold(context.guild.name)}` return editOrReply(context, createEmbed("default", context, { description: `${iconPill("emoji", `:${matches[0].name}:`)} ${highlight(`(${matches[0].id})`)}${tagline}`, diff --git a/labscore/constants.js b/labscore/constants.js index ca013a7..7de239f 100644 --- a/labscore/constants.js +++ b/labscore/constants.js @@ -103,6 +103,91 @@ module.exports.ICONS = Object.freeze({ "gitlab": "<:ico_gitlab:1130603378704138411>" }) + +module.exports.REDESIGN_ICONS = Object.freeze({ + "home": "<:ico_home:1139699944295510036>", + "image": "<:ico_image:1139704766906245191>", + "search": "<:ico_search:1139704772472086598>", + "shield": "<:ico_shield:1139704774653136947>", + "stars": " <:ico_stars:1139704776620253309>", + "tools": "<:ico_tools:1139704779073921034>", + + + "agreements": "<:ico_agreements:1139855990481768510>", + "calendar": "<:ico_calendar:1139856007334477896>", + "certificate": "<:ico_certificate:1139856009024786483>", + "clock": "<:ico_clock:1139856015840522240>", + "definition": "<:ico_definition:1139856055292133398>", + "example": "<:ico_example:1139857087015440474>", + "flag": "<:ico_flag:1139857089683009666>", + "list": "<:ico_list:1139857100646924408>", + "mag": "<:ico_mag:1139857104304345120>", + "note": "<:ico_note:1139857873082515527>", + "padlock": "<:ico_padlock:1139857874537947196>", + "pencil": "<:ico_pencil:1139857877092270080>", + "planet": "<:ico_planet:1139857878249898017>", + "qr": "<:ico_qr:1139857880594526291>", + "robot": "<:ico_robot:1139857884663005235>", + "settings": "<:ico_settings:1139857885652856884>", + "trend": "<:ico_trend:1139858673494130770>", + "visible": "<:ico_visible:1139858684420300860>", + + "attachment_image": "<:ico_attachment:1139856000195756044>", + "emoji": "<:ico_emoji:1139856021934833744>", + "boost": "<:ico_boost:1139856005132468224>", + "link": "<:ico_link:1139857098235199499>", + "locale": "<:ico_locale:1139857103125741678>", + "message": "<:ico_message:1139857108548988929>", + "nitro": "<:ico_nitro:1139857137124786176>", + "reply": "<:ico_reply:1139857882402258964>", + "slash": "<:ico_slash:1139857887485763584>", + "sticker": "<:ico_sticker:1139858670260330559>", + + "audio": "<:ico_audio:1139856002972401714>", + "microphone": "<:ico_microphone:1139857135488995350>", + "channel": "<:ico_channel:1139856012069847131>", + "channel_nsfw": "<:ico_channel_nsfw:1139856013743362048>", + "mention": "<:ico_mention:1139857106577670154>", + + "user": "<:ico_user:1139858676493070337>", + "user_multiple": "<:ico_user_multiple:1139858678732836965>", + "user_profile": "<:ico_user_profile:1139858680553160765>", + "user_shield": "<:ico_user_shield:1139858682520285226>", + + "status_offline": "<:ico_status_offline:1139858665428500533>", + "status_online": "<:ico_status_online:1139858667345301577>", + + "arrow_down": "<:ico_arrow_down:1139855992989945916>", + "arrow_left": "<:ico_arrow_left:1139855994084667424>", + "arrow_right": "<:ico_arrow_right:1139855995716243486>", + "arrow_up": "<:ico_arrow_up:1139855998245421088>", + + "stat_comments": "<:ico_stat_comments:1139857889813606471>", + "stat_likes": "<:ico_stat_likes:1139857891667476520>", + "stat_people": "<:ico_stat_people:1139861631812243499>", + "stat_videos": "<:ico_stat_videos:1139857894343454720>", + "stat_views": "<:ico_stat_views:1139857917047209985>", + + "downvote": "<:ico_downvote:1139856056902754335>", + "upvote": "<:ico_upvote:1139858674945380352>", + + "gitlab": "<:ico_gitlab:1139857092921020486>", + + "generative_ai": "<:ico_generative_ai:1139857090698027043>", + "latency": "<:ico_latency:1139857096284831845>", + + "information": "<:ico_information:1139704769179562064>", + "question": "<:ico_question:1139704770760806502>", + + // Legacy icons for now + "question_large": "<:ico_question:1086624956235919391>", + "exclaim_0": "<:ico_w0:1086624957586489364>", + "exclaim_1": "<:ico_w1:1086624959142580275>", + "exclaim_2": "<:ico_w2:1086624961025810485>", + "exclaim_3": "<:ico_w3:1086624963047460874>", + "exclaim_4": "<:ico_w4:1086624964284788787>", +}) + const GUILD_FEATURE_ICONS = Object.freeze({ ACTIVITY: "<:activity:995078510492266606>", AUDIO: "<:audio:995073876381945986>", diff --git a/labscore/utils/markdown.js b/labscore/utils/markdown.js index 9a0b11e..890a9c8 100644 --- a/labscore/utils/markdown.js +++ b/labscore/utils/markdown.js @@ -1,8 +1,8 @@ -const { ICONS } = require('../constants') +const { ICONS, REDESIGN_ICONS } = require('../constants') module.exports.icon = function(icon){ - if(!ICONS[icon]) return ICONS.question - return ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:') + if(!REDESIGN_ICONS[icon]) return ICONS.question + return REDESIGN_ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:') } module.exports.highlight = function(content){ @@ -33,14 +33,19 @@ module.exports.smallPill = function(content){ } module.exports.iconPill = function(icon, content){ - if(!ICONS[icon]) icon = "question" - return ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:') + " **` " + content + " `**" + if(!REDESIGN_ICONS[icon]) icon = "question" + return REDESIGN_ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:') + " **` " + content + " `**" +} + +module.exports.smallIconPill = function(icon, content){ + if(!REDESIGN_ICONS[icon]) icon = "question" + return REDESIGN_ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:') + " ` " + content + " `" } module.exports.iconLinkPill = function(icon, url, content, tooltip = ""){ - if(!ICONS[icon]) icon = "question" + if(!REDESIGN_ICONS[icon]) icon = "question" if(tooltip.length) tooltip = ` '${tooltip}'` - if(content) return `${ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:')} [**\` ${content} \`**](${url}${tooltip})` + if(content) return `${REDESIGN_ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:')} [**\` ${content} \`**](${url}${tooltip})` return url } module.exports.linkPill = function(url, content, tooltip = ""){ diff --git a/commands/message/utils/testing.js b/labscore/utils/testing.js similarity index 100% rename from commands/message/utils/testing.js rename to labscore/utils/testing.js