Build reusable bot framework
This commit is contained in:
13
bot/context.py
Normal file
13
bot/context.py
Normal file
@@ -0,0 +1,13 @@
|
||||
"""Platform-neutral command context exposed to feature handlers."""
|
||||
|
||||
|
||||
class CommandContext:
|
||||
def __init__(self, message, api_client):
|
||||
self._message = message
|
||||
self.api = api_client
|
||||
self.user_uuid = api_client.user_uuid
|
||||
self.discord_user_id = str(message.author.id)
|
||||
self.timezone = api_client.timezone
|
||||
|
||||
async def reply(self, content):
|
||||
return await self._message.channel.send(content)
|
||||
Reference in New Issue
Block a user