Skip to main content

api to access soroush social network sdk

Project description

Soroush Messenger Bot Wrapper for Python shiled travis badge Documentation Status Updates

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.4.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

soroush_python_sdk-0.2.4-py2.py3-none-any.whl (6.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file soroush_python_sdk-0.2.4.tar.gz.

File metadata

  • Download URL: soroush_python_sdk-0.2.4.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for soroush_python_sdk-0.2.4.tar.gz
Algorithm Hash digest
SHA256 46630e531a75ff8c13c4afcfa959379a8d462a7952e628448010c7d45ff50909
MD5 455b9dc7f06d1911a4bca784c2382303
BLAKE2b-256 855b08aa1d539a9adb2c9e6032de8af0406f93bf3a5252488a0b85382f1b0195

See more details on using hashes here.

File details

Details for the file soroush_python_sdk-0.2.4-py2.py3-none-any.whl.

File metadata

  • Download URL: soroush_python_sdk-0.2.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for soroush_python_sdk-0.2.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 01ac7f290088d6a8303b775f43f18db29dd18d858ee802154b6960c7c0d27ba9
MD5 df37152db1daf36270d363d5b33398f1
BLAKE2b-256 da4b9f0d642ed5dfdcd68d1218fc220238236adf8591007d190d405d5c08e70d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page