Skip to content

Commit

Permalink
refactor: modules
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmaialva33 committed Oct 25, 2024
1 parent 4838d78 commit a366ec5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions WinxMusic/core/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ async def start(self):
try:
await self.send_message(
config.LOG_GROUP_ID,
text=f"🚀 <u><b>{self.mention} Bot Iniciado :</b></u>\n\n🆔 Id: <code>{self.id}</code>\n📛 Nome: {self.name}\n🔗 Nome de usuário: @{self.username}",
text=f"🚀 <u><b>{self.mention} Bot Iniciado :</b></u>\n\n🆔 <b>ID</b>: <code>{self.id}</code>\n📛 <b>Nome</b>: {self.name}\n🔗 <b>Nome de usuário:</b> @{self.username}",
)
except:
LOGGER(__name__).error(
Expand Down Expand Up @@ -161,6 +161,6 @@ async def stop(self):
LOGGER(__name__).info("Bot is shutting down")
await self.send_message(
config.LOG_GROUP_ID,
text=f"🛑 <u><b>{self.mention} Bot Desligado :</b></u>\n\n🆔 Id: <code>{self.id}</code>\n📛 Nome: {self.name}\n🔗 Nome de usuário: @{self.username}",
text=f"🛑 <u><b>{self.mention} Bot Desligado :</b></u>\n\n🆔 <b>ID</b>: <code>{self.id}</code>\n📛 <b>Nome</b>: {self.name}\n🔗 <b>Nome de usuário:</b> @{self.username}",
)
await super().stop()
4 changes: 2 additions & 2 deletions WinxMusic/plugins/tools/ping.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from datetime import datetime

from pyrogram import filters
from pyrogram import filters, Client
from pyrogram.types import Message

from WinxMusic import app
Expand All @@ -16,7 +16,7 @@

@app.on_message(filters.command(PING_COMMAND) & ~BANNED_USERS)
@language
async def ping_com(client, message: Message, _):
async def ping_com(_client: Client, message: Message, _):
response = await message.reply_photo(
photo=PING_IMG_URL,
caption=_["ping_1"].format(app.mention),
Expand Down
26 changes: 13 additions & 13 deletions WinxMusic/plugins/tools/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ async def queued_tracks(_client: Client, callback_query: CallbackQuery, _):
basic[videoid] = False
buttons = queue_back_markup(_, what)
med = InputMediaPhoto(
media="https://telegra.ph//file/6f7d35131f69951c74ee5.jpg",
media="https://raw.githubusercontent.com/gabrielmaialva33/winx-music-bot/refs/heads/master/assets/queue_img.png",
caption=_["queue_1"],
)
await callback_query.edit_message_media(media=med)
Expand All @@ -176,12 +176,12 @@ async def queued_tracks(_client: Client, callback_query: CallbackQuery, _):
for x in got:
j += 1
if j == 1:
msg += f'Current playing:\n\n🏷Title: {x["title"]}\nDuration: {x["dur"]}\nBy: {x["by"]}\n\n'
msg += f'Tocando agora:\n\n🏷Título: {x["title"]}\nDuração: {x["dur"]}\nPor: {x["by"]}\n\n'
elif j == 2:
msg += f'Queued:\n\n🏷Title: {x["title"]}\nDuratiom: {x["dur"]}\nby: {x["by"]}\n\n'
msg += f'Na fila:\n\n🏷Título: {x["title"]}\nDuração: {x["dur"]}\nPor: {x["by"]}\n\n'
else:
msg += f'🏷Title: {x["title"]}\nDuration: {x["dur"]}\nBy: {x["by"]}\n\n'
if "Queued" in msg:
msg += f'🏷Título: {x["title"]}\nDuração: {x["dur"]}\nPor: {x["by"]}\n\n'
if "Na fila" in msg:
if len(msg) < 700:
await asyncio.sleep(1)
return await callback_query.edit_message_text(msg, reply_markup=buttons)
Expand Down Expand Up @@ -228,24 +228,24 @@ async def queue_back(_client: Client, callback_query: CallbackQuery, _):
type = (got[0]["streamtype"]).title()
DUR = get_duration(got)
if "live_" in file:
IMAGE = get_image(videoid)
image = get_image(videoid)
elif "vid_" in file:
IMAGE = get_image(videoid)
image = get_image(videoid)
elif "index_" in file:
IMAGE = config.STREAM_IMG_URL
image = config.STREAM_IMG_URL
else:
if videoid == "telegram":
IMAGE = (
image = (
config.TELEGRAM_AUDIO_URL
if type == "Audio"
else config.TELEGRAM_VIDEO_URL
)
elif videoid == "soundcloud":
IMAGE = config.SOUNCLOUD_IMG_URL
image = config.SOUNCLOUD_IMG_URL
elif "saavn" in videoid:
IMAGE = got[0].get("thumb") or config.TELEGRAM_AUDIO_URL
image = got[0].get("thumb") or config.TELEGRAM_AUDIO_URL
else:
IMAGE = get_image(videoid)
image = get_image(videoid)
send = (
"**⌛️ Duração:** Duração desconhecida\n\nClique no botão abaixo para ver a lista completa na fila"
if DUR == "Unknown"
Expand All @@ -272,7 +272,7 @@ async def queue_back(_client: Client, callback_query: CallbackQuery, _):
)
basic[videoid] = True

med = InputMediaPhoto(media=IMAGE, caption=cap)
med = InputMediaPhoto(media=image, caption=cap)
mystic = await callback_query.edit_message_media(media=med, reply_markup=upl)
if DUR != "Unknown":
try:
Expand Down
4 changes: 2 additions & 2 deletions strings/langs/pt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ lyrics_3: "❌ Falha ao buscar letras 🥲.\n\n**Tentativa de busca por:** {0}"
lyrics_4: "Clique no botão abaixo para evitar a busca de letras com longos spams."

# Ping
ping_1: "» {0} está pingando..."
ping_2: "**» PONG**: `{0}`ms \n\n<b><u>Estatísticas do sistema {1} :</u></b>\n\n🌋 Uptime : {2}\n🌋 RAM : {3} \n🌋 CPU : {4} \n🌋 Disco : {5} \n🌋 Py-tgcalls : `{6} ms`"
ping_1: "📡 {0} está pingando..."
ping_2: "**PONG**: `{0}`ms \n\n<b><u>Estatísticas do sistema {1} :</u></b>\n\n Uptime: {2}\n🧠 RAM: {3} \n💻 CPU: {4} \n💾 Disco: {5} \n🎧 Py-tgcalls: `{6} ms`"

# Song
song_1: "🚫 Você só pode baixar músicas ou vídeos do YouTube em chat privado. Por favor, inicie o chat comigo em privado."
Expand Down

0 comments on commit a366ec5

Please sign in to comment.