aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'command.py')
-rw-r--r--command.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/command.py b/command.py
new file mode 100644
index 0000000..753b0a2
--- /dev/null
+++ b/command.py
@@ -0,0 +1,33 @@
1from config import *
2
3from telegram import __version__ as TG_VER
4from typing import cast, List
5from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update, ReplyKeyboardMarkup, KeyboardButton
6from telegram.ext import Application, CallbackQueryHandler, CommandHandler, ContextTypes, MessageHandler, filters, \
7 ConversationHandler, CallbackContext
8from telegram.constants import ParseMode, ChatAction
9from telegram.error import BadRequest
10from telegram import InlineKeyboardButton, InlineKeyboardMarkup, ReplyKeyboardRemove
11
12
13async def start_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> int:
14 hello = "Hello, this is `checkin.bot`. \n\n" \
15 "This is a Telegram bot with functionality similar to Foursquare Swarm, " \
16 "but check in and post your location to the Fediverse (Mastodon/Pleroma) instead of Twitter.\n\n" \
17 "Aware of privacy concerns, this bot will not store your location data." \
18 "*Be safe and cautious when sharing your real time location on the web.* \n\n" \
19 "Start using this bot by sharing your location using Telegram context menu to it."
20
21 await update.message.reply_text(hello, parse_mode=ParseMode.MARKDOWN)
22 await update.message.reply_text(PROMPT_CHOOSE_ACTION, reply_markup=MAIN_MENU)
23
24 return WAIT_LOCATION
25
26
27async def help_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
28 await update.message.reply_text(PROMPT_HELP)
29
30
31async def cancel_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> int:
32 await update.message.reply_text(text=PROMPT_CANCELED, reply_markup=MAIN_MENU)
33 return ConversationHandler.END
Powered by cgit v1.2.3 (git 2.41.0)