From e6ec03fa9628688dadbb6f52fe544722cbb05907 Mon Sep 17 00:00:00 2001 From: Yoav Caspi Date: Sat, 8 Jun 2019 23:26:57 +0300 Subject: [PATCH 1/2] Adding !discord command. --- README.md | 9 +++++++++ bot.py | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/README.md b/README.md index c5fb82d..bb347bf 100644 --- a/README.md +++ b/README.md @@ -74,3 +74,12 @@ anthonywritescodebot: PONG anthonywritescode: PING hello anthonywritescodebot: PONG hello ``` + +### `!discord' + +Show the discord url + +``` +anthonywritescode: !uptime +anthonywritescodebot: We do have Discord, you are welcome to join: https://discord.gg/HxpQ3px +``` diff --git a/bot.py b/bot.py index a75b4be..6969515 100644 --- a/bot.py +++ b/bot.py @@ -124,6 +124,11 @@ def cmd_ohai(match: Match[str]) -> Response: return MessageResponse(match, 'ohai, {user}!') +@handle_message('!discord') +def cmd_discord(match: Match[str]) -> Response: + return MessageResponse(match, 'We do have Discord, you are welcome to join: https://discord.gg/HxpQ3px') + + 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 From 0cc298b8722b79124e3e7d6be29082a56f682ff9 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 8 Jun 2019 13:37:24 -0700 Subject: [PATCH 2/2] Fix example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bb347bf..a4edae8 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,6 @@ anthonywritescodebot: PONG hello Show the discord url ``` -anthonywritescode: !uptime +anthonywritescode: !discord anthonywritescodebot: We do have Discord, you are welcome to join: https://discord.gg/HxpQ3px ```