from __future__ import annotations from typing import Any TELEGRAM_PERMISSION_LABELS = { "can_manage_chat": "管理群组", "can_delete_messages": "删除消息", "can_manage_video_chats": "管理视频聊天", "can_restrict_members": "限制成员", "can_promote_members": "任命管理员", "can_change_info": "修改群信息", "can_post_messages": "发布消息", "can_edit_messages": "编辑消息", "can_invite_users": "邀请成员", "can_pin_messages": "置顶消息", "can_send_messages": "发送文字", "can_send_media_messages": "发送媒体", "can_send_other_messages": "发送贴纸及其他内容", "can_send_polls": "发送投票", "can_add_web_page_previews": "显示网页预览", } MEMBER_ACTION_LABELS = { "warn": "警告", "ban": "封禁", "unban": "解除封禁", "kick": "踢出", "mute": "禁言", "unmute": "解除禁言", "promote": "提升为管理员", "demote": "取消管理员", } POINT_SOURCE_LABELS = { "checkin": "每日签到", "activity": "活跃奖励", "upvote": "点赞奖励", "admin_adjustment": "管理员调整", "giveaway_entry": "抽奖报名", "giveaway_refund": "抽奖退款", "giveaway_participation": "抽奖参与奖励", "giveaway_winner": "抽奖中奖奖励", } GIVEAWAY_STATUS_LABELS = { "running": "进行中", "drawing": "开奖中", "canceling": "退款中", "finished": "已开奖", "canceled": "已取消", } def telegram_permission_label(value: Any) -> str: key = str(value) return TELEGRAM_PERMISSION_LABELS.get(key, key) def member_action_label(value: Any) -> str: key = str(value) return MEMBER_ACTION_LABELS.get(key, key) def point_source_label(value: Any) -> str: key = str(value) return POINT_SOURCE_LABELS.get(key, key) def giveaway_status_label(value: Any) -> str: key = str(value) return GIVEAWAY_STATUS_LABELS.get(key, key)