-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathconstants.py
187 lines (161 loc) · 4.57 KB
/
constants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
from dataclasses import dataclass
from enum import Enum
import discord
class Period(Enum):
DAY = "day"
WEEK = "week"
MONTH = "month"
ALLTIME = "alltime"
class DifficultyScore(Enum):
EASY = 1
MEDIUM = 3
HARD = 7
class Difficulty(Enum):
EASY = 1
MEDIUM = 2
HARD = 3
RANDOM = 4
class RankEmoji(Enum):
FIRST = "🥇"
SECOND = "🥈"
THIRD = "🥉"
class Language(Enum):
PYTHON3 = "python"
JAVA = "java"
CPP = "c++"
C = "c"
CSHARP = "c#"
JAVASCRIPT = "javascript"
GO = "go"
KOTLIN = "kotlin"
RUBY = "ruby"
SWIFT = "swift"
RUST = "rust"
SCALA = "scala"
TYPESCRIPT = "typescript"
DART = "dart"
class StatsCardExtensions(Enum):
ACTIVITY = "activity"
HEATMAP = "heatmap"
CONTEST = "contest"
NONE = "none"
class NotificationOptions(Enum):
MAINTENANCE = "maintenance"
DAILY_QUESTION = "daily_question"
WINNERS = "winners"
class CodeGrindMilestone(Enum):
NOVICE = "Novice"
APPRENTICE = "Apprentice"
CAPABLE = "Capable"
COMPETENT = "Competent"
ADVANCED = "Advanced"
EXPERT = "Expert"
MASTER = "Master"
LEGEND = "Legend"
class CodeGrindStreak(Enum):
INITIATE = "Streak Initiate"
PURSUER = "Streak Pursuer"
ADVENTURER = "Streak Adventurer"
DOMINATOR = "Streak Dominator"
LEGEND = "Streak Legend"
@dataclass
class CodeGrindTierInfo:
threshold: int
title: str
role_name: str
role_colour: discord.Colour
icon_path: str | None = None
GLOBAL_LEADERBOARD_ID = 0
# Threshold is in points.
MILESTONE_ROLES = {
CodeGrindMilestone.NOVICE: CodeGrindTierInfo(
threshold=1,
title="Novice",
role_name="Novice (1 pt)",
role_colour=discord.Colour.dark_grey(),
icon_path="./ui/assets/milestones/novice.png",
),
CodeGrindMilestone.APPRENTICE: CodeGrindTierInfo(
threshold=100,
title="Apprentice",
role_name="Apprentice (100 pts)",
role_colour=discord.Colour.green(),
icon_path="./ui/assets/milestones/apprentice.png",
),
CodeGrindMilestone.CAPABLE: CodeGrindTierInfo(
threshold=300,
title="Capable",
role_name="Capable (300 pts)",
role_colour=discord.Colour.blue(),
icon_path="./ui/assets/milestones/capable.png",
),
CodeGrindMilestone.COMPETENT: CodeGrindTierInfo(
threshold=500,
title="Competent",
role_name="Competent (500 pts)",
role_colour=discord.Colour.dark_blue(),
icon_path="./ui/assets/milestones/competent.png",
),
CodeGrindMilestone.ADVANCED: CodeGrindTierInfo(
threshold=1000,
title="Advanced",
role_name="Advanced (1000 pts)",
role_colour=discord.Colour.orange(),
icon_path="./ui/assets/milestones/advanced.png",
),
CodeGrindMilestone.EXPERT: CodeGrindTierInfo(
threshold=2000,
title="Expert",
role_name="Expert (2000 pts)",
role_colour=discord.Colour.red(),
icon_path="./ui/assets/milestones/expert.png",
),
CodeGrindMilestone.MASTER: CodeGrindTierInfo(
threshold=4000,
title="Master",
role_name="Master (4000 pts)",
role_colour=discord.Colour.purple(),
icon_path="./ui/assets/milestones/master.png",
),
CodeGrindMilestone.LEGEND: CodeGrindTierInfo(
threshold=6000,
title="Legend",
role_name="Legend (6000 pts)",
role_colour=discord.Colour.gold(),
icon_path="./ui/assets/milestones/legend.png",
),
}
# Threshold is in days.
STREAK_ROLES = {
CodeGrindStreak.INITIATE: CodeGrindTierInfo(
threshold=3,
title="Streak Initiate",
role_name="Streak Initiate (3 Days)",
role_colour=discord.Colour.green(),
),
CodeGrindStreak.PURSUER: CodeGrindTierInfo(
threshold=7,
title="Streak Pursuer",
role_name="Streak Pursuer (7 Days)",
role_colour=discord.Colour.blue(),
),
CodeGrindStreak.ADVENTURER: CodeGrindTierInfo(
threshold=14,
title="Streak Advent",
role_name="Streak Adventurer (14 Days)",
role_colour=discord.Colour.red(),
),
CodeGrindStreak.DOMINATOR: CodeGrindTierInfo(
threshold=30,
title="Streak Dominator",
role_name="Streak Dominator (30 Days)",
role_colour=discord.Colour.purple(),
),
CodeGrindStreak.LEGEND: CodeGrindTierInfo(
threshold=90,
title="Streak Legend",
role_name="Streak Legend (90 Days)",
role_colour=discord.Colour.gold(),
),
}
VERIFIED_ROLE = "CodeGrind Verified"