DEV Community

Discussion on: Making Telegram Bots with Python

Collapse
 
mlazzarotto profile image
mlazzarotto

Can I use python-telegram-bot inside a class?

I would like to create a TgBot class and create the bot inside this class

Collapse
 
tbhaxor profile image
Gurkirat Singh

Yes, you can use these call back functions in the class as well. All you have to do is use self.methodName and in class it should have def methodName(self, update, context)