'How do I fix the problem with the telebot? [closed]

Code:

#!/usr/bin/python3

import commands

import telebot

import CONFIGS

# bot token
bot = telebot. TeleBot('CONFIGS.token')


@bot.message_handler(commands=['start'])
def start(message):
    bot.send_message(message.chat.id, 'TEXT', parser_mode='html')


bot.polling(none_stop=True)

Error:

bot = telebot. TeleBot('CONFIGS.token')
AttributeError: module 'telebot' has no attribute 'TeleBot'



Solution 1:[1]

  1. Ensure you have the correct telebot library (pip install pyTelegramBotAPI)
  2. Remove the space between telebot. and TeleBot in bot = telebot. TeleBot('CONFIGS.token')
  3. Refer to the documentation (https://github.com/eternnoir/pyTelegramBotAPI)
  4. If you still have the same issue, open an issue on the GitHub repository.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 halfer