Files
bot-news-linux-gaming/config.py

52 lines
1.5 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env python3
try:
import keys
except ImportError:
raise ImportError("Файл keys.py не найден. Создайте его с необходимыми конфигурационными параметрами.")
URL_POST = "https://linux-gaming.ru/posts.json"
URL_NEWS = f"https://linux-gaming.ru/c/news/{keys.cat_num}.json"
URL_VK_POST = "https://api.vk.ru/method/wall.post"
URL_VK_GET = "https://api.vk.ru/method/wall.get"
URL_CHANGELOG = "https://gitlab.eterfund.ru/Castro-Fidel/PortWINE/raw/master/data_from_portwine/changelog_ru"
HEADERS_SITE = {
"Content-Type": "application/json",
"Api-Key": keys.api_key_site,
"Api-Username": "linux-gaming"
}
PARAMS_VK_GET = {
'access_token': keys.user_token_vk,
'v': '5.199',
'owner_id': str(keys.own_id),
'count': str(100),
'offset': str(0),
'filter': 'all'
}
TELEGRAM_CONFIG = {
'api_id': keys.api_id_tg,
'api_hash': keys.api_hash_tg,
'session_file': 'LG_news',
'channel_username': keys.channel_username_tg,
'topic_id': getattr(keys, 'telegram_topic_id', None) # ID топика для публикации
}
VK_CONFIG = {
'api_key': keys.api_key_vk,
'user_token': keys.user_token_vk,
'owner_id': keys.own_id
}
SITE_CONFIG = {
'category_num': keys.cat_num,
'start_topic_id': keys.start_topic_id
}
DISCORD_CONFIG = {
'enabled': getattr(keys, 'discord_enabled', False),
'token': getattr(keys, 'discord_token', ''),
'channel_id': getattr(keys, 'dicord_channel', None)
}