Merge pull request #46 from Klemek/dev

bug fix
This commit is contained in:
Klemek
2021-05-19 15:34:48 +02:00
committed by GitHub
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
FROM python:3.8.10-alpine
FROM python:3.8.10
# Create app directory
WORKDIR /usr/src/app
+3 -3
View File
@@ -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
)