Skip to content

MaximilianClemens/pyTelegram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Telegram Bot

Simple Telegram Bot Library, example:

import telegram

token = '0123456789:YourToken'
bot = telegram.Bot(token)

# Register Commands
@bot.command('/start', 'Hello World')
async def start(conversation):
    conversation.send('Hello World!')

@bot.command('/name', 'What\'s your Name?')
async def name(conversation):
    conversation.send('What\'s your Name?')
    while True:
        response = await asyncio.create_task(conversation.get_response())
        if response.text:
            conversation.send(f'Hello {response.text}')
            break
        else:
            conversation.send('Please enter your Name.')

bot.update_commands()

# Run it..
bot.start()

Image of Sample

Install

pip install requests
pip install git+https://github.com/MaximilianClemens/pytelegram.git

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages