@client.event
async def on_voice_state_update(member, before, after):
# This function is called when not only member join to the voice channel,
# but also member changed their status to mute.
# So, it is necessary to catch only events that joining channel.
if before.channel != after.channel:
if after.channel is not None and after.channel.id == int(VOICE_CHANNEL_ID1):
_name = member.nick if member.nick else member.name
message = {
"message": "\n" + _name + " Join The Livestream Channel"
}
requests.post(LINE_NOTIFY_API_URL, headers=HEADERS, data=message)
if before.channel != after.channel:
if after.channel is not None and after.channel.id == int(VOICE_CHANNEL_ID2):
_name = member.nick if member.nick else member.name
message = {
"message": "\n" + _name + " Join The Nongskuy Channel"
}
requests.post(LINE_NOTIFY_API_URL, headers=HEADERS, data=message)
client.run(DISCORD_BOT_ACCESS_TOKEN)
donc, je suis en train de faire un bot qui peuvent informer mon groupe de LIGNE à chaque fois que quelqu'un de rejoindre canal de voix dans ma discorde serveur. Le problème c'est que mon ami jouant souvent avec mon bot par le quitter et de rejoindre le canal de voix repeatly et mon bot spam dans mon groupe si quelqu'un de rejoindre le canal de voix.Donc, j'ai besoin d'une aide pour faire mon bot n'informe que ma LIGNE groupe si un utilisateur est déjà à quitter canal de voix pendant 5 minutes pour rejoindre de nouveau la voix de canal