forked from ehchobyah/EhBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
35 lines (25 loc) · 1.01 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import configparser
from jinja2 import Environment,FileSystemLoader
from datetime import tzinfo
from datetime import timedelta
PREFIX = "!"
# Читаем переменные из settings.ini
CONFIG = configparser.ConfigParser()
CONFIG.read("settings.ini")
# Создаем список эмодзи
with open('./emojis.txt', 'r', encoding='utf-8') as emoji_file:
EMOJI_LIST = [line.strip() for line in emoji_file.readlines()]
# Загрузка окружения для темплейтов
TEMP_ENV = Environment(loader=FileSystemLoader('templates'),enable_async=True)
# Создаем список аватаров
with open('./avatars.txt', 'r', encoding='utf-8') as flags_file:
AVATAR_LIST = [line.strip() for line in flags_file.readlines()]
class MSK(tzinfo):
def utcoffset(self, dt):
return timedelta(hours=3)
def dst(self, dt):
return timedelta(seconds=0)
def tzname(self, dt):
return 'MSK'
def __repr__(self):
return f'<{self.__class__.__name__}+03:00>'