.
#!/usr/bin/python3.5
import telebot
from flask import Flask, request
token = 'some_token_here'
sec = 'f5a403929s11d'
hhost = 'https://telegatest.pythonanywhere.com/' + sec
bot = telebot.TeleBot(token, threaded=False)
bot.remove_webhook()
bot.set_webhook(url=hhost)
app = Flask(__name__)
@app.route('/' + sec, methods=['POST'])
def webhook():
update = telebot.types.Update.de_json(request.stream.read().decode('utf-8'))
bot.process_new_updates([update])
return 'ok'
@bot.message_handler(commands=['help', 'start'])
def send_welcome(message):
bot.send_message(message.chat.id,"Hi there, I am EchoBot.\n""I am here to echo your kind words back to you.")
@bot.message_handler(func=lambda message: True, content_types=['text'])
def echo_message(message):
bot.reply_to(message, message.text)
A little mess with code sample, but code is ok, try not get triggered, sry =)
problem is here, error log shows me __init__()
got an unexpected keyword argument 'threaded'
but i installed telebot with pip also installed pytelegrambotapi, what could go wrong?
[edit by admin: formatting]