feat: switch admin identification from user_id to username
- Replace admin_user_ids (list[int]) with admin_usernames (list[str]) - Update all service methods to use username for permission checks - Add delete button to bot responses for message cleanup - Update tests to match new implementation Note: Breaking change - existing data files need fresh start
This commit is contained in:
@@ -44,18 +44,18 @@ class RoomData:
|
||||
The next_id field is used to generate unique bounty IDs within this room.
|
||||
|
||||
The timezone field stores the room's timezone (e.g., "Asia/Jakarta"), default UTC+0.
|
||||
The admin_user_ids field lists users who have admin privileges in this room.
|
||||
The admin_usernames field lists usernames who have admin privileges in this room.
|
||||
"""
|
||||
|
||||
room_id: int
|
||||
bounties: list[Bounty]
|
||||
next_id: int
|
||||
timezone: str | None = None
|
||||
admin_user_ids: list[int] | None = None
|
||||
admin_usernames: list[str] | None = None
|
||||
|
||||
def __post_init__(self):
|
||||
if self.admin_user_ids is None:
|
||||
self.admin_user_ids = []
|
||||
if self.admin_usernames is None:
|
||||
self.admin_usernames = []
|
||||
|
||||
|
||||
@dataclass
|
||||
|
||||
Reference in New Issue
Block a user