[Change] bugFix

master
Marcel Eggert 4 years ago
parent 27b89b4fe5
commit bc2499a0c1
  1. 14
      main-azraelis.py

@ -551,10 +551,14 @@ def publishBannerInChannel(update: Update, context: CallbackContext, daten):
# https://umap.openstreetmap.de/de/map/r3f1zul-on-tour_19893?feature=xmas%20panda#18/53.50648/13.74733
t = daten['bannerInfos']['titel'].replace(" ", "%20")
place = f"{daten['bannerInfos']['formattedAddress']['place']}, {daten['bannerInfos']['formattedAddress']['country']}"
#place = f"Orainienburg, Deutschalnd"
link = f"https://umap.openstreetmap.de/de/map/r3f1zul-on-tour_19893?feature={t}#18/{daten['bannerInfos']['startLatitude']}/{daten['bannerInfos']['startLongitude']}"
text = f"""<b>{daten['bannerInfos']['titel']}</b>\n\n<b>Banner-Nr:</b> {daten['bannerInfos']['nummer']}\n<b>Unique Mission Completed:</b> {daten['bannerInfos']['completed']} (+{daten['bannerInfos']['missions']})\n<b>Place:</b> {place}\n\n<a href="{link}">MAP</a>\n"""
place = f", "
link = f"https://umap.openstreetmap.de/de/map/spec-ops_21235?feature={t}#18/{daten['bannerInfos']['startLatitude']}/{daten['bannerInfos']['startLongitude']}"
text = f"""<b>{daten['bannerInfos']['titel']}</b>\n\n<b>Banner-Nr:</b> \n<b>Unique Mission Completed:</b> (+)\n<b>Place:</b> {place}\n\n<a href="{link}">MAP</a>\n"""
if daten['bannerInfos']['bg-link'] is None:
text = f"""Banner: {daten['bannerInfos']['nummer']}\nName: <b>{daten['bannerInfos']['titel']}</b>\nMission: {daten['bannerInfos']['missions']}\nCountry: {daten['bannerInfos']['formattedAddress']['country']}\nCity: {daten['bannerInfos']['formattedAddress']['place']}\nLink: <a href="{link}">MAP</a>\n\nTotal: {daten['bannerInfos']['completed']}"""
else:
text = f"""Banner: {str(daten['bannerInfos']['nummer']).rjust(3, '0')}\nName: <b>{daten['bannerInfos']['titel']}</b>\nMission: {daten['bannerInfos']['missions']}\nCountry: {daten['bannerInfos']['formattedAddress']['country']}\nCity: {daten['bannerInfos']['formattedAddress']['place']}\nLinks: <a href="{link}">MAP</a> <a href="{daten['bannerInfos']['bg-link']}">Bannergress</a>\n\nTotal: {daten['bannerInfos']['completed']}"""
print()
@ -564,7 +568,7 @@ def publishBannerInChannel(update: Update, context: CallbackContext, daten):
# text = text.replace(".", "\.")
# msg = escape_markdown(text, version=2)
context.bot.send_photo("@r3f1sworld", photo=open(daten['bannerInfos']['file_path'], 'rb'), caption=text, parse_mode=ParseMode.HTML, protect_content=True)
context.bot.send_photo("@KnallfroschOnTour", photo=open(daten['bannerInfos']['file_path'], 'rb'), caption=text, parse_mode=ParseMode.HTML)
update.message.reply_text("Fertig")

Loading…
Cancel
Save