Skip to main content

Module to connect with communication app and send message

Project description

communication app bot

what is this

This project is amied to create a python package can easily send message to any communication app

Support telegram right now, fell free to let me know which app you want to have this function

Installing

pip3 install communicationAppModule

prerequisite

  • Telegram

create a bot via botfather to get a bot token

Create Client

# bot token only for telegram
# db_name optional
# log_file_name optional
from communicationApp import *
client = createClient('Telegram', bot_token ='', db_name ='', log_file_name='')

Send Message

# send single sentence
client.send_message("hi")

# send multi line
client.send_message(['hi','John', 'this is wayne'])

Send Photo

# send photo from url
client.send_photo({'photo_url': photo_url})

# send photo from telegram file id
client.send_photo({'file_id': file_id})

#send photo from file
file = open('path', 'rb')
client.send_photo({'file': file})

Get message

# send last response
client.get_response()

# get multi responses
client.get_response(10)

Response Format

{
"status_code": 200, 
"data": [{
    "user_info":{},
    "date": "timestamp",
    "text": "string"
    }],
"error": "string"
}

Change Log

0.1 (06/03/2022)

  • First Release

0.2.0 (10/04/2022)

  • add send photo feature

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

communicationAppModule-0.3.0.tar.gz (4.8 MB view details)

Uploaded Source

File details

Details for the file communicationAppModule-0.3.0.tar.gz.

File metadata

  • Download URL: communicationAppModule-0.3.0.tar.gz
  • Upload date:
  • Size: 4.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.2

File hashes

Hashes for communicationAppModule-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b0b1712c74df6ccfcd6885fa7b1d02efcadd6ea2d5693ff92281c76bf03b34d3
MD5 8000fd3aa74f6c68368d45f495395589
BLAKE2b-256 3e1c63fd7adb12062051ffabcd90c1e9fbcb3ed1c947f68b9cf8554c16dc29fc

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