Add Matrix command handler + emoji command

This commit is contained in:
Cadence Ember 2023-09-27 08:20:18 +13:00
parent c1cbdfee82
commit d1e3640078
5 changed files with 285 additions and 12 deletions

View file

@ -63,7 +63,7 @@ async function stickersToState(stickers) {
if (sticker && sticker.description) body += ` - ${sticker.description}`
if (!body) body = undefined
let shortcode = sticker.name.toLowerCase().replace(/[^a-zA-Z0-9-_]/g, "-").replace(/^-|-$/g, "").replace(/--+/g, "-")
let shortcode = sticker.name.toLowerCase().replace(/[^a-zA-Z0-9_-]/g, "-").replace(/^-|-$/g, "").replace(/--+/g, "-")
while (shortcodes.includes(shortcode)) shortcode = shortcode + "~"
shortcodes.push(shortcode)