Adding !discord command.
This commit is contained in:
parent
2e616ef008
commit
e6ec03fa96
|
|
@ -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
|
||||
```
|
||||
|
|
|
|||
5
bot.py
5
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
|
||||
|
|
|
|||
Loading…
Reference in New Issue