implement /me

This commit is contained in:
Anthony Sottile 2020-05-04 15:42:48 -07:00
parent 49d82152de
commit 458c2c969f
1 changed files with 16 additions and 6 deletions

12
bot.py
View File

@ -480,10 +480,20 @@ async def amain(config: Config, *, quiet: bool) -> NoReturn:
else: else:
r, g, b = _gen_color(info['display-name']) r, g, b = _gen_color(info['display-name'])
color_start = f'\033[1m\033[38;2;{r};{g};{b}m'
if msg_match[3].startswith('\x01ACTION '):
print( print(
f'{dt_str()}' f'{dt_str()}'
f'{_badges(info["badges"])}' f'{_badges(info["badges"])}'
f'<\033[1m\033[38;2;{r};{g};{b}m{info["display-name"]}\033[m> ' f'{color_start}\033[3m * {info["display-name"]}\033[22m '
f'{msg_match[3][8:-1]}\033[m',
)
else:
print(
f'{dt_str()}'
f'{_badges(info["badges"])}'
f'<{color_start}{info["display-name"]}\033[m> '
f'{msg_match[3]}', f'{msg_match[3]}',
) )