Skip to content

Mr-TelegramBot/tgclient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tgclient

Telegram Api Client

Getting Started

Install

git clone https://github.com/MrMahdi313/tgclient
cd tgclient 
python setup.py install

or 

pip install git+https://github.com/MrMahdi313/tgclient

getupdates example

from tgclient import *

bot = TelegramBot("245100736:AAGpgrDLt1YNwsQxxxxxxxxxxxxxxxxxxxx")


@bot.message("text")
def text(message):
    print(message)
    # {'message_id': 6577, 'from': {'id': 68747297, ... ...

bot.run()

command handler

from tgclient import *

bot = TelegramBot("245100736:AAGpgrDLt1YNwsQxxxxxxxxxxxxxxxxxxxx")


@bot.command(r'^(/echo) (.*)')
def text(message, args):
    # args[2] two argument of command
    bot.sendMessage(message['chat']['id'], args[1])

bot.run()

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages