diff --git a/program/ytsearch.py b/program/ytsearch.py index a11f748..f0d9b53 100644 --- a/program/ytsearch.py +++ b/program/ytsearch.py @@ -12,6 +12,8 @@ async def ytsearch(_, message: Message): query = message.text.split(None, 1)[1] m = await message.reply_text("🔎 **Searching...**") results = YoutubeSearch(query, max_results=5).to_dict() + if len(results) == 0: + return await m.edit_text("❌ **no results found.**") text = "" for i in range(5): try: