def charinfo(self, ctx, *, uchars: str):
"""Get the Unicode info for a character or characters.
Usage: charinfo [character(s)]"""
no_preview = [
'\u0020',
'\uFEFF'
]
cinfo = commands.Paginator(prefix='', suffix='', max_size=(1999 if self.bot.selfbot else 2000))
for char in list(uchars.replace('\n', '')):
hexp = str(hex(ord(char))).replace('0x', '').upper()
while len(hexp) < 4:
hexp = '0' + hexp
preview = f' (`{char}`)'
cinfo.add_line(f'U+{hexp} {unicodedata.name(char)} {char}' + (preview if char not in no_preview else ''))
if len(cinfo.pages) > 5:
await ctx.send('Too long, trimming to 5 pages.')
for page in cinfo.pages[0:5]:
await ctx.send(page)
评论列表
文章目录