Skip to content

Bare Minimum Admin Features#13

Open
danelzhan wants to merge 17 commits into
devfrom
dzhang/admin-features
Open

Bare Minimum Admin Features#13
danelzhan wants to merge 17 commits into
devfrom
dzhang/admin-features

Conversation

@danelzhan

@danelzhan danelzhan commented Mar 20, 2026

Copy link
Copy Markdown
  • Allows admin to create new event entry to specify event attendee roles, mentor roles, ticket submit channel, ticket claim channel
  • Queues ticket claim messages into specified channel

Still need to implement:

  • Specified channel listening
  • /admin-event-archive, which allows you to only tag mentors in current event as well as archiving past events
  • ability to edit created event configs
  • Category name must be the event name (should fix)
  • Current year must match event year (should fix as well)
  • Tickets can only be called by event's role
  • On event archive, all mentors with that event's role has their role taken away
  • On new event, check if there is another active event and send a warning

Demo Video:
https://imgur.com/a/lDbFxDj

kevinxiao27 and others added 8 commits March 19, 2026 02:38
* Feat: add lint for PRs

* Feat: workflow - lint

* Fix: Ruff linter checks

* Fix: Format with ruff

* Remove duplicate load_env (fixed by sync call in main)

* Fix: workflow name - autofix support
…o create new event, queues claim tickets into channel specified during event creation
@kevinxiao27

Copy link
Copy Markdown
Member

Fix lint + typecheck please 🙏
image

"eventId;year": event_year_key,
"eventId": event_name,
"eventRoleId": role.id,
"mentorRoleId": role.id,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should refer to mentor_role, not role. This worked while testing because everyone had the admin role so there was no difference

Comment thread services/discord/admin/admin.py Outdated
@app_commands.command(name="admin", description="Test bot responsiveness")
async def overview(self, interaction: discord.Interaction):
"""Simple ping command to test if the bot is responding."""
await interaction.response.send_modal(ConfigCreateModal(None))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

missing import


try:
await db.create(event_item, TICKET_EVENTS_TABLE)
except Exception:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This print statement is not helpful to us and also provides no feedback to the user. You should send an ephemeral failure message and also log the actual error

except Exception as e:
    print("could not save event", e)
    await interactions ... # send message

async def get_claim_channel_id(eventId: str, year: int) -> int | None:
"""Checks biztechTicketsEvents table for event's claim channelId"""
try:
event_item = await db.get_one_custom({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

query could succeed but if the key doesnt exist in the table then it will return a None object (of which what you've written below cannot call pythons _get_item() implementation

event_item = await db.get_one_custom({
"TableName": TICKET_EVENTS_TABLE,
"Key": {
"eventId": {"S": eventId},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

have you already created the table? I would probably like you to recreate it to be preferable since the tables are different (eventID is normally how the things are capitalized)

"eventId;year": {"S": f"{eventId};{year}"}
}
})
return int(event_item["claimChannelId"]["N"])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

once again if it returns an empty item (which it could) this will cause the bot to panic/restart

from botocore.exceptions import ClientError

from lib.constants import TICKETS_TABLE
from lib.constants import TICKET_EVENTS_TABLE

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this import isn't used

Comment thread services/discord/admin/admin.py
@danelzhan
danelzhan force-pushed the dzhang/admin-features branch from 1fa5940 to 513191c Compare March 21, 2026 00:22
@danelzhan
danelzhan requested a review from kevinxiao27 March 21, 2026 00:44

@elijahzhao24 elijahzhao24 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This current Pr only allows for admins to set a custom channel for the incoming tickets. I think we should hold off for now merging this until the rest of the functionality is finished.

I think there is some other flows that should be changed in this command. Category, channel, and role creation should be handled on the server side, and not first manually by the client, and then passed to the server. Not only does this make this cooked if there is a typo, but it just introduces more error as you are maintaining two sources of truth on creation, when it could just all be handled on the server side. This should also include creating the roles, and allowing mentor roles in certain channels.
(Note: doing this would also still work with your current flow, as you would only create a new category or channel if it doesn't already exist)

In addition, this command should for setting up what channels you can use the bot in. By default we can just block use of the bot unless your an admin on any channel, but on the new event creation, we will allow the use of the bot on those channels.

Make sure to fully integrate your changes as well so there is not two sources of truth, as in the /delete flow, we don't currently query your db for the incoming ticket channel id.

return

ticket = update_response.get("Attributes", {})
# db.update_db() returns attributes directly, not a DynamoDB response envelope.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants