randydev commited on
Commit
9d33254
Β·
verified Β·
1 Parent(s): d5cee92

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +40 -7
main.py CHANGED
@@ -54,7 +54,7 @@ Before making a fuss, make sure you understand the situation first. Answer prope
54
  """
55
 
56
  YOU_KEY_TEXT = """
57
- AkenoX API Key Generated
58
 
59
  πŸ”‘ **API Key:** <spoiler>{api_key}</spoiler>
60
 
@@ -173,8 +173,8 @@ async def cb_custom_key(client, query):
173
  ],
174
  [
175
  InlineKeyboardButton(
176
- "❌ Close",
177
- callback_data="close"
178
  )
179
  ]
180
  ]
@@ -202,8 +202,8 @@ async def cb_banned_and_key(client, query):
202
  [
203
  [
204
  InlineKeyboardButton(
205
- "❌ Back",
206
- callback_data="close"
207
  )
208
  ]
209
  ]
@@ -342,8 +342,8 @@ async def cb_new_revokekey(client, query):
342
  ],
343
  [
344
  InlineKeyboardButton(
345
- "❌ Back",
346
- callback_data="close"
347
  )
348
  ]
349
  ]
@@ -513,6 +513,33 @@ async def cb_new_key(client, query):
513
  )
514
  return await query.answer("Error: API key not generated, please try again.", True)
515
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
516
  @client.on_message(
517
  filters.incoming
518
  & filters.command("start")
@@ -526,6 +553,12 @@ async def welcome_start(client: Client, message: Message):
526
  text="πŸ†• Get API Key",
527
  callback_data="custom_key"
528
  )
 
 
 
 
 
 
529
  ]
530
  ]
531
  )
 
54
  """
55
 
56
  YOU_KEY_TEXT = """
57
+ API Key Generated
58
 
59
  πŸ”‘ **API Key:** <spoiler>{api_key}</spoiler>
60
 
 
173
  ],
174
  [
175
  InlineKeyboardButton(
176
+ "◀️ Back",
177
+ callback_data="back"
178
  )
179
  ]
180
  ]
 
202
  [
203
  [
204
  InlineKeyboardButton(
205
+ "◀️ Back",
206
+ callback_data="back"
207
  )
208
  ]
209
  ]
 
342
  ],
343
  [
344
  InlineKeyboardButton(
345
+ "◀️ Back",
346
+ callback_data="back"
347
  )
348
  ]
349
  ]
 
513
  )
514
  return await query.answer("Error: API key not generated, please try again.", True)
515
 
516
+ @client.on_callback_query(filters.regex("close"))
517
+ async def closed_button(client, query):
518
+ await query.message.delete()
519
+
520
+ @client.on_callback_query(filters.regex("back"))
521
+ async def back_menu(client, query):
522
+ keyboard = InlineKeyboardMarkup(
523
+ [
524
+ [
525
+ InlineKeyboardButton(
526
+ text="πŸ†• Get API Key",
527
+ callback_data="custom_key"
528
+ )
529
+ ],
530
+ [
531
+ InlineKeyboardButton(
532
+ text="πŸ“š Documentation",
533
+ url="https://github.com/TeamKillerX/Ryzenth"
534
+ )
535
+ ]
536
+ ]
537
+ )
538
+ return await query.edit_message_text(
539
+ f"Welcome {query.from_user.mention} to Ryzenth API.",
540
+ reply_markup=keyboard
541
+ )
542
+
543
  @client.on_message(
544
  filters.incoming
545
  & filters.command("start")
 
553
  text="πŸ†• Get API Key",
554
  callback_data="custom_key"
555
  )
556
+ ],
557
+ [
558
+ InlineKeyboardButton(
559
+ text="πŸ“š Documentation",
560
+ url="https://github.com/TeamKillerX/Ryzenth"
561
+ )
562
  ]
563
  ]
564
  )