mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 06:33:05 -04:00
use stringwrap where applicable
This commit is contained in:
parent
cd5e9ceb4a
commit
92751115fa
2 changed files with 4 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
|||
const { codeblock, icon, link, pill, smallPill, iconPill } = require('../../../labscore/utils/markdown')
|
||||
const { codeblock, icon, link, pill, smallPill, iconPill, stringwrap } = require('../../../labscore/utils/markdown')
|
||||
const { createEmbed, formatPaginationEmbeds, page } = require('../../../labscore/utils/embed')
|
||||
|
||||
const { DISCORD_INVITES, DEFAULT_PREFIXES } = require('../../../labscore/constants')
|
||||
|
@ -26,7 +26,7 @@ function renderCommandList(commands, descriptions, limit) {
|
|||
|
||||
let desc = descriptions[i]
|
||||
if (desc.includes('\n')) desc = desc.split('\n')[0]
|
||||
if (desc.length >= 41) desc = desc.substr(0, 40) + '...'
|
||||
if (desc.length >= 41) desc = stringwrap(desc, 40)
|
||||
|
||||
render.push(` \` ${c}${' '.repeat(pad)}\` ${desc}`)
|
||||
i++
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const { createEmbed } = require("../../../labscore/utils/embed");
|
||||
const { editOrReply } = require("../../../labscore/utils/message");
|
||||
const { icon, highlight, link } = require('../../../labscore/utils/markdown');
|
||||
const { icon, highlight, link, stringwrap } = require('../../../labscore/utils/markdown');
|
||||
|
||||
const superagent = require('superagent');
|
||||
|
||||
|
@ -137,10 +137,7 @@ module.exports = {
|
|||
}
|
||||
|
||||
if(assets.length){
|
||||
let asset = assets.map(a => {
|
||||
if(a.name.length >= 25) return link(`https://cdn.discordapp.com/app-assets/${application.id}/${a.id}.png?size=4096`, a.name.substr(0,23) + '...')
|
||||
return link(`https://cdn.discordapp.com/app-assets/${application.id}/${a.id}.png?size=4096`, a.name.substr(0,23))
|
||||
})
|
||||
let asset = assets.map(a => link(`https://cdn.discordapp.com/app-assets/${application.id}/${a.id}.png?size=4096`, stringwrap(a.name, 23)))
|
||||
if(asset.length >= 6) asset[5] = link(`https://canary.discord.com/api/oauth2/applications/${application.id}/assets`, `View ${asset.length - 6} remaining assets`)
|
||||
embed.fields.push({
|
||||
name: `${icon("image")} Assets`,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue