Ver código fonte

Fixed Telegram bot

itec 4 anos atrás
pai
commit
42a5e6f7bb
1 arquivos alterados com 3 adições e 3 exclusões
  1. 3 3
      playlistalo.py

+ 3 - 3
playlistalo.py

@@ -250,7 +250,7 @@ def getposition(file):
 
 
 
-def __msg_parser(bot, update):
+def __telegram_msg_parser(bot, update):
     print("Messaggio ricevuto")
     urlz = update.message.text
     u = update.message.from_user
@@ -264,7 +264,7 @@ def __msg_parser(bot, update):
     for url in [s for s in urlz.splitlines() if s.strip() != ""]:
         #update.message.reply_text("Scarico %s" %(url))
         # start the download
-        dl = playlistalo.add(url, user)
+        dl = add(url, user)
         update.message.reply_text(dl)
 
 def telegram_bot():
@@ -274,7 +274,7 @@ def telegram_bot():
     # Get the dispatcher to register handlers
     dp = updater.dispatcher
     # parse message
-    dp.add_handler(MessageHandler(Filters.text, __msg_parser))
+    dp.add_handler(MessageHandler(Filters.text, __telegram_msg_parser))
     # Start the Bot
     updater.start_polling()
     # Run the bot until you press Ctrl-C