Add !still command

This commit is contained in:
Anthony Sottile 2019-07-20 14:00:08 -07:00
parent 16fec1c34d
commit e8f3093fb4
1 changed files with 10 additions and 0 deletions

10
bot.py
View File

@ -2,6 +2,7 @@ import argparse
import asyncio
import datetime
import json
import random
import re
import sys
import traceback
@ -156,6 +157,15 @@ def keyboard(match: Match[str]) -> Response:
)
@handle_message('!still')
def cmd_still(match: Match[str]) -> Response:
_, _, msg = match.groups()
_, _, rest = msg.partition(' ')
year = datetime.date.today().year
lol = random.choice(['LOL', 'LOLW', 'LMAO', 'NUUU'])
return MessageResponse(match, f'{esc(rest)}, in {year} - {lol}!')
class UptimeResponse(Response):
async def __call__(self, config: Config) -> Optional[str]:
url = f'https://api.twitch.tv/helix/streams?user_login={config.channel}' # noqa: E501