telegramapi/README.md

40 lines
655 B
Markdown
Raw Normal View History

2021-07-06 10:40:36 +00:00
# Telegram Python Example
2021-07-08 11:11:13 +00:00
This is designed for MicroPython but will work on a desktop
2021-07-06 10:40:36 +00:00
It'll echo what you send to it
## Setup
2021-07-06 10:53:12 +00:00
```pip3 install pipenv```
2021-05-29 08:53:09 +00:00
2021-07-06 10:30:51 +00:00
```pipenv sync```
```cp config.json.sample config.json```
2021-07-06 10:40:36 +00:00
2021-07-06 10:30:51 +00:00
Create a Telegram account if you don't have one
https://telegram.org/
2021-07-06 10:40:36 +00:00
## Setup Bot
2021-07-06 10:30:51 +00:00
Search users for ```BotFather```
Type ```/newbot``` and follow the prompts
2021-07-06 10:40:36 +00:00
Take the token under ```Use this token to access the HTTP API:``` and put it into config.json
2021-07-06 10:30:51 +00:00
2021-07-06 10:40:36 +00:00
## Get User Id
2021-07-06 10:30:51 +00:00
Search users for ```userinfobot @userinfobot```
2021-07-06 10:40:36 +00:00
Put your id in config.json
## Run
2021-07-06 10:30:51 +00:00
```pipenv run prod```
2021-07-08 11:11:13 +00:00
## MicroPython
TODO
see ```up.py``` and ```boot.py```