Skip to content
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

Update send_message() README documentation to reflect ability to start a new chat #92

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ Get a member's details.
### get_messages()
Get all your messages.

### send_message(chat_id, text)
Send a message with content `text` in a specific chat with id `chat_id`.
### send_message(text, user=None, group_uid=None, chat_id=None)
Send a message with content `text`.
Either specify an existing `chat_id`, or both `user` and `group_uid` for a new chat.

## Example scripts

Expand Down
5 changes: 4 additions & 1 deletion spond/spond.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ async def _continue_chat(self, chat_id, text):

async def send_message(self, text, user=None, group_uid=None, chat_id=None):
"""
Starts a new chat or continue old one.
Start a new chat or continue an existing one.

If `chat_id`of an existing chat is specified, message continues that chat.
Otherwise, both `user` and `group_uid` must be specified, and the message starts a new chat.

Parameters
----------
Expand Down