実現したいこと
discord.pyで、メッセージの送信者が入っているボイスチャンネルを取得したい
発生している問題・エラーメッセージ
AttributeError: 'NoneType' object has no attribute 'channel'
該当のソースコード
python
1elif "チーム分け" in message.content or "ちーむわけ" in message.content: #「チーム分け」を含むメッセージが送信されたときに以下のコードを実行 2 await teaming.teaming(message,client) 3 if teaming.teaming(message,client): 4 is_teaming = False
python
1#teaming.py 2import random 3import check_any 4from datetime import datetime 5 6async def teaming(message,client): 7 8 if message.author.bot: #メッセージの送信元がbotの場合、何も実行しない 9 return 10 11 voice_channel = message.author.voice.channel #メッセージの送信者が入っているボイスチャンネルを取得

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。