mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
* feat: camofy urls * chore: unify standards * feat: api changes for trusted bot perks * feat: trusted bot perks on edit page * chore: unify * fix: wtf * feat: hide perks menu for non-trusted bots * fix: camo should be proceed at server-side * type: typing issue * fix: conflict * fix: editing page on vanity code * fix: removed reserved page * feat: reserved vanity * fix: for not found * fix: bypass reserved vanity for offical bot * chore: apply prettier * chore: add webhook log for vanity change --------- Co-authored-by: skinmaker1345 <skinmaker1345@gmail.com>
24 lines
839 B
TypeScript
24 lines
839 B
TypeScript
import urlRegex from 'url-regex-safe'
|
|
const reservedVanityConst = [
|
|
'koreanbots',
|
|
'koreanservers',
|
|
'koreanlist',
|
|
'kbots',
|
|
'kodl',
|
|
'discord',
|
|
]
|
|
|
|
export const ID = /^[0-9]{17,}$/
|
|
export const Vanity = /^[A-Za-z\d-]+$/
|
|
export const Prefix = /^[^\s]/
|
|
export const HTTPProtocol = /^https?:\/\/.*?/
|
|
export const Url = urlRegex({ strict: true })
|
|
|
|
export const Emoji =
|
|
'(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])'
|
|
export const Heading = '<h\\d id="(.+?)">(.*?)<\\/h(\\d)>'
|
|
export const EmojiSyntax = ':(\\w+):'
|
|
export const ImageTag = /<img\s[^>]*?alt\s*=\s*['"]([^'"]*?)['"][^>]*?>/
|
|
export const markdownImage = /!\[([^\]]*)\]\((.*?)\s*("(?:.*[^"])")?\s*\)/g
|
|
export const reservedVanity = new RegExp(`^((?!${reservedVanityConst.join('|')}).)*$`, 'i') // 예약되지 않음을 확인
|