Please answer these questions before submitting your issue. Thanks!
- What version of pyTelegramBotAPI are you using?
latest
- What OS are you using?
win
- What version of python are you using?
3.7
I would like to encapsulate the functionality as a class, but when I try I get some strange errors. How should I encapsulate them correctly?
`
class Start_Handler(object):
def __init__(self, bot = bot) -> None:
self.bot = bot
@bot.message_handler(commands = ['start'], content_types = ['text'], chat_types = ['private'])
def start_message(self, message):
bot.send_photo(
chat_id = message.from_user.id,
photo = InputFile("Bot/assest/logo.jpg"),
caption = f"*🥳 Congratulation, [_{message.from_user.first_name}_](tg://user?id={message.from_user.id}) has become a member of our\.*",
parse_mode = 'MarkdownV2'
)
`
Start_Handler(bot=bot).start_message()
TypeError: Start_Handler.start_message() missing 1 required positional argument: 'message'