Add !still command
This commit is contained in:
parent
16fec1c34d
commit
e8f3093fb4
10
bot.py
10
bot.py
|
|
@ -2,6 +2,7 @@ import argparse
|
||||||
import asyncio
|
import asyncio
|
||||||
import datetime
|
import datetime
|
||||||
import json
|
import json
|
||||||
|
import random
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
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):
|
class UptimeResponse(Response):
|
||||||
async def __call__(self, config: Config) -> Optional[str]:
|
async def __call__(self, config: Config) -> Optional[str]:
|
||||||
url = f'https://api.twitch.tv/helix/streams?user_login={config.channel}' # noqa: E501
|
url = f'https://api.twitch.tv/helix/streams?user_login={config.channel}' # noqa: E501
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue