Skip to content

LibreLabUCM/teleg-api-bot

Repository files navigation

teleg-api-bot

Telegram Api for new bot system

Getting started

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.

Installation

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

Usage

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()

About

Telegram Api for new bot system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published