Skip to content

Commit

Permalink
Add audio
Browse files Browse the repository at this point in the history
  • Loading branch information
StarkGang authored Apr 23, 2021
1 parent 6926c0a commit 7fca64f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions plugins/fileTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,25 @@ async def upload(client, message):
progress=progress,
progress_args=(pablo, c_time, f"`Uploading {file_name}!`", file_name),
)
elif file.endswith([".mp3", ".wav", ".m4a"]):
capt = f"File Name : `{file_name}` \nFile Size : `{humanbytes(size)}` \nFile Type : `Audio (Guessed)`"
if send_as_thumb:
await client.send_audio(
message.chat.id,
file,
thumb="./main_startup/Cache/thumb.jpg",
caption=capt,
progress=progress,
progress_args=(pablo, c_time, f"`Uploading {file_name}!`", file_name),
)
else:
await client.send_audio(
message.chat.id,
file,
caption=capt,
progress=progress,
progress_args=(pablo, c_time, f"`Uploading {file_name}!`", file_name),
)
elif file.endswith(sticker_ext):
await client.send_sticker(
message.chat.id,
Expand Down

0 comments on commit 7fca64f

Please sign in to comment.