From c4f844e2965d4fd6a28aa707e1496939a9aaa58e Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Wed, 16 Jul 2025 10:00:22 +0100 Subject: Add new M-x github remove command --- arthur/exts/github/management.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'arthur/exts/github/management.py') diff --git a/arthur/exts/github/management.py b/arthur/exts/github/management.py index ee3dca3..2ac230a 100644 --- a/arthur/exts/github/management.py +++ b/arthur/exts/github/management.py @@ -2,7 +2,7 @@ from discord.ext.commands import Cog, Context, group -from arthur.apis.github import GitHubError, add_staff_member +from arthur.apis.github import GitHubError, add_staff_member, remove_org_member from arthur.bot import KingArthur from arthur.config import CONFIG @@ -36,6 +36,17 @@ class GitHubManagement(Cog): except GitHubError as e: await ctx.send(f":x: Failed to add {username} to the staff team: {e}") + @github.command(name="remove") + async def remove_org_member(self, ctx: Context, username: str) -> None: + """Remove a user from the GitHub organisation.""" + try: + await remove_org_member(username) + await ctx.send( + f":white_check_mark: Successfully removed {username} from the GitHub organisation." + ) + except GitHubError as e: + await ctx.send(f":x: Failed to remove {username} from the organisation: {e}") + async def setup(bot: KingArthur) -> None: """Add cog to bot.""" -- cgit v1.2.3