SeaCogs/issuecards/constants.py

31 lines
1.5 KiB
Python
Raw Normal View History

2025-03-28 09:56:44 -05:00
from discord import Colour
COLORS = {
"done": Colour.dark_purple(),
"success": Colour.green(),
"muted": Colour.greyple(),
"danger": Colour.red(),
}
TYPES = [
{"name": "issue", "octicon": "issue-opened", "color": COLORS["success"]},
{"name": "issue_closed", "octicon": "issue-closed", "color": COLORS["done"]},
{"name": "issue_not_planned", "octicon": "skip", "color": COLORS["muted"]},
{"name": "issue_draft", "octicon": "issue-draft", "color": COLORS["muted"]},
{"name": "pull_request", "octicon": "git-pull-request", "color": COLORS["success"]},
{"name": "pull_request_closed", "octicon": "git-pull-request-closed", "color": COLORS["danger"]},
{"name": "pull_request_draft", "octicon": "git-pull-request-draft", "color": COLORS["muted"]},
{"name": "pull_request_merged", "octicon": "git-merge", "color": COLORS["done"]},
{"name": "discussion", "octicon": "comment-discussion", "color": COLORS["success"]},
{"name": "discussion_answered", "octicon": "discussion-closed", "color": COLORS["success"]},
{"name": "discussion_closed", "octicon": "discussion-closed", "color": COLORS["done"]},
{"name": "discussion_duplicate", "octicon": "discussion-duplicate", "color": COLORS["muted"]},
{"name": "discussion_outdated", "octicon": "discussion-outdated", "color": COLORS["muted"]},
]
TYPES_LIST = [octicon["name"] for octicon in TYPES]
def convert_name(name: str) -> str:
return f"issuecards_{name.replace('-', '_').replace('git_', '')}"