File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -118,8 +118,13 @@ async def end_voting(update, context):
118118 await update .message .reply_text ("Selección cerrada" )
119119 await msg_to_active_pycamp_chat (context .bot , "La selección de proyectos ha finalizado." )
120120
121- #def vote_count(update, context):
122-
121+ async def vote_count (update , context ):
122+ votes = [vote .pycampista_id for vote in Vote .select ()]
123+ vote_count = len (set (votes ))
124+ await context .bot .send_message (
125+ chat_id = update .message .chat_id ,
126+ text = f"Votaron: { vote_count } "
127+ )
123128
124129
125130def set_handlers (application ):
@@ -131,5 +136,5 @@ def set_handlers(application):
131136 CommandHandler ('votar' , vote ))
132137 application .add_handler (
133138 CommandHandler ('terminar_votacion_proyectos' , end_voting ))
134- # application.add_handler(
135- # CommandHandler('contar_votos', vote_count))
139+ application .add_handler (
140+ CommandHandler ('contar_votos' , vote_count ))
You can’t perform that action at this time.
0 commit comments