Telegram Api for new bot system
This project uses Python 3, so you should probably install that, if you haven't already.
For an introduction to the Telegram Bot API, take a look at our Getting Started wiki page.
You can get it from pip:
$ pip install teleg-api-bot
Or you can go ahead and clone this repo, and install it:
$ python setup.py install
Dependencies: Python 3.4, py-yaml, requests (see requirements-dev)
Example bot:
#!/usr/bin/env python3
from telegapi.telegbot import TelegBot
from telegapi.logger import Logger
logger = Logger()
import time, json
def receive_message(msg):
logger.msg(msg)
if msg["text"] == "/help":
bot.send_message(msg["chat"]["id"], "Text")
bot = TelegBot('TOKEN')
bot.on_receive_message = receive_message
bot.connect()
bot.run()