mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 14:13:02 -04:00
surface source code more
This commit is contained in:
parent
b9fc1f5134
commit
baee9233d1
4 changed files with 31 additions and 6 deletions
|
@ -1,9 +1,10 @@
|
|||
const { highlight, iconPill } = require('../../../labscore/utils/markdown')
|
||||
const { highlight, iconPill, link, icon, pill, linkPill, iconLinkPill } = require('../../../labscore/utils/markdown')
|
||||
const { createEmbed } = require('../../../labscore/utils/embed')
|
||||
|
||||
const { editOrReply } = require('../../../labscore/utils/message');
|
||||
|
||||
const { Permissions } = require("detritus-client/lib/constants");
|
||||
const { OPEN_SOURCE_REPOSITORY_URL } = require('../../../labscore/constants');
|
||||
|
||||
function format(seconds){
|
||||
function pad(s){
|
||||
|
@ -59,7 +60,9 @@ module.exports = {
|
|||
`${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("timer", "Uptime ")} ${highlight(` ${format(process.uptime())} `)}`,
|
||||
``,
|
||||
`${iconLinkPill('gitlab', OPEN_SOURCE_REPOSITORY_URL, 'Source Code')} ${iconLinkPill('link', `https://canary.discord.com/application-directory/${context.client.user.id}`, `Invite ${context.client.user.username}`)}`
|
||||
]
|
||||
|
||||
return editOrReply(context, createEmbed("default", context, {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
const { DISCORD_INVITES } = require("../../../labscore/constants");
|
||||
const { DISCORD_INVITES, OPEN_SOURCE_REPOSITORY_URL } = require("../../../labscore/constants");
|
||||
const { createEmbed, formatPaginationEmbeds, page } = require("../../../labscore/utils/embed");
|
||||
const { guildFeaturesField } = require("../../../labscore/utils/fields");
|
||||
const { icon, highlight, timestamp, link, iconPill } = require("../../../labscore/utils/markdown");
|
||||
const { icon, highlight, timestamp, link, iconPill, iconLinkPill } = require("../../../labscore/utils/markdown");
|
||||
const { editOrReply } = require("../../../labscore/utils/message");
|
||||
const { STATICS } = require("../../../labscore/utils/statics");
|
||||
|
||||
|
@ -24,7 +24,14 @@ module.exports = {
|
|||
run: async (context, args) => {
|
||||
context.triggerTyping();
|
||||
if(!args.invite) return editOrReply(context, { content: `https://canary.discord.com/application-directory/${context.client.user.id}`, embed:createEmbed("default", context, {
|
||||
description: `\n${icon("link")} You can invite the bot with ${link(context.application.oauth2UrlFormat({ scope: 'bot applications.commands', permissions: 412317248576 }), 'this link')}.\n\n${icon('robouser')} Join our ${link(DISCORD_INVITES.support, "support server")} if you need help with anything!`,
|
||||
description: [
|
||||
'',
|
||||
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')}.`,
|
||||
'',
|
||||
iconLinkPill('gitlab', OPEN_SOURCE_REPOSITORY_URL, 'Source Code'),
|
||||
].join('\n'),
|
||||
image: {
|
||||
url: STATICS.embedSpacerInvite
|
||||
}
|
||||
|
|
|
@ -13,6 +13,8 @@ module.exports.PRIVACY_POLICY_SECTIONS = [
|
|||
|
||||
module.exports.PRIVACY_POLICY_LAST_UPDATE = 1655325547140
|
||||
|
||||
module.exports.OPEN_SOURCE_REPOSITORY_URL = "https://gitlab.com/bignutty/labscore"
|
||||
|
||||
module.exports.COLORS = Object.freeze({
|
||||
error: 15548997,
|
||||
success: 6411359,
|
||||
|
@ -96,7 +98,8 @@ module.exports.ICONS = Object.freeze({
|
|||
"sticker": "<:ico_sticker:1096937131793985546> ",
|
||||
"emoji": "<:ico_emoji:1096936794731315251>",
|
||||
"empty": "<:e:749601069298090034>",
|
||||
"book": "<:ico_book:1127622851265048576>"
|
||||
"book": "<:ico_book:1127622851265048576>",
|
||||
"gitlab": "<:ico_gitlab:1130603378704138411>"
|
||||
})
|
||||
|
||||
const GUILD_FEATURE_ICONS = Object.freeze({
|
||||
|
|
|
@ -37,6 +37,18 @@ module.exports.iconPill = function(icon, content){
|
|||
return ICONS[icon] + " **` " + content + " `**"
|
||||
}
|
||||
|
||||
module.exports.iconLinkPill = function(icon, url, content, tooltip = ""){
|
||||
if(!ICONS[icon]) icon = "question"
|
||||
if(tooltip.length) tooltip = ` '${tooltip}'`
|
||||
if(content) return `${ICONS[icon]} [**\` ${content} \`**](${url}${tooltip})`
|
||||
return url
|
||||
}
|
||||
module.exports.linkPill = function(url, content, tooltip = ""){
|
||||
if(tooltip.length) tooltip = ` '${tooltip}'`
|
||||
if(content) return `[**\` ${content} \`**](${url}${tooltip})`
|
||||
return url
|
||||
}
|
||||
|
||||
const SUPERSCRIPT_NUMBERS = ["⁰","¹","²","³","⁴","⁵","⁶","⁷","⁸","⁹"]
|
||||
module.exports.citation = function(number = 1, url, tooltip = ""){
|
||||
let formatted = "";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue