async def vc_check ( ctx : commands . Context ) : # pylint: disable=unused-argument if not discord . voice_client . has_nacl : raise commands . CheckFailure ( "voice cannot be used because PyNaCl is not loaded" ) if not discord . opus . is_loaded ( ) : raise commands . CheckFailure ( "voice cannot be used because libopus is not loaded" ) return True
python discord check if voice channel is empty
Check for whether VC is available in this bot .
async def vc_check(ctx: commands.Context):  # pylint: disable=unused-argument
    """
    Check for whether VC is available in this bot.
    """

    if not discord.voice_client.has_nacl:
        raise commands.CheckFailure("voice cannot be used because PyNaCl is not loaded")

    if not discord.opus.is_loaded():
        raise commands.CheckFailure("voice cannot be used because libopus is not loaded")

    return True