Worldbuilding / kaztron

A custom Discord bot for various writing communities
http://worldbuilding.network/kaztron
Other
5 stars 8 forks source link

Framework for scheduled messages and callbacks #171

Closed Laogeodritt closed 6 years ago

Laogeodritt commented 6 years ago

Create a framework in the core for:

This should effectively just be a little syntactic sugar for the

async def scheduled_task(self):
    await asyncio.sleep(get_time_in_seconds())
    do_something_else()

paradigm that's used everywhere, along with the management of starting and cancelling the task (maybe allow specifying a unique identifier, or having some form of identifier + unique/non-unique option?).

Existing cogs to adapt:

Related issues: #167 #127 #96

Laogeodritt commented 6 years ago

Should look further into the Task API and capabilities, e.g.: http://masnun.com/2015/11/20/python-asyncio-future-task-and-the-event-loop.html

Laogeodritt commented 6 years ago

Scheduler framework added in b04001f (+ subsequent)

Laogeodritt commented 6 years ago

415ce37 - reminders updated

Laogeodritt commented 6 years ago

af960c8 - sprint