chore(userbot): apply ruff check --fix and ruff format

- ruff check --fix: 210 auto-fixed errors (import sorting, trailing
  whitespace, unused imports, f-string fixups, deprecated annotations)
- ruff format: 104 files reformatted to consistent style
- 268 non-auto-fixable issues remain (S113 requests timeout, etc.)
This commit is contained in:
2026-06-19 12:19:01 +02:00
parent 95cec59263
commit 7ba6bc44f2
104 changed files with 4338 additions and 5319 deletions
+13 -15
View File
@@ -1,13 +1,13 @@
import random
import asyncio
import random
from pyrogram import Client, filters
from pyrogram.types import Message
from pyrogram.errors.exceptions.flood_420 import FloodWait
from pyrogram.types import Message
from utils.misc import modules_help, prefix
R = "❤️"
W = "🤍"
R = '❤️'
W = '🤍'
heart_list = [
W * 9,
@@ -20,7 +20,7 @@ heart_list = [
W * 4 + R + W * 4,
W * 9,
]
joined_heart = "\n".join(heart_list)
joined_heart = '\n'.join(heart_list)
heartlet_len = joined_heart.count(R)
@@ -37,7 +37,7 @@ async def _wrap_edit(message: Message, text: str):
async def phase1(message: Message):
"""Big scroll"""
BIG_SCROLL = "🧡💛💚💙💜🖤🤎"
BIG_SCROLL = '🧡💛💚💙💜🖤🤎'
await _wrap_edit(message, joined_heart)
for heart in BIG_SCROLL:
await _wrap_edit(message, joined_heart.replace(R, heart))
@@ -46,9 +46,9 @@ async def phase1(message: Message):
async def phase2(message: Message):
"""Per-heart randomiser"""
ALL = ["❤️"] + list("🧡💛💚💙💜🤎🖤") # don't include white heart
ALL = ['❤️'] + list('🧡💛💚💙💜🤎🖤') # don't include white heart
format_heart = joined_heart.replace(R, "{}")
format_heart = joined_heart.replace(R, '{}')
for _ in range(5):
heart = format_heart.format(*random.choices(ALL, k=heartlet_len))
await _wrap_edit(message, heart)
@@ -69,12 +69,12 @@ async def phase3(message: Message):
async def phase4(message: Message):
"""Matrix shrinking"""
for i in range(7, 0, -1):
heart_matrix = "\n".join([R * i] * i)
heart_matrix = '\n'.join([R * i] * i)
await _wrap_edit(message, heart_matrix)
await asyncio.sleep(SLEEP)
@Client.on_message(filters.command("hearts", prefix) & filters.me)
@Client.on_message(filters.command('hearts', prefix) & filters.me)
async def hearts(client: Client, message: Message):
await phase1(message)
await phase2(message)
@@ -82,12 +82,10 @@ async def hearts(client: Client, message: Message):
await phase4(message)
await asyncio.sleep(SLEEP * 3)
final_caption = " ".join(message.command[1:])
final_caption = ' '.join(message.command[1:])
if not final_caption:
final_caption = "💕 by @moonuserbot"
final_caption = '💕 by @moonuserbot'
await message.edit(final_caption)
modules_help["hearts"] = {
"hearts": "Heart animation. May cause floodwaits, use at your own risk!"
}
modules_help['hearts'] = {'hearts': 'Heart animation. May cause floodwaits, use at your own risk!'}