1
0
Fork 0
mirror of https://gitlab.com/oloturia/fumcaso.git synced 2025-01-06 21:47:17 +01:00

compatible with v.13.1.1 of python-telegram

This commit is contained in:
oloturia 2023-02-16 19:16:56 +01:00
parent 24f5f4c8cc
commit 5c9473fcc9

View file

@ -7,13 +7,13 @@ import os
fileDir = os.path.dirname(os.path.abspath(__file__))
fileDir = fileDir +"/"
def newStrip(bot, update, args):
config = readConfig(platform="telegram",profile=args)
def newStrip(update, context):
config = readConfig(platform="telegram",profile=context.args)
status = createStrip(config)
if status == 0:
try:
strip_file=open(config["saveLocation"]+config["filename"],"rb")
bot.send_photo(chat_id=update.message.chat_id,photo=strip_file)
context.bot.send_photo(chat_id=update.message.chat_id,photo=strip_file)
strip_file.close()
os.remove(config["saveLocation"]+config["filename"])
except Exception as err:
@ -27,7 +27,7 @@ if __name__ == "__main__":
with open(config["token"]) as token_file:
content = token_file.readlines()
token = content[0].strip()
updater = Updater(token)
updater = Updater(token, use_context=True)
dp = updater.dispatcher
dp.add_handler(CommandHandler('strip',newStrip, pass_args=True))
updater.start_polling()