0506aaaac8
- 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.)
15 lines
595 B
Python
15 lines
595 B
Python
from pyrogram import Client, filters
|
|
from pyrogram.types import Message
|
|
from utils.misc import prefix
|
|
|
|
|
|
@Client.on_message(filters.command('duck', prefix) & filters.me)
|
|
async def duckgo(client: Client, message: Message):
|
|
input_str = ' '.join(message.command[1:])
|
|
sample_url = 'https://duckduckgo.com/?q={}'.format(input_str.replace(' ', '+'))
|
|
if sample_url:
|
|
link = sample_url.rstrip()
|
|
await message.edit_text(f'Let me 🦆 DuckDuckGo that for you:\n🔎 [{input_str}]({link})')
|
|
else:
|
|
await message.edit_text('something is wrong. please try again later.')
|