[text] 1

Viewer

  1. async def rem(ctx, message, hour, minutes, day, month, bot):
  2.     # Separar los argumentos del mensaje
  3.     print("Program")
  4.     # Crear objeto datetime con la fecha y hora especificadas
  5.     zona_horaria = pytz.timezone('Europe/Madrid')
  6.     fecha_inicial = datetime.now(zona_horaria)
  7.     fecha_inicial = fecha_inicial.strftime('%H:%M:%S')
  8.     
  9.     fecha_final = datetime(2023, 3, 24, 18, 40)
  10.     fecha_final = fecha_final.strftime('%H:%M:%S')
  11.     await ctx.response.send_message("Fecha de início: " + str(fecha_inicial) + "\n" + "Fecha del evento: " + str(fecha_final))
  12.  
  13.    
  14.     # Calcular el tiempo restante hasta la fecha y hora especificadas
  15.     time_left = fecha_final - fecha_inicial
  16.     print(time_left)
  17.     text = message
  18.     # Iniciar temporizador para enviar el mensaje en la fecha y hora especificadas
  19.     asyncio.get_event_loop().create_task(send_announcement(text, fecha_final, bot))

Editor

You can edit this paste and save as new:


File Description
  • 1
  • Paste Code
  • 24 Mar-2023
  • 912 Bytes
You can Share it: