自分だったらこうします.
pycordユーザーなので動くかは保障できませんがおそらく行けるかと。
py
1
2@client.event
3async def on_voice_state_update(member: discord.Member, before: discord.VoiceState, after: discord.VoiceState):
4 if member.bot:
5 return
6
7 # [(ボイスチャンネルのID, そのときに連携させたいテキストチャンネル), (ボイスチャンネルのID, そのときに連携させたいテキストチャンネル), ...]
8 alert_channel = [
9 (111111111, client.get_channel(11)), # ボイチャ1のチャンネルID, そのときに通知するテキストチャンネルのIDをタプルにする。
10 (222222222, client.get_channel(21)) # ボイチャ2のチャンネルID, そのときに通知するテキストチャンネルのIDをタプルにする。
11 ]
12 # もしチャンネルの移動先が同じならreturn
13 if before.channel.id == after.channel.id:
14 return
15
16 # 上のリストでタプルにして入れたものをアンパックして取り出す。
17 for vc_id, text_ch in alert_channel:
18 # もしチャンネルに入ってきたら。
19 if before.channel is None and after.channel is not None:
20 # もし指定したボイスチャンネルのIDが参加者の参加したボイスチャンネルのIDと同じだったら
21 if vc_id == after.channel.id:
22 await text_ch.send(f'☎{member.display_name} が {after.channel.name} に参加☎')
23
24 # もしチャンネルから退出したら
25 elif before.channel is not None and after.channel is None:
26 # もし退出したチャンネルが指定したボイスチャンネルのIDと同じならば
27 if vc_id == before.channel.id:
28 await text_ch.send(f'📵{member.name} がVCから退出📵')
29
30 # もしボイスチャンネルの移動がされたら(退出、参加を除く)
31 elif before.channel and after.channel:
32 # もしチャンネルの移動が監視下に置かれたもの(上に代入されている)ならば (他のものは無視)
33 if vc_id in (before.channel.id, after.channel.id):
34 await text_ch.send(f"{member.name} が {before.channel.name} から {after.channel.name} に移動しました。")
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。