feat(shard): ✨ Prevent non-participants from hanging up or skipping calls.
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user