weather v2, p2

This commit is contained in:
derpystuff 2023-10-28 13:40:38 +02:00
parent 911d28c46b
commit f0478902c5
3 changed files with 31 additions and 8 deletions

View file

@ -200,6 +200,19 @@ module.exports.REDESIGN_ICONS = Object.freeze({
"exclaim_4": "<:ico_exclaim_4:1165263551586369609>",
"question_large": "<:ico_question_large:1165263553050185950>",
"weather_clear": "<:ico_weather_clear_day:1167770009557286913>",
"weather_cloudy": "<:ico_weather_cloudy:1167770011776073819>",
"weather_drizzle": "<:ico_weather_drizzle:1167770013747388437>",
"weather_flurries": "<:ico_weather_flurries:1167788306059247616>",
"weather_haze": "<:haze:1167770015957782548>",
"weather_mostlyclear": "<:ico_weather_mostly_clear_day:1167770017719398411>",
"weather_mostlycloudy": "<:ico_weather_mostly_cloudy_day:1167770019766214686>",
"weather_partlycloudy": "<:ico_weather_partly_cloudy_day:1167770022073094234>",
"weather_rain": "<:ico_weather_rain:1167770024761630741>",
"weather_snow": "<:ico_weather_snow:1167770027135606806>",
"weather_thunderstorms": "<:ico_weather_thunderstorms:1167770030063231117>",
"weather_windy": "<:ico_weather_windy:1167770031682232420>",
"information": "<:ico_information:1139704769179562064>",
"question": "<:ico_question:1139704770760806502>",
"warning": "<:ico_warning:1151286226117201970>",

View file

@ -1,10 +1,15 @@
const { ICONS, REDESIGN_ICONS } = require('../constants')
module.exports.icon = function(icon){
if(!REDESIGN_ICONS[icon]) return ICONS.question
if(!REDESIGN_ICONS[icon]) return ICONS.question.replace(/:[a-z1-9_]*:/, ':i:')
return REDESIGN_ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:')
}
module.exports.weatherIcon = function(icon){
if(!REDESIGN_ICONS["weather_" + icon]) return REDESIGN_ICONS["calendar"].replace(/:[a-z1-9_]*:/, ':i:')
return REDESIGN_ICONS["weather_" + icon].replace(/:[a-z1-9_]*:/, ':i:')
}
module.exports.highlight = function(content = ""){
return "`" + content.toString().replace(/\`/g, 'ˋ') + "`"
}