|
|
|
@ -12,9 +12,12 @@ import html2text |
|
|
|
|
import urllib |
|
|
|
|
|
|
|
|
|
config_path = os.path.join(os.path.dirname(sys.argv[0]), "config.toml") |
|
|
|
|
loaded_config = toml.load(config_path) |
|
|
|
|
loaded_config = { |
|
|
|
|
"name": "cringebot", |
|
|
|
|
"ocr": False, |
|
|
|
|
**toml.load(config_path)} |
|
|
|
|
|
|
|
|
|
OCR = loaded_config.get("ocr", False) |
|
|
|
|
OCR = loaded_config["ocr"] |
|
|
|
|
|
|
|
|
|
if OCR: |
|
|
|
|
from PIL import Image |
|
|
|
@ -40,6 +43,11 @@ TIME_OF_DAY = { |
|
|
|
|
class CringeBotClient(BotClient): |
|
|
|
|
def __init__(self, bot, config): |
|
|
|
|
config = { |
|
|
|
|
"app_name": "Cringebot", |
|
|
|
|
"rate_limit": 3, |
|
|
|
|
"retry_rate": 60, |
|
|
|
|
"poll_interval": 15, |
|
|
|
|
"max_age": 600, |
|
|
|
|
"db_dir": ".", |
|
|
|
|
"cringe_dir": "data/cringe", |
|
|
|
|
"based_dir": "data/based", |
|
|
|
|