This commit is contained in:
bignutty 2024-11-17 01:52:18 +01:00
parent 79b096efb4
commit fcb25fc639
7 changed files with 563 additions and 6 deletions

View file

@ -5,6 +5,19 @@ module.exports.icon = function(icon){
return ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:')
}
module.exports.iconAsEmojiObject = function(icon){
let i;
if(!ICONS[icon]) i = ICONS.question.replace(/:[a-z1-9_]*:/, ':i:');
else i = ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:');
return {
id: i.replace(/<:[a-z0-9_]*:([0-9]*)>/g,"$1"),
name: i,
animated: false, // TODO: fix this for animated emoji if we ever need them
}
}
module.exports.weatherIcon = function(icon){
if(!ICONS["weather_" + icon]) return ICONS["calendar"].replace(/:[a-z1-9_]*:/, ':i:')
return ICONS["weather_" + icon].replace(/:[a-z1-9_]*:/, ':i:')