Skip to content

Commit c4f844e

Browse files
committed
Add new M-x github remove command
1 parent a6ac8a0 commit c4f844e

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

arthur/exts/github/management.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from discord.ext.commands import Cog, Context, group
44

5-
from arthur.apis.github import GitHubError, add_staff_member
5+
from arthur.apis.github import GitHubError, add_staff_member, remove_org_member
66
from arthur.bot import KingArthur
77
from arthur.config import CONFIG
88

@@ -36,6 +36,17 @@ async def add_team_member(self, ctx: Context, username: str) -> None:
3636
except GitHubError as e:
3737
await ctx.send(f":x: Failed to add {username} to the staff team: {e}")
3838

39+
@github.command(name="remove")
40+
async def remove_org_member(self, ctx: Context, username: str) -> None:
41+
"""Remove a user from the GitHub organisation."""
42+
try:
43+
await remove_org_member(username)
44+
await ctx.send(
45+
f":white_check_mark: Successfully removed {username} from the GitHub organisation."
46+
)
47+
except GitHubError as e:
48+
await ctx.send(f":x: Failed to remove {username} from the organisation: {e}")
49+
3950

4051
async def setup(bot: KingArthur) -> None:
4152
"""Add cog to bot."""

0 commit comments

Comments
 (0)