diff --git a/Dockerfile b/Dockerfile index 978baef..25ea519 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.8.10-alpine +FROM python:3.8.10 # Create app directory WORKDIR /usr/src/app diff --git a/src/utils/utils.py b/src/utils/utils.py index a2e7c40..530a5ff 100644 --- a/src/utils/utils.py +++ b/src/utils/utils.py @@ -1,4 +1,4 @@ -from enum import Enum +from enum import IntEnum from typing import Callable, List, Dict, Union, Optional, Any import os import logging @@ -51,7 +51,7 @@ def deltas(t0: datetime): return (datetime.now() - t0).total_seconds() -class FilterLevel(Enum): +class FilterLevel(IntEnum): NONE = 0 ALLOW = 1 ONLY = 2 @@ -113,7 +113,7 @@ def should_allow_spoiler(message: discord.Message, spoiler: FilterLevel) -> bool is_spoiler = is_image_spoiler(message) return ( not is_spoiler - and spoiler <= FilterLevel.ALLOW + and spoiler <= FilterLevel.ONLY or is_spoiler and spoiler >= FilterLevel.ALLOW )