Create jobs that keeps running after interval in custom commands bot

Md Shahriyar Alam

2 months ago

In custom commands bot jobs run automatically after a given amount time, once a job is started it will keep running itself on the given interval until its cancelled

For example lets say you want to run a clock event every hour

pyawait start_job(
  custom_id="hourly_job",
  freq="hour",
  interval=1,
  minute=0,
  second=0
)

This codes run the clock event with hourly_job once every hour (because interval is 1), if you want to run every 2 hour, just make interval=2 so it run once in every 2 hour

What about every day? Simple…

pyawait start_job(
  custom_id="daily_job",
  freq="day",
  interval=1,
  hour=12,
  minute=0,
  second=0
)

Every week

pyawait start_job(
  custom_id="weekly_job",
  freq="week",
  day_name="sunday",
  interval=1,
  hour=12,
  minute=0,
  second=0
)
# every sunday 12:00:00

Every month

pyawait start_job(
  custom_id="monthly_job",
  freq="month",
  interval=1,
  date=1,
  hour=12,
  minute=0,
  second=0
)
# every month's 1st day, 12:00:00

Every year

pyawait start_job(
  custom_id="yearly_job",
  freq="year",
  interval=1,
  month=1,
  date=1,
  hour=12,
  minute=0,
  second=0
)
# every year 1st January, 12:00:00

Need help?

If you still need any kind of help, have a suggestion for us or having a question in mind? Feel free to reach us out.

DiscordJoin support server
logoCustom Commands

#1 Custom commands discord bot available on the internet

stripe

Contact

20-22 Wenlock RoadEnglandN1 7GU

© WEiRDSOFT LTD. All rights reserved.