-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreply_buttons.py
More file actions
28 lines (17 loc) · 766 Bytes
/
reply_buttons.py
File metadata and controls
28 lines (17 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# adding ReplyKeyboardMarkup
# sends a message in the chat, we harcode replies according to "string" of keyboard messages
from telegram import Update, ReplyKeyboardMarkup
from telegram.ext import CommandHandler, ContextTypes, ApplicationBuilder
from dotenv import load_dotenv
import os
load_dotenv()
API = os.getenv("BOT_TOKEN")
async def sendkeybs(update: Update, context: ContextTypes.DEFAULT_TYPE):
send_keyboards = ReplyKeyboardMarkup([
["ReplyKeyb1", "ReplyKeyb2"],
["ReplyKeyb3 wide"]
], resize_keyboard=True)
await update.message.reply_text("Choose any buttons below:", reply_markup=send_keyboards)
app = ApplicationBuilder().token(API).build()
app.add_handler(CommandHandler("start", sendkeybs))
app.run_polling()