Skip to content

Commit 55856c3

Browse files
techfish-11Copilot
andauthored
Update cogs/voice/basic.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 0b81326 commit 55856c3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

cogs/voice/basic.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -604,10 +604,10 @@ async def get_user_speaker_id(self, user_id: int, guild_id: int = None) -> int:
604604
if guild_id:
605605
guild = self.bot.get_guild(guild_id)
606606
else:
607-
for g in self.bot.guilds:
608-
if g.get_member(user_id):
609-
guild = g
610-
break
607+
logging.warning(f"get_user_speaker_id called without guild_id for user {user_id}. This is not supported and may cause incorrect behavior.")
608+
# Optionally, raise an exception to enforce contract:
609+
# raise ValueError("guild_id must be provided to get_user_speaker_id")
610+
# guild remains None
611611
guild_member_count = guild.member_count if guild else 0
612612
if high_load_time and high_load_time_voice_switch:
613613
# ギルド人数閾値判定

0 commit comments

Comments
 (0)