BinaryONe
commited on
Commit
·
c91f3ea
1
Parent(s):
93866aa
DB Changes
Browse files
FileStream/bot/plugins/FileHandlers/callback.py
CHANGED
@@ -75,8 +75,7 @@ async def cb_data(bot: Client, update: CallbackQuery):
|
|
75 |
await asyncio.sleep(e.value)
|
76 |
await FileStream.send_message(
|
77 |
chat_id=Telegram.ULOG_GROUP,
|
78 |
-
text=
|
79 |
-
f"Gᴏᴛ FʟᴏᴏᴅWᴀɪᴛ ᴏғ {str(e.value)}s ғʀᴏᴍ [{message.from_user.first_name}](tg://user?id={message.from_user.id})\n\n**ᴜsᴇʀ ɪᴅ :** `{str(message.from_user.id)}`",
|
80 |
disable_web_page_preview=True,
|
81 |
parse_mode=ParseMode.MARKDOWN)
|
82 |
|
@@ -84,10 +83,8 @@ async def cb_data(bot: Client, update: CallbackQuery):
|
|
84 |
await update.message.edit_caption(
|
85 |
caption="**Cᴏɴғɪʀᴍ ʏᴏᴜ ᴡᴀɴᴛ ᴛᴏ ᴅᴇʟᴇᴛᴇ ᴛʜᴇ Fɪʟᴇ**\n\n",
|
86 |
reply_markup=InlineKeyboardMarkup([[
|
87 |
-
InlineKeyboardButton(
|
88 |
-
|
89 |
-
InlineKeyboardButton(
|
90 |
-
"ɴᴏ", callback_data=f"myfile_{usr_cmd[1]}_{usr_cmd[2]}")
|
91 |
]]))
|
92 |
|
93 |
elif usr_cmd[0] == "msgdelyes":
|
@@ -98,10 +95,8 @@ async def cb_data(bot: Client, update: CallbackQuery):
|
|
98 |
await update.message.edit_caption(
|
99 |
caption="**Cᴏɴғɪʀᴍ ʏᴏᴜ ᴡᴀɴᴛ ᴛᴏ ᴅᴇʟᴇᴛᴇ ᴛʜᴇ Fɪʟᴇ**\n\n",
|
100 |
reply_markup=InlineKeyboardMarkup([[
|
101 |
-
InlineKeyboardButton("ʏᴇs",
|
102 |
-
|
103 |
-
InlineKeyboardButton("ɴᴏ",
|
104 |
-
callback_data=f"mainstream_{usr_cmd[1]}")
|
105 |
]]))
|
106 |
|
107 |
elif usr_cmd[0] == "msgdelpvtyes":
|
@@ -219,7 +214,6 @@ async def cb_data(bot: Client, update: CallbackQuery):
|
|
219 |
"keywords":res["keywords"].split(",") if res.get("keywords") else [],
|
220 |
"genre": res.get("genre", []) ,
|
221 |
}
|
222 |
-
print("Line No 212 ")
|
223 |
file_info = get_file_info(message, instruction)
|
224 |
# Here we are Adding the File Into the database First
|
225 |
inserted_id = await db.add_file(file_info=file_info, db_type="TEMPORARY")
|
|
|
75 |
await asyncio.sleep(e.value)
|
76 |
await FileStream.send_message(
|
77 |
chat_id=Telegram.ULOG_GROUP,
|
78 |
+
text=f"Gᴏᴛ FʟᴏᴏᴅWᴀɪᴛ ᴏғ {str(e.value)}s ғʀᴏᴍ [{message.from_user.first_name}](tg://user?id={message.from_user.id})\n\n**ᴜsᴇʀ ɪᴅ :** `{str(message.from_user.id)}`",
|
|
|
79 |
disable_web_page_preview=True,
|
80 |
parse_mode=ParseMode.MARKDOWN)
|
81 |
|
|
|
83 |
await update.message.edit_caption(
|
84 |
caption="**Cᴏɴғɪʀᴍ ʏᴏᴜ ᴡᴀɴᴛ ᴛᴏ ᴅᴇʟᴇᴛᴇ ᴛʜᴇ Fɪʟᴇ**\n\n",
|
85 |
reply_markup=InlineKeyboardMarkup([[
|
86 |
+
InlineKeyboardButton("ʏᴇs", callback_data=f"msgdelyes_{usr_cmd[1]}_{usr_cmd[2]}"),
|
87 |
+
InlineKeyboardButton("ɴᴏ", callback_data=f"myfile_{usr_cmd[1]}_{usr_cmd[2]}")
|
|
|
|
|
88 |
]]))
|
89 |
|
90 |
elif usr_cmd[0] == "msgdelyes":
|
|
|
95 |
await update.message.edit_caption(
|
96 |
caption="**Cᴏɴғɪʀᴍ ʏᴏᴜ ᴡᴀɴᴛ ᴛᴏ ᴅᴇʟᴇᴛᴇ ᴛʜᴇ Fɪʟᴇ**\n\n",
|
97 |
reply_markup=InlineKeyboardMarkup([[
|
98 |
+
InlineKeyboardButton("ʏᴇs",callback_data=f"msgdelpvtyes_{usr_cmd[1]}"),
|
99 |
+
InlineKeyboardButton("ɴᴏ",callback_data=f"mainstream_{usr_cmd[1]}")
|
|
|
|
|
100 |
]]))
|
101 |
|
102 |
elif usr_cmd[0] == "msgdelpvtyes":
|
|
|
214 |
"keywords":res["keywords"].split(",") if res.get("keywords") else [],
|
215 |
"genre": res.get("genre", []) ,
|
216 |
}
|
|
|
217 |
file_info = get_file_info(message, instruction)
|
218 |
# Here we are Adding the File Into the database First
|
219 |
inserted_id = await db.add_file(file_info=file_info, db_type="TEMPORARY")
|
FileStream/bot/plugins/FileHandlers/files.py
CHANGED
@@ -57,22 +57,20 @@ async def my_files(bot: Client, message: Message, response):
|
|
57 |
file_list = []
|
58 |
async for x in user_files:
|
59 |
file_list.append([
|
60 |
-
InlineKeyboardButton(f"📦 {x['file']['caption']}",
|
61 |
-
callback_data=f"myfile_{x['_id']}_{1}")
|
62 |
])
|
63 |
if total_files > 10:
|
64 |
file_list.append([
|
65 |
InlineKeyboardButton("◄", callback_data="N/A"),
|
66 |
-
InlineKeyboardButton(f"1/{math.ceil(total_files / 10)}",
|
67 |
-
callback_data="N/A"),
|
68 |
InlineKeyboardButton("►", callback_data="userfiles_2")
|
69 |
], )
|
70 |
if not file_list:
|
71 |
file_list.append([InlineKeyboardButton("ᴇᴍᴘᴛʏ", callback_data="N/A")], )
|
72 |
file_list.append([InlineKeyboardButton("ᴄʟᴏsᴇ", callback_data="close")])
|
73 |
await message.reply_photo(photo=Telegram.FILE_PIC,
|
74 |
-
|
75 |
-
|
76 |
|
77 |
|
78 |
# -----------------------------Bot Private Files Command -----------------------------------------------#
|
|
|
57 |
file_list = []
|
58 |
async for x in user_files:
|
59 |
file_list.append([
|
60 |
+
InlineKeyboardButton(f"📦 {x['file']['caption']}", callback_data=f"myfile_{x['_id']}_{1}")
|
|
|
61 |
])
|
62 |
if total_files > 10:
|
63 |
file_list.append([
|
64 |
InlineKeyboardButton("◄", callback_data="N/A"),
|
65 |
+
InlineKeyboardButton(f"1/{math.ceil(total_files / 10)}",callback_data="N/A"),
|
|
|
66 |
InlineKeyboardButton("►", callback_data="userfiles_2")
|
67 |
], )
|
68 |
if not file_list:
|
69 |
file_list.append([InlineKeyboardButton("ᴇᴍᴘᴛʏ", callback_data="N/A")], )
|
70 |
file_list.append([InlineKeyboardButton("ᴄʟᴏsᴇ", callback_data="close")])
|
71 |
await message.reply_photo(photo=Telegram.FILE_PIC,
|
72 |
+
caption="Total files: {}".format(total_files),
|
73 |
+
reply_markup=InlineKeyboardMarkup(file_list))
|
74 |
|
75 |
|
76 |
# -----------------------------Bot Private Files Command -----------------------------------------------#
|
FileStream/bot/plugins/FileHandlers/stream.py
CHANGED
@@ -115,10 +115,7 @@ async def channel_receive_handler(bot: Client, message: Message):
|
|
115 |
chat_id=message.chat.id,
|
116 |
message_id=message.id,
|
117 |
reply_markup=InlineKeyboardMarkup([[
|
118 |
-
InlineKeyboardButton(
|
119 |
-
"Dᴏᴡɴʟᴏᴀᴅ ʟɪɴᴋ 📥",
|
120 |
-
url=f"https://t.me/{FileStream.username}?start=stream_{str(inserted_id)}"
|
121 |
-
)
|
122 |
]]))
|
123 |
|
124 |
except FloodWait as w:
|
@@ -146,7 +143,7 @@ async def reply_handler(
|
|
146 |
thumb: Union[str, BinaryIO] = None,
|
147 |
):
|
148 |
replied_message = message.reply_to_message
|
149 |
-
resp = ["n", "no", "not"]
|
150 |
if not replied_message:
|
151 |
return
|
152 |
if not replied_message.media:
|
|
|
115 |
chat_id=message.chat.id,
|
116 |
message_id=message.id,
|
117 |
reply_markup=InlineKeyboardMarkup([[
|
118 |
+
InlineKeyboardButton("Dᴏᴡɴʟᴏᴀᴅ ʟɪɴᴋ 📥",url=f"https://t.me/{FileStream.username}?start=stream_{str(inserted_id)}")
|
|
|
|
|
|
|
119 |
]]))
|
120 |
|
121 |
except FloodWait as w:
|
|
|
143 |
thumb: Union[str, BinaryIO] = None,
|
144 |
):
|
145 |
replied_message = message.reply_to_message
|
146 |
+
resp = ["n", "no", "not","N","NOT","NO"]
|
147 |
if not replied_message:
|
148 |
return
|
149 |
if not replied_message.media:
|