bot commited on
Commit
e1d3a17
·
1 Parent(s): 006b713
Files changed (1) hide show
  1. main.py +12 -39
main.py CHANGED
@@ -150,44 +150,18 @@ TG_BASE_URL = "https://tg.alist.dpdns.org/bot"
150
 
151
  ###################TG机器人功能区###################
152
  # 定义命令处理函数
153
- # async def start(update: Update, context):
154
- # commands = (
155
- # "🚀欢迎使用我的机器人!\n\n"
156
- # "📋可用命令:\n"
157
- # "•直接发送magent:开的关磁力将直接离线下载\n"
158
- # "•/tasks - 查看下载任务\n"
159
- # "•/files - 查看文件列表\n"
160
- # "•/quota - 查看存储空间\n"
161
- # "•/emptytrash - 清空回收站\n"
162
- # "•/help - 获取帮助信息\n"
163
- # )
164
- # await update.message.reply_text(commands)
165
-
166
-
167
- async def start(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
168
- """Sends a message with three inline buttons attached."""
169
- keyboard = [
170
- [
171
- InlineKeyboardButton("Option 1", callback_data="1"),
172
- InlineKeyboardButton("Option 2", callback_data="2"),
173
- ],
174
- [InlineKeyboardButton("Option 3", callback_data="3")],
175
- ]
176
-
177
- reply_markup = InlineKeyboardMarkup(keyboard)
178
-
179
- await update.message.reply_text("Please choose:", reply_markup=reply_markup)
180
-
181
-
182
- async def button(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
183
- """Parses the CallbackQuery and updates the message text."""
184
- query = update.callback_query
185
-
186
- # CallbackQueries need to be answered, even if no notification to the user is needed
187
- # Some clients may have trouble otherwise. See https://core.telegram.org/bots/api#callbackquery
188
- await query.answer()
189
-
190
- await query.edit_message_text(text=f"Selected option: {query.data}")
191
 
192
 
193
  async def help(update: Update, context):
@@ -433,7 +407,6 @@ async def init_client():
433
  TG_BOT_APPLICATION.add_handler(
434
  CallbackQueryHandler(handle_task_confirmation, pattern="^confirm_task")
435
  )
436
- TG_BOT_APPLICATION.add_handler(CallbackQueryHandler(button))
437
  TG_BOT_APPLICATION.add_handler(CommandHandler("start", start))
438
  TG_BOT_APPLICATION.add_handler(CommandHandler("help", help))
439
  TG_BOT_APPLICATION.add_handler(CommandHandler("quota", quota))
 
150
 
151
  ###################TG机器人功能区###################
152
  # 定义命令处理函数
153
+ async def start(update: Update, context):
154
+ commands = (
155
+ "🚀欢迎使用我的机器人!\n\n"
156
+ "📋可用命令:\n"
157
+ "•直接发送magent:开的关磁力将直接离线下载\n"
158
+ "•/tasks - 查看下载任务\n"
159
+ "•/files - 查看文件列表\n"
160
+ "•/quota - 查看存储空间\n"
161
+ "•/emptytrash - 清空回收站\n"
162
+ "•/help - 获取帮助信息\n"
163
+ )
164
+ await update.message.reply_text(commands)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
 
166
 
167
  async def help(update: Update, context):
 
407
  TG_BOT_APPLICATION.add_handler(
408
  CallbackQueryHandler(handle_task_confirmation, pattern="^confirm_task")
409
  )
 
410
  TG_BOT_APPLICATION.add_handler(CommandHandler("start", start))
411
  TG_BOT_APPLICATION.add_handler(CommandHandler("help", help))
412
  TG_BOT_APPLICATION.add_handler(CommandHandler("quota", quota))