Closed mojtabaasg closed 3 years ago
How I can reproduce it?
I didn't get your point:(
it because the bot not connected to the voice chat
try to add this code
group_call = GroupCall(app, 'etc/sample_input.raw')
@group_call.on_network_status_changed
async def on_network_changed(gc: GroupCall, is_connected: bool):
chat_id = MAX_CHANNEL_ID - gc.full_chat.id
if is_connected:
await app.send_message(chat_id, 'Successfully joined!')
else:
await app.send_message(chat_id, 'Reconnect....')
await group_call.reconnect()
or when you start it
group_call.start(chat_id)
if not group_call.is_connected:
print('reconnecting')
await asyncio.sleep(3)
await group_call.reconnect()
group_call.set_is_mute(False)
it because the bot not connected to the voice chat
try to add this code
group_call = GroupCall(app, 'etc/sample_input.raw') @group_call.on_network_status_changed async def on_network_changed(gc: GroupCall, is_connected: bool): chat_id = MAX_CHANNEL_ID - gc.full_chat.id if is_connected: await app.send_message(chat_id, 'Successfully joined!') else: await app.send_message(chat_id, 'Reconnect....') await group_call.reconnect()
or when you start it
group_call.start(chat_id) if not group_call.is_connected: print('reconnecting') await asyncio.sleep(3) await group_call.reconnect() group_call.set_is_mute(False)
The second way looks bad(
it because the bot not connected to the voice chat
try to add this code
group_call = GroupCall(app, 'etc/sample_input.raw') @group_call.on_network_status_changed async def on_network_changed(gc: GroupCall, is_connected: bool): chat_id = MAX_CHANNEL_ID - gc.full_chat.id if is_connected: await app.send_message(chat_id, 'Successfully joined!') else: await app.send_message(chat_id, 'Reconnect....') await group_call.reconnect()
or when you start it
group_call.start(chat_id) if not group_call.is_connected: print('reconnecting') await asyncio.sleep(3) await group_call.reconnect() group_call.set_is_mute(False)
The first way will triggered even you try to call .stop() to leave the VC
Sometimes after starting GroupCall, nothing happens, bot will stay mute, and after several seconds, bot will leave voicechat. I have to execute my code several times to make it play my music. raw file is ok and has no problems. i think this is a bug in pytgcalls thanks