sycgram/tools/constants.py

56 lines
2.1 KiB
Python
Raw Normal View History

2022-04-06 14:39:27 +00:00
from typing import Dict, List
# ------------- rate --------------
RATE_API: str = 'https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies'
HTTP_HEADERS: Dict[str, str] = {
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
"(KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36"
}
# ------------- speedtest --------------
SPEEDTEST_PATH_FILE: str = './data/speedtest'
SPEEDTEST_CLI: str = "https://install.speedtest.net/app/cli/ookla-speedtest-1.1.1-linux-<arch>.tgz"
INSTALL_SPEEDTEST: str = f"wget -qO- {SPEEDTEST_CLI} | tar zx -C ./data speedtest"
SPEEDTEST_RUN: str = f'{SPEEDTEST_PATH_FILE} --accept-license --accept-gdpr -f json'
# ------------- sticker --------------
STICKER_BOT: int = 429000
STICKER_IMG: str = './data/img/tmp.png'
STICKER_DESCRIP: str = b'A Telegram user has created the Sticker\xc2\xa0Set.'.decode('utf-8')
GT_120_STICKERS: str = "Whoa! That's probably enough stickers for one set, " \
"give it a break. A set can't have more than 120 stickers at the moment."
UNACCEPTABLE_SET_NAME: str = 'Sorry, this short name is unacceptable.'
TAKEN_SET_NAME: str = 'Sorry, this short name is already taken.'
INVALID_SET_NAME: str = 'Invalid set selected.'
STICKER_ERROR_LIST: List[str] = [
GT_120_STICKERS,
UNACCEPTABLE_SET_NAME,
TAKEN_SET_NAME,
INVALID_SET_NAME,
]
# ------------- cc & trace --------------
REACTIONS: list[str] = ['👍', '👎', '❤️', '🔥', '🥰', '👏',
'😁', '🤔', '🤯', '😱', '🤬', '😢',
'🎉', '🤩', '🤮', '💩']
CC_MAX_TIMES: int = 233
# ------------- ghost --------------
GHOST_INTERVAL: float = 1.5
# ------------- other --------------
TG_GROUP: str = 'group'
TG_SUPERGROUP: str = 'supergroup'
TG_CHANNEL: str = 'channel'
TG_BOT: str = 'bot'
TG_PRIVATE: str = 'private'
TG_GROUPS: List[str] = ['group', 'supergroup']
# ------------- Store -------------
STORE_CC_DATA: str = 'data:cc'
STORE_NOTES_DATA: str = 'data:notes'
STORE_TRACE_DATA: str = 'data:trace'
STORE_GHOST_DATA: str = 'data:ghost'
STORE_GHOST_CACHE: str = 'cache:ghost'