A
A
Arthur2021-06-22 10:35:30
Python
Arthur, 2021-06-22 10:35:30

Does a bot in telegram in python give an error?

Such bullshit

import telebot
from telebot import types

bot = telebot.Telebot('ТУТ МОЙ ТОКЕН')

@bot.message_handler(content_types=['text'])
def buttons(message):
  markup = types.KeyboardMarkup (resize_keyboard = True)

  butt1 = types.KeyboardButton ('ПОЛУЧИТЬ ДЕНЬГИ')
  butt2 = types.KeyboardButton ('БОНУС')
  markup.add(butt1, butt2)

  if message.text == "ПОЛУЧИТЬ ДЕНЬГИ":
    bot.send_message(message.chat.id, 'Подпищись на наш канал @telegram')
  elif message.text == "БОНУС":
    bot.send_message(message.chat.id, 'Бонусов нету (')
bot.polling(none_stop = True)


Here is the error:
Traceback (most recent call last):
File "C:\Users\User\Downloads\dfgdfg.py", line 4, in
bot = telebot.Telebot('TOKEN HERE')
AttributeError: module 'telebot' has no attribute 'Telebot'
>>>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav Lyskov, 2021-06-22
@TellS

not a
bot = telebot.Telebot('ТУТ МОЙ ТОКЕН')
bot = telebot.TeleBot('ТУТ МОЙ ТОКЕН')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question