Skip to content

alex3d/pytbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Easy to use python telegram bot api

Echo bot example

import pytbot

class EchoBot(pytbot.Bot):
    @pytbot.command()
    def echo(self, msg):
        self.api.send_message(msg["text"])

api = pytbot.Api("%API_TOKEN%")
pytbot.run(api, EchoBot)

Examples

Features

  • Wizard bots ("yield")
   @pytbot.command()
   def join(self, msg):
       self.api.send_message('Enter first string:')
       first = (yield True)['text']
       self.api.send_message('Enter second string:')
       second = (yield True)['text']
       self.api.send_message(first+second)
  • Automatic "help" command generation
  • Connection pool / keepalive

About

Python Telegram Bot Api

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages