How do I make a discord bot that tags a @role when someone joins into a voice channel?
Example:
@role {user} has joined the Support 1 Channel
0
votes
1 Answers
1
votes
@bot.event
async def on_voice_state_update(member, before, after):
# Checking if the member has joined channel
if before.voice is None and after.voice is not None:
# Getting the channel and a role
channel = bot.get_channel(channel_id)
role = member.guild.get_role(role_id)
# Sending some info
await channel.send(f'{role.mention} {member.mention} has joined `{str(after.voice.channel)}`')