diff --git a/.gitignore b/.gitignore index 907f308..00d2acf 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,6 @@ Caddyfile *.dump.sql -.vscode \ No newline at end of file +.vscode + +node_modules/ diff --git a/orders.py b/orders.py index 7ffd05f..d13f9b6 100644 --- a/orders.py +++ b/orders.py @@ -7,7 +7,7 @@ from generate import generate_order, generate_punishment from db.queries import order_status_by_id, order_status_put, order_status_confirm from mastodon import Mastodon from telegram.telegram import Telegram -from settings import ORDER_TIMEOUT, ENV, MASTODON_INSTANCE +from settings import ENV from util import timezone logger = logging.getLogger(__name__) @@ -75,7 +75,8 @@ async def order_issue(orders_pool): orders_str = "\n".join(orders_info['orders']) created_at = datetime.datetime.now(tz=timezone()) - due_at = created_at + ORDER_TIMEOUT + if orders_pool.confirm_delay is not None: + due_at = created_at + datetime.timedelta(hours=orders_pool.confirm_delay) repeats_count = orders_info.get('count', 0) diff --git a/orders.yml b/orders.yml deleted file mode 100644 index 0edf867..0000000 --- a/orders.yml +++ /dev/null @@ -1,61 +0,0 @@ -orders_probability: 0.7 -orders: - - text: "MX Pants + MX Boots" - weight: 20 - repeat: 0.7 - add: - - text: "+ Leather Collar" - probability: 0.5 - - text: "Race Pants + MX Boots" - weight: 20 - repeat: 0.7 - add: - - text: "+ Leather Collar" - probability: 0.5 - - text: "Marine Uniform" - weight: 50 - repeat: 0.7 - add: - - text: "+ Leg shackles" - probability: 0.9 - - text: "+ Leather Collar" - probability: 0.5 - - text: "Army Uniform" - weight: 30 - repeat: 0.7 - add: - - text: "+ Leg Shackles" - probability: 0.9 - - text: "+ Leather Collar" - probability: 0.5 - - text: "HiViz Overalls + Haix Boots" - weight: 20 - repeat: 0.7 - add: - - text: "+ Leather Collar" - probability: 0.5 - - text: "e.s. Pants + Work Boots" - weight: 20 - repeat: 0.7 - add: - - text: "+ Leather Collar" - probability: 0.5 -punishments: - - text: "Kneel facing a wall for 30 minutes" - weight: 20 - - text: "Kneel facing a wall for 60 minutes" - weight: 5 - - text: "4 hours of ball stretcher time" - weight: 40 - - text: "6 hours of ball stretcher time" - weight: 5 - - text: "2 hours of small butt plug time" - weight: 20 - - text: "1 hour of large butt plug time" - weight: 20 - - text: "2 hours of large butt plug time" - weight: 5 - - text: "2 hours of electro ball torture" - weight: 20 - - text: "4 hours of electro ball torture" - weight: 5 diff --git a/settings.py b/settings.py index 4753ff5..541a9b0 100644 --- a/settings.py +++ b/settings.py @@ -3,14 +3,10 @@ import datetime ENV = os.environ.get('ENV', 'dev') -ORDER_TIME = os.environ.get('ORDER_TIME', '9:00') -ORDER_TIMEOUT = datetime.timedelta( - hours=os.environ.get('ORDER_TIMEOUT', 3) -) - MASTODON_INSTANCE = os.environ.get("MASTODON_INSTANCE") MASTODON_ACCESS_TOKEN = os.environ.get('MASTODON_ACCESS_TOKEN') MASTODON_VISIBILITY = os.environ.get('MASTODON_VISIBILITY', 'direct') +MASTODON_CC_LIST = os.environ.get('MASTODON_CC_LIST', '') MASTODON_OAUTH_SCOPES = os.environ.get('MASTODON_OAUTH_SCOPES', 'profile') MASTODON_OAUTH_REDIRECT_URI = os.environ.get('MASTODON_OAUTH_REDIRECT_URI') diff --git a/util.py b/util.py index 269fdbf..c7c592c 100644 --- a/util.py +++ b/util.py @@ -2,7 +2,7 @@ import aiohttp import pytz import datetime -from settings import TIMEZONE, ORDER_TIME +from settings import TIMEZONE def make_session(): return aiohttp.ClientSession()