Skip to content

Commit 017f05c

Browse files
author
botON
committed
feat(voting): add vote_count command with admin restriction
Introduced a new command, vote_count, to tally votes and restricted access to admins using the @admin_needed decorator. This enhances the voting functionality by allowing authorized users to view the total votes cast.
1 parent 5205dc2 commit 017f05c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/pycamp_bot/commands/voting.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ async def end_voting(update, context):
125125
await update.message.reply_text("Selección cerrada")
126126
await msg_to_active_pycamp_chat(context.bot, "La selección de proyectos ha finalizado.")
127127

128+
129+
@admin_needed
128130
async def vote_count(update, context):
129131
votes = [vote.pycampista_id for vote in Vote.select()]
130132
vote_count = len(set(votes))

0 commit comments

Comments
 (0)