feat(shard): ✨ Prevent non-participants from hanging up or skipping calls.

This commit is contained in:
2025-03-31 11:37:36 -03:00
parent 131bbcc548
commit 688d28140f
3 changed files with 20 additions and 2 deletions
+18
View File
@@ -73,6 +73,15 @@ class Calls(base.Cog):
f"☎️ You're not on a call! Use `{ctx.clean_prefix}call` to start one."
)
call = await self.bot.call_handler.get_call_by_channel_id(ctx.channel.id)
participant = await call.get_participant(ctx.author.id)
if participant is None:
return await ctx.send(
"❌ You cannot skip a call you have not participated in."
)
channels = await self.bot.call_handler.skip(ctx.channel.id)
for channel in channels:
@@ -104,6 +113,15 @@ class Calls(base.Cog):
f"☎️ You're not on a call! Use `{ctx.clean_prefix}call` to start one."
)
call = await self.bot.call_handler.get_call_by_channel_id(ctx.channel.id)
participant = await call.get_participant(ctx.author.id)
if participant is None:
return await ctx.send(
"❌ You cannot hang up a call you have not participated in."
)
channels = await self.bot.call_handler.hangup(ctx.channel.id)
other_channel = channels[0] if channels[0] != ctx.channel.id else channels[1]