easy telegram notification sender for both python and CLI
Project description
NoTel: Easy Telegram Notification sender for Python and CLI
NoTel is a simple Telegram notification sender written in Python 3. If you have your own bot token, you can just start using NoTel.
Installing NoTel
NoTel is hosted on PyPI. To install, run the following command in your Python environment:
$ pip install notel
$ notel --default_token [YOUR_TOKEN] --default_chat_id [YOUR_CHAT_ID]
If you don't know how to get your own bot token and your chat ID, please follow below links.
Also, please note that you should start a talk with your bot before sending messages through NoTel.
Make your own bot and get token
https://tutorials.botsfloor.com/creating-a-bot-using-the-telegram-bot-api-5d3caed3266d
Get your Telegram chat ID
https://bigone.zendesk.com/hc/en-us/articles/360008014894-How-to-get-the-Telegram-user-ID-
Using NoTel
Using NoTel in Command Line Interface
After you set default token and default chat ID, you can simply send Telegram notification with the command below.
$ notel -m Hello
Available arguments
- -h, --help show this help message and exit
- --set_default_id SET_DEFAULT_ID, -di SET_DEFAULT_ID set a default Telegram chat id for notel
- --set_default_token SET_DEFAULT_TOKEN, -dt SET_DEFAULT_TOKEN set a default Telegram token for notel
- --chat_id CHAT_ID, -i CHAT_ID set a Telegram chat id to send a message
- --token TOKEN, -t TOKEN set a Telegram bot token to send a message
- --message MESSAGE, -m MESSAGE a message to send to chat id
- --print_console PRINT_CONSOLE, -p PRINT_CONSOLE set notel to print to stdout
Using NoTel inside Python
NoTel can be imported as a module to be used directly in Python also.
from notel import tprint
tprint("Hello, world!")
Available arguments
- tprint(msg, token=None, chat_id=None, print_console=True)
- msg: The message you want to send.
- token: token of Telegram bot. If token is None, then the default_token will work.
- chat_id: Chat ID for the user who want to receive the message. If chat_id is None, then the default_chat_id will work.
- print_console: If print_console is False, tprint will not print msg in your console.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file NoTel-0.1a1-py3-none-any.whl
.
File metadata
- Download URL: NoTel-0.1a1-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.5.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6794baa391842537171d92a25afb248f2bc4fb7c3f5dfa17da870f64f3aadb9f |
|
MD5 | 6b6e65ec77a77a6071e203506bc88d86 |
|
BLAKE2b-256 | fba26d188207bcddea1b3ffa63b5a2f3a3d8d676043198f39728d8186c2dcae9 |