Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added voice kicking. #2639

Merged
merged 5 commits into from May 3, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions redbot/cogs/mod/abc.py
Expand Up @@ -19,6 +19,7 @@ def __init__(self, *_args):
self.cache: dict
self.ban_queue: List[Tuple[int, int]]
self.unban_queue: List[Tuple[int, int]]
self._voice_perm_check
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should defined as an abstractmethod (see below)


@classmethod
@abstractmethod
Expand Down
10 changes: 7 additions & 3 deletions redbot/cogs/mod/kickban.py
Expand Up @@ -497,17 +497,21 @@ async def softban(self, ctx: commands.Context, user: discord.Member, *, reason:

@commands.command()
@commands.guild_only()
@commands.bot_has_permissions(move_members=True)
@commands.mod_or_permissions(move_members=True)
async def voicekick(
self, ctx: commands.Context, member: discord.Member, *, reason: str = None
):
"""Kick a member from a voice channel."""
author = ctx.author
guild = ctx.guild
user_voice_state: discord.VoiceState = member.voice

if member.voice is None:
await ctx.send(_("{} is not in a voice channel.").format(member.name))
if (
await self._voice_perm_check(
ctx, user_voice_state, move_members=True
)
is False
):
return
elif not await is_allowed_by_hierarchy(self.bot, self.settings, guild, author, member):
await ctx.send(
Expand Down