Exemple #1
0
    async def on_voice_leave(self, self_voice_client: VoiceClient,
                             member: Member, voice_state_before: VoiceState):

        # If self client voice is empty.
        if not self.there_is_user_in_voice(voice_state_before.channel):
            guild_state = self.music_manager.get_guild_state(member.guild.id)

            self_voice_client.pause()

            guild_state.waiter = asyncio.ensure_future(
                self.wait_for_user(self_voice_client, member.guild))
            guild_state.waiting = True

            # print("Pause and wait for user")
            return

        return await super().on_voice_leave(self_voice_client, member,
                                            voice_state_before)
Exemple #2
0
def player_stop(vc: discord.VoiceClient):
    vc.pause()
    return "pause"