File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -94,8 +94,36 @@ async def summon_wizard(update, context):
9494 text = "Tu magx asignadx es: @{}" .format (wizard .username )
9595 )
9696
97+
98+ @admin_needed
99+ async def schedule_wizards (update , context ):
100+ _ , pycamp = get_active_pycamp ()
101+ logger .info (pycamp )
102+
103+ schedule = define_wizards_schedule (pycamp )
104+
105+ for slot , wizard in schedule .items ():
106+ start , end = slot
107+ WizardAtPycamp .create (
108+ pycamp = pycamp ,
109+ wizard = wizard ,
110+ slot_ini = start ,
111+ slot_end = end
112+ )
113+ logger .debug ("From {} to {} the wizard is {}" .format (start , end , wizard .username ))
114+
115+ # Mandar mensajes a los magos con su agenda propia
116+ msg = "Lista la agenda de magos."
117+ await context .bot .send_message (
118+ chat_id = update .message .chat_id ,
119+ text = msg
120+ )
121+
122+
97123def set_handlers (application ):
98124 application .add_handler (
99125 CommandHandler ('evocar_magx' , summon_wizard ))
100126 application .add_handler (
101127 CommandHandler ('ser_magx' , become_wizard ))
128+ application .add_handler (
129+ CommandHandler ('agendar_magos' , schedule_wizards ))
You can’t perform that action at this time.
0 commit comments