Skip to content

Commit

Permalink
chore: caps
Browse files Browse the repository at this point in the history
  • Loading branch information
SantiiRepair committed Oct 12, 2023
1 parent 04980e1 commit eeb54ea
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 37 deletions.
23 changes: 0 additions & 23 deletions bot/commands/config.py
Original file line number Diff line number Diff line change
@@ -1,23 +0,0 @@
import os

# from tinydb import TinyDB, Query
from pyrogram.types import Message
from bot import assistant, kreacher
from pyrogram import filters, Client
from bot.decorators.permissions import only_admins

# from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup

c = os.path.dirname(os.path.abspath(__file__))


@kreacher.on_message(filters.regex(pattern="^[!?/]config"))
@only_admins
async def _(client: Client, message: Message):
# registry = os.path.join(c, "../dbs/registry.json")
# db = TinyDB(registry)
# groups = db.table("groups")
# user = groups.search(Query().id == message.chat.id)
common = await assistant.get
if len(common) > 0:
print(common)
1 change: 1 addition & 0 deletions bot/commands/play_song.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ async def _(client: Client, message: Message):
file_name=file_name,
progress=progress,
progress_args=(client, message.chat.id, _message.id),
block=False,
)
if VOICE_CHATS.get(message.chat.id) is None:
await _message.edit("🪄 **__Joining the voice chat...__**")
Expand Down
5 changes: 3 additions & 2 deletions bot/commands/play_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,13 @@ async def _(client: Client, message: Message):
file_name=file_name,
progress=progress,
progress_args=(client, message.chat.id, _message.id),
block=False,
)
if VOICE_CHATS.get(message.chat.id) is None:
await _message.edit("**__Joining the voice chat...__** \u23F3")
await _message.edit("🪄 **__Joining the voice chat...__**")
await tgcalls.start(message.chat.id)
VOICE_CHATS[message.chat.id] = tgcalls
await sleep(2)
await sleep(2)
await VOICE_CHATS[message.chat.id].start_video(
media, enable_experimental_lip_sync=True, repeat=False
)
Expand Down
10 changes: 10 additions & 0 deletions bot/helpers/nums.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def bytes_to_string(byte_count):
"""Converts a byte count to a string (in KB, MB...)"""
suffix_index = 0
while byte_count >= 1024:
byte_count /= 1024
suffix_index += 1

return "{:.2f}{}".format(
byte_count, [" bytes", "KB", "MB", "GB", "TB"][suffix_index]
)
12 changes: 0 additions & 12 deletions bot/helpers/progress.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
import logging


def bytes_to_string(byte_count):
"""Converts a byte count to a string (in KB, MB...)"""
suffix_index = 0
while byte_count >= 1024:
byte_count /= 1024
suffix_index += 1

return "{:.2f}{}".format(
byte_count, [" bytes", "KB", "MB", "GB", "TB"][suffix_index]
)


async def progress(current_bytes, total_bytes, client, chat_id, message_id):
try:
percentage = round(((current_bytes / total_bytes) * 100), 2)
Expand Down

0 comments on commit eeb54ea

Please sign in to comment.