I'm trying to make a support bot that join in the voice-support-channel when a user connects the support-channel.
@client.command(aliases=['sup', 's'])
async def support(ctx):
log = client.get_channel(id=701765882417774663)
channels = ['bot-befehle']
vc = client.get_channel(id=702412635127152686)
global player
if str(ctx.channel) in channels:
try:
player = await vc.connect()
except:
return
player.play(discord.FFmpegPCMAudio('support.mp3'))
player.source = discord.PCMVolumeTransformer(player.source)
player.source.volume = 1.00
await asyncio.sleep(30)
player.stop()
await player.disconnect()
await log.send('Habe den Befehl "!support" erfolgreich ausgeführt.')
print('Habe den Befehl "Support" erfolgreich ausgeführt.')
I have no idea how to check for a user in the voice-channel. Can anyone help?