0
テレポットを使って私の最初のテレグラムロボットをビルドしようとしています。 私は会話をコマンドでルーティングしたいので、Telepot Helper Routerのドキュメントを読んだことがありますが、どのように使用できるのか分かりません。テレポトエラーヘルパールータ: 'module'オブジェクトに 'router'属性がありません
はこれまでのところ、私が持っている:
私は、このエラー与えimport telepot
from telepot.routing import by_chat_command
def on_site(chat_id,msg):
#function code
def on_tick(chat:id,msg):
#function code
def on_start(chat_id,msg):
#function code
r = telepot.helper.router(by_chat_command(), {'site': on_site , 'tick':on_tick , 'start':on_start })
bot.routing_table['text']=r.route
bot = telepot.Bot('TOKEN')
bot.message_loop()
print ('Listening....')
#LOOP
while 1:
time.sleep(10)
:
r = telepot.helper.router(by_chat_command(), {'site': on_site , 'tick':on_tick , 'start':on_start })
私が間違って何をしました:行に
AttributeError: 'module' object has no attribute 'router'
を?