Skip to content

Commit

Permalink
Update userroles.py
Browse files Browse the repository at this point in the history
  • Loading branch information
koyakonsta authored Feb 1, 2024
1 parent 3d389f0 commit 01826b1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/extensions/userroles.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import arc
import hikari

from src.config import ROLE_IDS as role_choices
role_choices = [hikari.CommandChoice(name=a, value=b) for a,b in role_choices] # reformat role_choices into CommandChoice-es; thus ROLE_IDS can just store easy-to-update tuples
from src.config import ROLE_IDS
ROLE_IDS = [hikari.CommandChoice(name=name, value=value) for name,value in ROLE_IDS] # reformat ROLE_IDS into CommandChoice-es; thus ROLE_IDS can just store easy-to-update tuples

plugin = arc.GatewayPlugin("User Roles")

Expand All @@ -11,7 +11,7 @@
@role.include
@arc.slash_subcommand("add", "Add an assignable role.")
async def add_role(
ctx: arc.GatewayContext, role: arc.Option[str, arc.StrParams("The role to add.", choices=role_choices)]
ctx: arc.GatewayContext, role: arc.Option[str, arc.StrParams("The role to add.", choices=ROLE_IDS)]
) -> None:
assert ctx.guild_id
assert ctx.member
Expand All @@ -30,7 +30,7 @@ async def add_role(
@role.include
@arc.slash_subcommand("remove", "Remove an assignable role.")
async def remove_role(
ctx: arc.GatewayContext, role: arc.Option[str, arc.StrParams("The role to remove.", choices=role_choices)]
ctx: arc.GatewayContext, role: arc.Option[str, arc.StrParams("The role to remove.", choices=ROLE_IDS)]
) -> None:
assert ctx.guild_id
assert ctx.member
Expand Down

0 comments on commit 01826b1

Please sign in to comment.