api to access soroush social network sdk
Project description
Soroush Messenger Bot Wrapper for Python
Dependencies
Python 2.7+
requests
sseclient-py
Installation
pip install soroush-python-sdk
Run the below commands
git clone https://github.com/soroush-app/bot-python-sdk
cd bot-python-sdk
pip install -r requirements.txt
Usage
from soroush_python_sdk import Client
bot_token = 'your bot token'
bot = Client(bot_token)
try:
to = 'user chat_id'
[error, success] = bot.send_text(to, 'Your text')
if success:
print('Message sent successfully')
else:
print('Sending message failed: {}' .format(error))
except Exception as e:
print(e.args[0])
“to” value in above example is chat_id of a bot user. You can find it in front of ‘from’ key in a message that user has sent to your bot. You can see more examples in the examples directory.
## Contribute ## Contributions to the package are always welcome! - Report any idea, bugs or issues you find on the issue tracker. - You can grab the source code at the package’s Git repository.
History
0.1.0 (2018-10-25)
First release on PyPI.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
soroush_python_sdk-0.2.3.tar.gz
(10.9 kB
view hashes)
Built Distribution
Close
Hashes for soroush_python_sdk-0.2.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ff25fb1e8bc3db7888e896481db83d92ee6c4c4f6aee991a17663e3c2e0eac2 |
|
MD5 | b6fc5c7f48510ec6d36d50ab3a2b8f0a |
|
BLAKE2b-256 | e6b62d2c29c94d76ce0e2bbe043ead741ddc3b8fbee20e963cc4e086d17e41bb |