randydev commited on
Commit
fee2d9d
1 Parent(s): 1859e58

Upload 2 files

Browse files
StringSessionBot/callbacks.py CHANGED
@@ -21,6 +21,8 @@ async def _callbacks(bot: Client, callback_query: CallbackQuery):
21
  text=Data.START.format(callback_query.from_user.mention, mention),
22
  reply_markup=InlineKeyboardMarkup(Data.buttons),
23
  )
 
 
24
  elif query == "about":
25
  chat_id = callback_query.from_user.id
26
  message_id = callback_query.message.id
 
21
  text=Data.START.format(callback_query.from_user.mention, mention),
22
  reply_markup=InlineKeyboardMarkup(Data.buttons),
23
  )
24
+ elif query == "close":
25
+ await callback_query.message.delete()
26
  elif query == "about":
27
  chat_id = callback_query.from_user.id
28
  message_id = callback_query.message.id
StringSessionBot/generate.py CHANGED
@@ -34,10 +34,6 @@ ERROR_MESSAGE = "Oops! An exception occurred! \n\n**Error** : {} " \
34
  "sensitive information and you if want to report this as " \
35
  "this error message is not being logged by us!"
36
 
37
- @Client.on_callback_query(filters.regex("^close"))
38
- async def _close(_, cb: CallbackQuery):
39
- await cb.message.delete()
40
-
41
  @Client.on_message(filters.private & filters.command('generate'))
42
  async def main(_, msg):
43
  await msg.reply(
@@ -52,7 +48,6 @@ async def main(_, msg):
52
  )
53
  )
54
 
55
-
56
  async def generate_session(bot, msg, telethon=False):
57
  await msg.reply("Starting {} Session Generation...".format("Telethon" if telethon else "Pyrogram"))
58
  user_id = msg.chat.id
@@ -133,6 +128,12 @@ async def generate_session(bot, msg, telethon=False):
133
  text = "**{} STRING SESSION** \n\n`{}` \n\nGenerated by @RendyProjects".format("TELETHON" if telethon else "PYROGRAM", string_session)
134
  close_bttn = InlineKeyboardMarkup(
135
  [
 
 
 
 
 
 
136
  [
137
  InlineKeyboardButton(
138
  text="Close",
@@ -161,4 +162,4 @@ async def cancelled(msg):
161
  await msg.reply("Cancel generation process!", quote=True)
162
  return True
163
  else:
164
- return False
 
34
  "sensitive information and you if want to report this as " \
35
  "this error message is not being logged by us!"
36
 
 
 
 
 
37
  @Client.on_message(filters.private & filters.command('generate'))
38
  async def main(_, msg):
39
  await msg.reply(
 
48
  )
49
  )
50
 
 
51
  async def generate_session(bot, msg, telethon=False):
52
  await msg.reply("Starting {} Session Generation...".format("Telethon" if telethon else "Pyrogram"))
53
  user_id = msg.chat.id
 
128
  text = "**{} STRING SESSION** \n\n`{}` \n\nGenerated by @RendyProjects".format("TELETHON" if telethon else "PYROGRAM", string_session)
129
  close_bttn = InlineKeyboardMarkup(
130
  [
131
+ [
132
+ InlineKeyboardButton(
133
+ text="Click Me",
134
+ url=f"tg://openmessage?user_id={user_id}"
135
+ )
136
+ ],
137
  [
138
  InlineKeyboardButton(
139
  text="Close",
 
162
  await msg.reply("Cancel generation process!", quote=True)
163
  return True
164
  else:
165
+ return False