Ketab
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 90/100
Research direction
The issue contains a hardcoded bot token in the code. Look for the TOKEN variable in the provided script and replace it with a secure method, such as reading from an environment variable. Check the repository for existing configuration patterns or a .env.example file. After the change, verify the bot still starts and responds to the /start command.
Written by the indexing model from the issue text.
Description
from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup
from telegram.ext import (
ApplicationBuilder,
CommandHandler,
CallbackQueryHandler,
ContextTypes
)
TOKEN = "8739806734:AAGhzCLG45DWV6jMHAkbN4Ku-jOVBM0vKHQ"
استارت
async def start(update: Update, context: ContextTypes.DEFAULT_TYPE):
keyboard = [
[InlineKeyboardButton("📚 خدمات کتاب", callback_data="books")]
]
await update.message.reply_text(
"به فروشگاه کتاب خوش آمدید:",
reply_markup=InlineKeyboardMarkup(keyboard)
)
دکمهها
async def button(update: Update, context: ContextTypes.DEFAULT_TYPE):
query = update.callback_query
await query.answer()
if query.data == "books":
keyboard = [
[InlineKeyboardButton("📘 کتاب روانشناسی", callback_data="book1")],
[InlineKeyboardButton("📗 کتاب اطلس خدا", callback_data="book2")],
[InlineKeyboardButton("📕 روانشناسی جلد ۳۱", callback_data="book3")]
]
await query.edit_message_text(
"کتاب مورد نظر را انتخاب کنید:",
reply_markup=InlineKeyboardMarkup(keyboard)
)
elif query.data == "book1":
await query.edit_message_text(
"📘 کتاب روانشناسی\n💰 قیمت: 800,000 تومان"
)
elif query.data == "book2":
await query.edit_message_text(
"📗 کتاب از من خدا\n💰 قیمت: 900,000 تومان"
)
elif query.data == "book3":
await query.edit_message_text(
"📕 کتاب روانشناسی جلد ۳۱\n💰 قیمت: 900,000 تومان"
)
app = ApplicationBuilder().token(TOKEN).build()
app.add_handler(CommandHandler("start", start))
app.add_handler(CallbackQueryHandler(button))
app.run_polling()
- Dominant language
- Python
- Stars
- 225
- Forks
- 672
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AbirHasan2005/PyroFilesStoreBot
-
bot.py Open
Difficulty 3/5 1-2 days Newbie friendliness 30/100
AbirHasan2005/PyroFilesStoreBot#69 · 1 comment ·
-
requirements.txt Open
Difficulty 1/5 Under an hour Newbie friendliness 20/100
-
bot.py Open
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
bot.py Open
Difficulty 5/5 Over a week Newbie friendliness 10/100
-
requirements.txt Open
Difficulty 1/5 Under an hour Newbie friendliness 10/100
All issues in AbirHasan2005/PyroFilesStoreBot
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100