@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)
così sto cercando di fare un bot che è in grado di avvisare il mio gruppo di RIGA ogni volta che qualcuno di entrare canale voce nella mia discordia server. Il problema è che il mio amico spesso giocando con il mio bot, lasciando che si congiunge con il canale voce repeatly e il mio bot di spam nel mio gruppo se qualcuno che unisce il canale vocale.Così, ho bisogno di un aiuto per fare il mio bot solo confermare la mia LINEA di gruppo, se un utente è già lasciando il canale voce per 5 minuti e unire di nuovo al canale vocale