Telegram Bot for Cherrypy
python-telegram-bot support for cherrypy.
Installation
pip install marbaloo_telegram
Usage
For the simple way you can just send anything supported by python-telegram-bot,
# app.py
import marbaloo_telegram
import cherrypy
marbaloo_telegram.Plugin(cherrypy.engine, 'TOKEN').subscribe()
cherrypy.tools.telegram = marbaloo_telegram.Tool()
class Root(object):
@cherrypy.expose
def index(self):
bot = cherrypy.request.telegram_dp.bot
message = bot.sendMessage(text='TestMessage!', chat_id='38855883')
return message.text
root_path = os.path.dirname(__file__)
cherrypy.quickstart(Root(), '/', {
'/': {
'tools.telegram.on': True,
}
})
But if you want to use more interactive interface, you can get bot dispatcher from plugin and define your telegram controller after cherrypy.engine.start,
Metadata
Release files for marbaloo_telegram 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| marbaloo_telegram-0.1.0.tar.gz | 2.4 kB | Without provenance | Details for marbaloo_telegram-0.1.0.tar.gz |
Release files / marbaloo_telegram-0.1.0.tar.gz
| Download URL | marbaloo_telegram-0.1.0.tar.gz |
|---|---|
| Size | 2.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fb4b6f5b7ed40f5596dc8a39b77e9166586e38ce77f0ad98e7e9481487e0af91
|
|
BLAKE2b-256 checksum How to use checksums |
c3d667e5e6fe1b3a06d7568e2378f1f1f815c7e4454deadeb4dd5ac4572a44bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for marbaloo_telegram 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.