@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)
그래서 내가 만들려고 할 수있는 로봇에게 통지 라인 그룹을 때마다 누군가가 참 음성 채널에서 내 불화 서버입니다. 문제,나의 친구는 종종 재료 로봇을 떠나기로 합류한 음성 채널 repeatly 및 내 로봇이 스팸 메일에 나선 그룹의 누군가가 참 음성 채널입니다.그래서 저는 필요한 도움을 로봇만을 알리 나의 라인 그룹을 경우에는 사용자가 이미 떠나는 음성 채널을 5 분간 가시성 채널