diff options
Diffstat (limited to 'bot.py')
-rw-r--r-- | bot.py | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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 | ||
76 | async def help_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: | 78 | async def help_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: |