diff --git a/config.py b/config.py index ded8ec5..5132be5 100644 --- a/config.py +++ b/config.py @@ -1,4 +1,3 @@ -import os from os import getenv from dotenv import load_dotenv diff --git a/driver/utils.py b/driver/utils.py index e10b824..bac2a5d 100644 --- a/driver/utils.py +++ b/driver/utils.py @@ -1,7 +1,6 @@ import asyncio import os -from config import IMG_5 from driver.core import bot, calls, user from driver.database.dbqueue import remove_active_chat from driver.queues import ( @@ -76,7 +75,8 @@ async def skip_current_song(chat_id): ) pop_an_item(chat_id) return [songname, link, type] - except: + except BaseException as error: + print(error) await calls.leave_group_call(chat_id) await remove_active_chat(chat_id) clear_queue(chat_id) diff --git a/program/admins.py b/program/admins.py index aeb27e1..b039d0f 100644 --- a/program/admins.py +++ b/program/admins.py @@ -1,7 +1,7 @@ import traceback from cache.admins import admins -from driver.core import calls, bot +from driver.core import calls from pyrogram import Client, filters from driver.design.thumbnail import thumb from driver.design.chatname import CHAT_TITLE @@ -9,6 +9,7 @@ from driver.queues import QUEUE, clear_queue from driver.filters import command, other_filters from driver.decorators import authorized_users_only, check_blacklist from driver.utils import skip_current_song, skip_item, remove_if_exists +from config import BOT_USERNAME, IMG_5 from driver.database.dbqueue import ( is_music_playing, @@ -16,20 +17,9 @@ from driver.database.dbqueue import ( music_off, music_on, ) -from program.utils.inline import ( - stream_markup, - close_mark, - back_mark, -) -from config import ( - BOT_USERNAME, - GROUP_SUPPORT, - IMG_5, - UPDATES_CHANNEL, -) +from program.utils.inline import stream_markup, close_mark from pyrogram.types import ( CallbackQuery, - InlineKeyboardButton, InlineKeyboardMarkup, Message, ) @@ -163,7 +153,7 @@ async def skip(c: Client, m: Message): if data == 0: pass else: - track = track + "\n" + f"**#{x}** - {hm}" + track = track + "\n" + f"**#{x}** - {data}" await m.reply(track) diff --git a/program/blockchat.py b/program/blockchat.py index ec3f386..cc9bc30 100644 --- a/program/blockchat.py +++ b/program/blockchat.py @@ -1,9 +1,9 @@ from pyrogram.types import Message from pyrogram import Client, filters -from config import SUDO_USERS, BOT_USERNAME +from config import BOT_USERNAME from driver.core import bot -from driver.filters import command, other_filters +from driver.filters import command from driver.decorators import sudo_users_only from driver.database.dblockchat import ( blacklist_chat, diff --git a/program/developer.py b/program/developer.py index 1307371..cd5f929 100644 --- a/program/developer.py +++ b/program/developer.py @@ -1,12 +1,10 @@ import re import sys -import shutil import subprocess import traceback from time import time from io import StringIO -from sys import version as pyver from inspect import getfullargspec from config import BOT_USERNAME as bname diff --git a/program/downloader.py b/program/downloader.py index 6cb9ed0..ea2b495 100644 --- a/program/downloader.py +++ b/program/downloader.py @@ -1,29 +1,19 @@ # Copyright (C) 2021 By Veez Music-Project -import os -import re -import time -import asyncio -import traceback - -import lyricsgenius - -import aiofiles -import aiohttp -import requests import wget import yt_dlp +import traceback +import requests +import lyricsgenius + from pyrogram import Client, filters -from pyrogram.errors import FloodWait, MessageNotModified from pyrogram.types import Message from youtube_search import YoutubeSearch -from youtubesearchpython import VideosSearch from yt_dlp import YoutubeDL from config import BOT_USERNAME as bn from driver.decorators import check_blacklist -from driver.filters import command, other_filters -from driver.database.dbpunish import is_gbanned_user +from driver.filters import command from driver.utils import remove_if_exists diff --git a/program/speedtest.py b/program/speedtest.py index 2574331..182b3e5 100644 --- a/program/speedtest.py +++ b/program/speedtest.py @@ -4,8 +4,7 @@ import wget import speedtest from PIL import Image -from program.utils.formatters import bytes -from driver.filters import command, other_filters +from driver.filters import command from driver.decorators import sudo_users_only from config import BOT_USERNAME as bname from driver.core import bot as app diff --git a/program/updater.py b/program/updater.py index b8633fc..f2fd8cf 100644 --- a/program/updater.py +++ b/program/updater.py @@ -1,9 +1,4 @@ -import os -import re import sys -import asyncio -import subprocess -from asyncio import sleep from git import Repo from os import system, execle, environ @@ -13,10 +8,8 @@ from pyrogram.types import Message from pyrogram import Client, filters from config import UPSTREAM_REPO, BOT_USERNAME -from driver.core import bot from driver.filters import command from driver.decorators import bot_creator -from driver.database.dbqueue import get_active_chats, remove_active_chat def gen_chlog(repo, diff): diff --git a/program/utils/inline.py b/program/utils/inline.py index 3a98430..33536e0 100644 --- a/program/utils/inline.py +++ b/program/utils/inline.py @@ -1,10 +1,8 @@ """ inline section button """ from pyrogram.types import ( - CallbackQuery, InlineKeyboardButton, InlineKeyboardMarkup, - Message, ) diff --git a/program/ytsearch.py b/program/ytsearch.py index 6a78c33..ddfc76a 100644 --- a/program/ytsearch.py +++ b/program/ytsearch.py @@ -1,7 +1,6 @@ from config import BOT_USERNAME from driver.decorators import check_blacklist from driver.filters import command -from driver.database.dbpunish import is_gbanned_user from pyrogram import Client from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message from youtube_search import YoutubeSearch