Implement /schedule
Allows matchers to schedule repeated weekly runs on a given weekday and hour Can schedule multiple runs Scheduled runs can be cancelled with cancel:True in the command /list also shows any scheduled commands in that channel
This commit is contained in:
parent
522f89cff9
commit
07485ceb8d
4 changed files with 244 additions and 44 deletions
14
py/config.py
14
py/config.py
|
@ -1,5 +1,5 @@
|
|||
"""Very simple config loading library"""
|
||||
from schema import Schema, And, Use, Optional
|
||||
from schema import Schema, Use, Optional
|
||||
import files
|
||||
import os
|
||||
import logging
|
||||
|
@ -32,19 +32,19 @@ class _Key():
|
|||
_SCHEMA = Schema(
|
||||
{
|
||||
# The current version
|
||||
_Key.VERSION: And(Use(int)),
|
||||
_Key.VERSION: Use(int),
|
||||
|
||||
# Discord bot token
|
||||
_Key.TOKEN: And(Use(str)),
|
||||
_Key.TOKEN: Use(str),
|
||||
|
||||
# Settings for the match algorithmn, see matching.py for explanations on usage
|
||||
Optional(_Key.MATCH): {
|
||||
Optional(_Key.SCORE_FACTORS): {
|
||||
|
||||
Optional(_Key.REPEAT_ROLE): And(Use(int)),
|
||||
Optional(_Key.REPEAT_MATCH): And(Use(int)),
|
||||
Optional(_Key.EXTRA_MEMBER): And(Use(int)),
|
||||
Optional(_Key.UPPER_THRESHOLD): And(Use(int)),
|
||||
Optional(_Key.REPEAT_ROLE): Use(int),
|
||||
Optional(_Key.REPEAT_MATCH): Use(int),
|
||||
Optional(_Key.EXTRA_MEMBER): Use(int),
|
||||
Optional(_Key.UPPER_THRESHOLD): Use(int),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue