Skip to content

Commit

Permalink
Update stop.py
Browse files Browse the repository at this point in the history
  • Loading branch information
TheChampu committed Oct 23, 2024
1 parent a6ba395 commit 09c36e8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ChampuMusic/plugins/admins/stop.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ async def assistant_left(client: app, member: ChatMemberUpdated):
except Exception as e:
return


@app.on_message(filters.video_chat_started & filters.group)
async def brah(_, msg):
chat_id = msg.chat.id
Expand All @@ -231,8 +230,10 @@ async def brah(_, msg):
await Champu.st_stream(chat_id)
await set_loop(chat_id, 0)
except Exception as e:
return await msg.reply(f"**Error {e}**")

if isinstance(e, ChatWriteForbidden):
print(f"Error: Bot cannot send messages in chat {chat_id}. Check permissions.")
else:
return await msg.reply(f"**Error {e}**")

# vc off
@app.on_message(filters.video_chat_ended & filters.group)
Expand All @@ -243,4 +244,7 @@ async def brah2(_, msg):
await Champu.st_stream(chat_id)
await set_loop(chat_id, 0)
except Exception as e:
return await msg.reply(f"**Error {e}**")
if isinstance(e, ChatWriteForbidden):
print(f"Error: Bot cannot send messages in chat {chat_id}. Check permissions.")
else:
return await msg.reply(f"**Error {e}**")

0 comments on commit 09c36e8

Please sign in to comment.