-
Notifications
You must be signed in to change notification settings - Fork 6
Added ability to send DMs #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@@ -88,7 +90,16 @@ async def send_text_to_room( | |||
logger.exception(f"Unable to send message response to {room_id}") | |||
return f"Failed to send message: {ex}" | |||
|
|||
|
|||
async def get_dm(client: AsyncClient, user: str): | |||
room_id = self.store.get_dm(user_id=user) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self
wont be defined here, and neither will be store
. So you also need to pass in store
to this function. Which may be tricky, as the send_text_to_room
doesn't know about store
either.
Possibly move this logic to Command._message
(
middleman/middleman/bot_commands.py
Line 80 in a0e20a2
async def _message(self): |
self.store
, and then you can pass in the right room ID to send_text_to_room
? I think logically this is the right way to do it anyway, send_text_to_room
is just a helper, _message
is the method that processes the "message" command.
Additionally, we need to ensure that the room ID is removed from |
Co-authored-by: Jason Robinson <[email protected]>
Co-authored-by: Jason Robinson <[email protected]>
Co-authored-by: Jason Robinson <[email protected]>
Co-authored-by: Jason Robinson <[email protected]>
Co-authored-by: Jason Robinson <[email protected]>
Co-authored-by: Jason Robinson <[email protected]>
Co-authored-by: Jason Robinson <[email protected]>
Sorry, I accidentally clicked the button :) |
Added ability to send DMs, if DM room does not exist, create new.