Browse Source
Added docstring to open_dm()
Added docstring explaining usage with an example
pull/95/head
Jaimyn Mayer
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
0 deletions
-
disco/types/user.py
|
|
@ -46,6 +46,13 @@ class User(SlottedModel, with_equality('id'), with_hash('id')): |
|
|
|
return '<@{}>'.format(self.id) |
|
|
|
|
|
|
|
def open_dm(self): |
|
|
|
""" |
|
|
|
Opens a dm channel to allow the bot to dm users. See `client.api.users_me_dms_create()` for more information. |
|
|
|
Example: `user.open_dm().send_message('Hi there!')` |
|
|
|
Returns |
|
|
|
------- |
|
|
|
`disco.types.channel` |
|
|
|
""" |
|
|
|
return self.client.api.users_me_dms_create(self.id) |
|
|
|
|
|
|
|
def __str__(self): |
|
|
|