on_stream_end()

Client.on_stream_end()

Decorator for handling when an audio or video stream in a voice chat ends.

Usable by Users Bots
Parameters:
  • filters (filters, optional) – Pass one or more filters.

  • group (int, optional) – The group identifier, defaults to 0.

Example

@app.on_stream_end()
async def play_next(client, update):
    print(f"Song ended in chat {update.chat_id}!")