mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-19 19:37:02 -04:00
icon redesign
This commit is contained in:
parent
a4df6550cd
commit
6b4e0f3347
19 changed files with 162 additions and 76 deletions
|
@ -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 = ""){
|
||||
|
|
19
labscore/utils/testing.js
Normal file
19
labscore/utils/testing.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
|
||||
// Get Test Config
|
||||
let LIMITED_TEST_GUILDS;
|
||||
if(process.env.TESTING_SERVER_IDS) LIMITED_TEST_GUILDS = process.env.TESTING_SERVER_IDS.split(';')
|
||||
let LIMITED_TEST_CHANNELS;
|
||||
if(process.env.TESTING_CHANNEL_IDS) LIMITED_TEST_CHANNELS = process.env.TESTING_CHANNEL_IDS.split(';')
|
||||
let LIMITED_TEST_USERS;
|
||||
if(process.env.TESTING_USER_IDS) LIMITED_TEST_USERS = process.env.TESTING_USER_IDS.split(';')
|
||||
|
||||
function canUseLimitedTestCommands(context){
|
||||
if(LIMITED_TEST_GUILDS && LIMITED_TEST_GUILDS.includes(context.guild.id)) return true;
|
||||
if(LIMITED_TEST_CHANNELS && LIMITED_TEST_CHANNELS.includes(context.channel.id)) return true;
|
||||
if(LIMITED_TEST_USERS && LIMITED_TEST_USERS.includes(context.user.id)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
canUseLimitedTestCommands
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue