Skip to content

Commit ec66af6

Browse files
committed
Use names when showing difficulty levels
1 parent b0b505f commit ec66af6

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/pycamp_bot/commands/projects.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111

1212
current_projects = {}
1313
NOMBRE, DIFICULTAD, TOPIC = ["nombre", "dificultad", "topic"]
14+
DIFFICULTY_LEVEL_NAMES = {
15+
1: 'inicial',
16+
2: 'intermedio',
17+
3: 'avanzado',
18+
}
1419

1520
logger = logging.getLogger(__name__)
1621

@@ -70,10 +75,10 @@ async def naming_project(update, context):
7075
)
7176
await context.bot.send_message(
7277
chat_id=update.message.chat_id,
73-
text="""Cual es el nivel de dificultad?
74-
1 = newbie friendly
75-
2 = intermedio
76-
3 = python avanzado"""
78+
text=f"""Cual es el nivel de dificultad?
79+
1 = {DIFFICULTY_LEVEL_NAMES[1]}
80+
2 = {DIFFICULTY_LEVEL_NAMES[2]}
81+
3 = {DIFFICULTY_LEVEL_NAMES[3]}"""
7782
)
7883
return DIFICULTAD
7984

@@ -240,7 +245,7 @@ async def show_projects(update, context):
240245
project.name,
241246
project.owner.username,
242247
project.topic,
243-
project.difficult_level
248+
DIFFICULTY_LEVEL_NAMES[project.difficult_level]
244249
)
245250
participants_count = Vote.select().where(
246251
(Vote.project == project) & (Vote.interest)).count()

0 commit comments

Comments
 (0)