aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2025-07-16 10:00:22 +0100
committerGravatar Joe Banks <[email protected]>2025-07-16 10:00:22 +0100
commitc4f844e2965d4fd6a28aa707e1496939a9aaa58e (patch)
tree9d8bb70706f644ec5f9f81cdd79197129d63938c
parentAdd new endpoints for removing organisation members (diff)
Add new M-x github remove command
-rw-r--r--arthur/exts/github/management.py13
1 files changed, 12 insertions, 1 deletions
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."""