Skip to content

Commit 2747dc8

Browse files
committed
merge resoved
1 parent 6f9e6bc commit 2747dc8

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

src/pycamp_bot/commands/manage_pycamp.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,5 @@ def set_handlers(application):
176176
CommandHandler('voy_al_pycamp', add_pycampista_to_pycamp))
177177
application.add_handler(
178178
CommandHandler('pycampistas', list_pycampistas))
179+
180+

src/pycamp_bot/commands/raffle.py

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,13 @@
55

66

77
@admin_needed
8-
async def raffle(update, context):
9-
await context.bot.send_message(
10-
chat_id=update.message.chat_id,
11-
text="Voy a sortear algo entre todxs lxs Pycampistas!"
12-
)
13-
await context.bot.send_message(
14-
chat_id=update.message.chat_id,
15-
text="Y la persona ganadora eeeeeeeeeeeeessss...."
16-
)
17-
pycampistas = Pycampista.select(Pycampista.username)
18-
lista_pycampistas = [persona.username for persona in pycampistas]
19-
persona_ganadora = random.choice(lista_pycampistas)
20-
await context.bot.send_message(
21-
chat_id=update.message.chat_id,
22-
text="@{}".format(persona_ganadora)
23-
)
24-
8+
async def get_random_user(update, context):
9+
cantidad_campistas = Pycampista.select().count()
10+
index_random = random.randint(1,cantidad_campistas)
11+
user_name = Pycampista.get_by_id(index_random).username
12+
await update.message.reply_text(user_name)
2513

2614
def set_handlers(application):
27-
application.add_handler(CommandHandler('sorteo', raffle))
15+
application.add_handler(
16+
CommandHandler('rifar', get_random_user))
17+

src/pycamp_bot/commands/voting.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ 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+
import pdb; pdb.set_trace()
123+
Vote.sele .select().count()
124+
121125

122126
def set_handlers(application):
123127
application.add_handler(
@@ -128,3 +132,5 @@ def set_handlers(application):
128132
CommandHandler('votar', vote))
129133
application.add_handler(
130134
CommandHandler('terminar_votacion_proyectos', end_voting))
135+
application.add_handler(
136+
CommandHandler('contar_votos', vote_count))

0 commit comments

Comments
 (0)