Skip to content

Commit

Permalink
fix: undefined bot and _copy_message
Browse files Browse the repository at this point in the history
  • Loading branch information
5hojib committed Jan 5, 2025
1 parent 658464d commit 4766296
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 32 deletions.
4 changes: 2 additions & 2 deletions bot/helper/mirror_leech_utils/telegram_uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ async def _upload_file(self, cap_mono, file, o_path, force_document=False):
progress=self._upload_progress,
)

await _copy_message()
await self._copy_message()

if (
not self._listener.is_cancelled
Expand Down Expand Up @@ -574,7 +574,7 @@ async def _copy_message(self):
async def _copy(target, retries=3):
for attempt in range(retries):
try:
msg = await bot.get_messages(
msg = await TgClient.bot.get_messages(
self._sent_msg.chat.id,
self._sent_msg.id,
)
Expand Down
30 changes: 0 additions & 30 deletions bot/modules/users_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,27 +49,7 @@ async def get_user_settings(from_user):
ffc = user_dict.get("ffmpeg_cmds", Config.FFMPEG_CMDS or "None")

# Conditions
"DOCUMENT" if user_dict.get("as_doc", Config.AS_DOCUMENT) else "MEDIA"
("Enabled" if user_dict.get("media_group", Config.MEDIA_GROUP) else "Disabled")
(
"user"
if (
TgClient.IS_PREMIUM_USER
and user_dict.get("user_transmission", Config.USER_TRANSMISSION)
)
else "bot"
)
(
"Enabled"
if (
TgClient.IS_PREMIUM_USER
and user_dict.get("mixed_leech", Config.MIXED_LEECH)
)
else "Disabled"
)
user_dict.get("thumb_layout", Config.THUMBNAIL_LAYOUT or "None")
rccmsg = "Exists" if await aiopath.exists(rclone_conf) else "Not Exists"
user_dict.get("rclone_path", Config.RCLONE_PATH or "None")
tokenmsg = "Exists" if await aiopath.exists(token_pickle) else "Not Exists"
default_upload = user_dict.get("default_upload", Config.DEFAULT_UPLOAD)
dur = "Gdrive API" if default_upload != "gd" else "Rclone"
Expand Down Expand Up @@ -326,12 +306,6 @@ async def edit_user_settings(client, query):
thumbmsg = "Exists" if await aiopath.exists(thumbpath) else "Not Exists"
split_size = Config.LEECH_SPLIT_SIZE
buttons.data_button("Leech Destination", f"userset {user_id} ldest")
if user_dict.get("leech_dest", False):
user_dict["leech_dest"]
elif "leech_dest" not in user_dict and Config.LEECH_DUMP_CHAT:
pass
else:
pass
buttons.data_button("Leech Prefix", f"userset {user_id} leech_prefix")
if user_dict.get("lprefix", False):
lprefix = user_dict["lprefix"]
Expand Down Expand Up @@ -380,8 +354,6 @@ async def edit_user_settings(client, query):
"Leech by User",
f"userset {user_id} user_transmission true",
)
else:
pass

if (TgClient.IS_PREMIUM_USER and user_dict.get("mixed_leech", False)) or (
"mixed_leech" not in user_dict and Config.MIXED_LEECH
Expand All @@ -395,8 +367,6 @@ async def edit_user_settings(client, query):
"Enable Mixed Leech",
f"userset {user_id} mixed_leech true",
)
else:
pass

buttons.data_button("Thumbnail Layout", f"userset {user_id} tlayout")
if user_dict.get("thumb_layout", False):
Expand Down

0 comments on commit 4766296

Please sign in to comment.