F
F
FaFuChEG2019-07-02 19:54:08
Python
FaFuChEG, 2019-07-02 19:54:08

Something with Python?

import telebot


bot = telebot.TeleBot('820665615:AAGfd8DHNt0vacsEtrLNfmhAXjJO_8-rXdo')


@bot.message_handler(commands=['start'])
def start_message(message):
    bot.send_message(message.chat.id, 'Привет, ты написал мне /start')

@bot.message_handler(content_types=['text'])
def send_text(message):
    if message.text.lower() == 'привет':
        bot.send_message(message.chat.id, 'Привет, мой создатель')
    elif message.text.lower() == 'пока':
        bot.send_message(message.chat.id, 'Прощай, создатель')
    elif message.text.lower() == 'я тебя люблю':
        bot.send_sticker(message.chat.id, 'CAADAgADZgkAAnlc4gmfCor5YbYYRAI')

@bot.message_handler(content_types=['sticker'])
def sticker_id(message):
    print(message)

bot.polling()

I installed the telebot library, wrote the code and it doesn't work, I thought it was something with my code, I took the code from the net and still got the error:
Traceback (most recent call last):
File "C:/Users/Home-PC/PycharmProjects/ bot_kicker/venv/Include/bot", line 10, in
bot.polling()
AttributeError: 'TeleBot' object has no attribute 'polling'
Help!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2019-07-02
@AlexNineteen

1) The token was burned in vain
2) It is written:
Python has nothing to do with it
Maybe this will help:
bot.polling(none_stop=True)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question