aboutsummaryrefslogtreecommitdiff
path: root/bot.py
diff options
context:
space:
mode:
authorclarkzjw <[email protected]>2023-02-20 13:58:01 -0800
committerclarkzjw <[email protected]>2023-02-20 13:58:01 -0800
commit88ad58c3d3412162ffdeb96f49b789e7976cad07 (patch)
tree2aa451f8e64da94b34e71ed9b9c43fcba1f4b39e /bot.py
parentf927324709d639adfcd5487c7740e3d60f2246b8 (diff)
downloadswarm2fediverse-88ad58c3d3412162ffdeb96f49b789e7976cad07.tar.gz
minor reformatting
Diffstat (limited to 'bot.py')
-rw-r--r--bot.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/bot.py b/bot.py
index 398e433..7679d7f 100644
--- a/bot.py
+++ b/bot.py
@@ -41,8 +41,8 @@ async def start(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
41 hello = "Hello, this is `checkin.bot`. \n\n" \ 41 hello = "Hello, this is `checkin.bot`. \n\n" \
42 "This is a Telegram bot with functionality similar to Foursquare Swarm, " \ 42 "This is a Telegram bot with functionality similar to Foursquare Swarm, " \
43 "but check in and post your location to the Fediverse (Mastodon/Pleroma) instead of Twitter.\n\n" \ 43 "but check in and post your location to the Fediverse (Mastodon/Pleroma) instead of Twitter.\n\n" \
44 "Aware of privacy concerns, this bot will not store your location data."\ 44 "Aware of privacy concerns, this bot will not store your location data." \
45 "*Be safe and cautious when sharing your real time location on the web.* \n\n"\ 45 "*Be safe and cautious when sharing your real time location on the web.* \n\n" \
46 "Start using this bot by sharing your location using Telegram context menu to it." 46 "Start using this bot by sharing your location using Telegram context menu to it."
47 47
48 await update.message.reply_text(hello, parse_mode=telegram.constants.ParseMode.MARKDOWN) 48 await update.message.reply_text(hello, parse_mode=telegram.constants.ParseMode.MARKDOWN)
@@ -67,10 +67,12 @@ async def button(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
67 await query.answer() 67 await query.answer()
68 poi = get_loc(query.data) 68 poi = get_loc(query.data)
69 69
70 mastodon_client.status_post(f"I'm at {poi['name']} in {poi['locality']}, {poi['region']}, \n[OSM]({poi['osm_url']})", 70 status = mastodon_client.status_post(
71 visibility="private") 71 f"I'm at {poi['name']} in {poi['locality']}, {poi['region']}, {poi['osm_url']}",
72 visibility="private")
72 73
73 await query.edit_message_text(text=f"Selected option: {poi}") 74 await query.edit_message_text(text=f"Selected place: {poi['name']}\nPosted to Mastodon: {status['url']}",
75 parse_mode=telegram.constants.ParseMode.MARKDOWN)
74 76
75 77
76async def help_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: 78async def help_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
Powered by cgit v1.2.3 (git 2.41.0)