This commit is contained in:
2025-09-08 16:56:34 +07:00
parent 0f05fc8455
commit a92d130502
15 changed files with 420 additions and 358 deletions

View File

@@ -1,92 +1,161 @@
# Токены бота # ================== ТОКЕНЫ ==================
BOT_TOKEN=your_bot_token_here
BOT_DEBUG_TOKEN=your_debug_bot_token_here
# Режим отладки # Рабочий токен бота (обязателен в обычном режиме)
BOT_TOKEN=
# Токен для режима отладки (обязателен при DEBUG=True)
BOT_DEBUG_TOKEN=
# Режим отладки (True/False)
DEBUG=False DEBUG=False
# Владелец бота
# ================== БОТ ==================
# Имя проекта
PROJECT_NAME=PRIMO
# Имя бота
BOT_NAME="Первозданная Жемчужина"
# Полное описание бота
BOT_DESCRIPTION=
# Краткое описание
BOT_SHORT_DESCRIPTION=
# ================== БАЗОВЫЕ НАСТРОЙКИ ==================
# Буферизация вывода Python (1 = без буфера, 0 = с буфером)
PYTHONUNBUFFERED=1
# Локаль (папка с переводами)
LOCALE_PATH=locales
# Владелец (@юзернейм в Telegram)
OWNER=@verdise OWNER=@verdise
# Основные настройки
# ================== РОЛЕВОЙ ПРОЕКТ ==================
# Название ролевого проекта
RP_NAME="𝘗𝘳𝘪𝘮𝘰 𝘞𝘰𝘳𝘭𝘥"
# Ссылки на каналы/чаты
INFO_URL=https://t.me/PrimoWorldRP
FLUD_URL=https://t.me/PrimoWorldRP
RP_URL=https://t.me/PrimoWorldRP
LIFE_URL=https://t.me/PrimoWorldRP
# Владелец ролевого проекта
RP_OWNER=
# Роли (список, можно хранить через запятую)
ROLES=Альбедо,Чжун Ли,Кэйа
# ================== ВЕБХУК ==================
# Использовать вебхук (True/False)
WEBHOOK=False
# Публичный HTTPS URL для вебхука
WEBHOOK_URL=https://bot.primo.dpdns.org/webhook
# Хост для uvicorn внутри контейнера
WEBAPP_HOST=0.0.0.0
# Порт для uvicorn
WEBAPP_PORT=3131
# Уровень логирования (debug/info/warning/error/critical)
LOG_LEVEL=warning
# Вести access-лог (True/False)
ACCES_LOG=False
# ================== НАСТРОЙКИ СООБЩЕНИЙ ==================
# Режим парсинга текста (HTML / Markdown / MarkdownV2)
PARSE_MODE=HTML PARSE_MODE=HTML
# Кодировка
ENCOD=utf-8 ENCOD=utf-8
# Формат времени
TIME_FORMAT=%Y-%m-%d %H:%M:%S TIME_FORMAT=%Y-%m-%d %H:%M:%S
# Префиксы команд (например: /!.&?)
PREFIX=/!.&? PREFIX=/!.&?
# Язык/платформа
BOT_LANGUAGE=Aiogram3 BOT_LANGUAGE=Aiogram3
# Настройки сообщений # ================== ЛОГИ ==================
DISABLE_NOTIFICATION=False
PROTECT_CONTENT=False
ALLOW_SENDING_WITHOUT_REPLY=True
LINK_PREVIEW_IS_DISABLED=False
LINK_PREVIEW_PREFER_SMALL_MEDIA=False
LINK_PREVIEW_PREFER_LARGE_MEDIA=True
LINK_PREVIEW_SHOW_ABOVE_TEXT=False
SHOW_CAPTION_ABOVE_MEDIA=False
# Разрешения # Включить вывод в консоль (True/False)
BOT_EDIT=False
START_INFO_CONSOLE=True
START_INFO_TO_FILE=True
# Логирование
LOG_CONSOLE=True LOG_CONSOLE=True
# Включить запись логов в файл (True/False)
LOG_FILE=True LOG_FILE=True
# Папка для логов
LOG_DIR=Logs LOG_DIR=Logs
# Имя файла для логов
LOG_FILE_INFO=bot_info.log LOG_FILE_INFO=bot_info.log
# Вебхук
WEBHOOK=False
# API ключи # ================== API ==================
API_KEY=your_api_key
WEB_API_KEY=your_web_api_key
WEATHER_API_KEY=your_weather_api_key
# Telegram API ID и HASH # Основной API-ключ
TG_API_UID=123456 API_KEY=
TG_API_HASH=your_tg_api_hash
# Веб-API ключ
WEB_API_KEY=
# Ключ для погоды
WEATHER_API_KEY=
# Важные ID
ADMIN_ID=123456789 # ================== ПОЛЬЗОВАТЕЛЬСКИЕ ДАННЫЕ ==================
MODERATOR_ID=987654321
IMPORTANT_ID=1122334455 # Telegram API ID (int)
IMPORTANT_GROUP_ID=-1001122334455 TG_API_UID=0
IMPORTANT_CHANNEL_ID=-1009988776655
# Telegram API HASH
TG_API_HASH=
# Настройки бота
PROJECT_NAME=PRIMO
BOT_NAME=Первозданная Жемчужина
BOT_DESCRIPTION=Ваш помощник в удивительные миры! Prod. by:『@verdise』
BOT_SHORT_DESCRIPTION=Тех.поддержка: @verdise
# Настройки ролевого проекта # ================== ИДЕНТИФИКАТОРЫ ==================
RP_NAME: str = "𝘗𝘳𝘪𝘮𝘰 𝘞𝘰𝘳𝘭𝘥"
# ID администраторов (список чисел через запятую)
ADMIN_ID=
# Права администратора # ID модератора
ANONYMOUS=False MODERATOR_ID=0
MANAGE_CHAT=True
CHANGE_INFO=True
PROMOTE_MEMBERS=True
RESTRICT_MEMBERS=True
POST_MESSAGE=True
MANAGE_TOPICS=True
INVITE_USER=True
DELETE_MESSAGES=True
MANAGE_VIDEO_CHATS=True
EDIT_MESSAGES=True
PIN_MESSAGE=True
POST_STORIES=True
EDIT_STORIES=True
DELETE_STORIES=True
# Важный ID (пользователь/чат)
IMPORTANT_ID=0
# Поддержка # ID важной группы
IMPORTANT_GROUP_ID=0
# ID важного канала
IMPORTANT_CHANNEL_ID=0
# ID чата поддержки
SUPPORT_CHAT_ID=0 SUPPORT_CHAT_ID=0

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.venv" />
</content>
<orderEntry type="jdk" jdkName="Python 3.13 (PrimoAranarBot)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

2
.idea/modules.xml generated
View File

@@ -2,7 +2,7 @@
<project version="4"> <project version="4">
<component name="ProjectModuleManager"> <component name="ProjectModuleManager">
<modules> <modules>
<module fileurl="file://$PROJECT_DIR$/.idea/YashaSystemBot.iml" filepath="$PROJECT_DIR$/.idea/YashaSystemBot.iml" /> <module fileurl="file://$PROJECT_DIR$/.idea/PythonProject.iml" filepath="$PROJECT_DIR$/.idea/PythonProject.iml" />
</modules> </modules>
</component> </component>
</project> </project>

242
.idea/workspace.xml generated
View File

@@ -4,155 +4,78 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="2643be13-7905-4315-bb25-9c65e899084f" name="Changes" comment=""> <list default="true" id="680839da-ebfb-41aa-b3dc-c95e51f8d3d6" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/.dockerignore" afterDir="false" /> <change afterPath="$PROJECT_DIR$/assets/arsenal_secret2.jpeg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.env_example" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.env_example" beforeDir="false" afterPath="$PROJECT_DIR$/.env_example" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.gitattributes" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/PrimoAranarBot.iml" beforeDir="false" />
<change afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/modules.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/PrimoAranarBot.iml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/vcs.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/inspectionProfiles/profiles_settings.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/bot/core/bots.py" beforeDir="false" afterPath="$PROJECT_DIR$/bot/core/bots.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/bot/handlers/commands/users/active.py" beforeDir="false" afterPath="$PROJECT_DIR$/bot/handlers/commands/users/active.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/bot/handlers/secret/__init__.py" beforeDir="false" afterPath="$PROJECT_DIR$/bot/handlers/secret/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Dockerfile" afterDir="false" /> <change beforePath="$PROJECT_DIR$/bot/handlers/secret/secret1.py" beforeDir="false" afterPath="$PROJECT_DIR$/bot/handlers/secret/secret1.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/LICENSE" afterDir="false" /> <change beforePath="$PROJECT_DIR$/bot/handlers/secret/secret2.py" beforeDir="false" afterPath="$PROJECT_DIR$/bot/handlers/secret/secret2.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/README.md" afterDir="false" /> <change beforePath="$PROJECT_DIR$/bot/utils/interesting_facts.py" beforeDir="false" afterPath="$PROJECT_DIR$/bot/utils/interesting_facts.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/assets/default.jpg" afterDir="false" /> <change beforePath="$PROJECT_DIR$/configs/config.py" beforeDir="false" afterPath="$PROJECT_DIR$/configs/config.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/assets/start.jpg" afterDir="false" /> <change beforePath="$PROJECT_DIR$/configs/roles.py" beforeDir="false" afterPath="$PROJECT_DIR$/configs/roles.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/__init__.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/middleware/loggers/logs.py" beforeDir="false" afterPath="$PROJECT_DIR$/middleware/loggers/logs.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/core/__init__.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/pyproject.toml" beforeDir="false" afterPath="$PROJECT_DIR$/pyproject.toml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/core/bots.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/core/webhook.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/filters/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/filters/callback.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/filters/chat_rights.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/filters/chat_type.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/filters/message_content.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/filters/subscrided.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/handlers/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/handlers/commands/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/handlers/commands/admins/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/handlers/commands/admins/settings_cmd.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/handlers/commands/users/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/handlers/commands/users/active.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/handlers/commands/users/anketa_cmd.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/handlers/commands/users/new_cmd.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/handlers/commands/users/start_cmd.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/handlers/messages/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/handlers/messages/default.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/handlers/messages/reply_msg.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/handlers/secret/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/handlers/secret/secret1.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/handlers/secret/secret2.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/keyboards/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/keyboards/inline/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/keyboards/inline/decision.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/keyboards/reply/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/middlewares/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/middlewares/error_mdw.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/middlewares/logging_mdw.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/middlewares/msg_mdw.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/middlewares/spam_mdw.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/middlewares/subscription_mdw.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/middlewares/time_mdw.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/states/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/states/anketa_states.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/states/new_states.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/templates/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/templates/message_callback.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/utils/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/utils/argument.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/utils/interesting_facts.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/utils/pagination.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/utils/random_lists.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/utils/type_message.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bot/utils/usernames.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/configs/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/configs/cmd_list.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/configs/config.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/configs/roles.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/database/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/database/database.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/locales/en/LC_MESSAGES/bot.mo" afterDir="false" />
<change afterPath="$PROJECT_DIR$/locales/en/LC_MESSAGES/bot.po" afterDir="false" />
<change afterPath="$PROJECT_DIR$/locales/messages.pot" afterDir="false" />
<change afterPath="$PROJECT_DIR$/locales/ru/LC_MESSAGES/bot.mo" afterDir="false" />
<change afterPath="$PROJECT_DIR$/locales/ru/LC_MESSAGES/bot.po" afterDir="false" />
<change afterPath="$PROJECT_DIR$/locales/uk/LC_MESSAGES/bot.mo" afterDir="false" />
<change afterPath="$PROJECT_DIR$/locales/uk/LC_MESSAGES/bot.po" afterDir="false" />
<change afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/middleware/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/middleware/loggers/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/middleware/loggers/logs.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/middleware/validators/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/middleware/validators/email_vld.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/middleware/validators/url_vld.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/pyproject.toml" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" /> <option name="LAST_RESOLUTION" value="IGNORE" />
</component> </component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Python Script" />
</list>
</option>
</component>
<component name="Git.Settings"> <component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component> </component>
<component name="KubernetesApiPersistence">{}</component> <component name="GitHubPullRequestSearchHistory">{
<component name="KubernetesApiProvider">{ &quot;lastFilter&quot;: {
&quot;isMigrated&quot;: true &quot;state&quot;: &quot;OPEN&quot;,
&quot;assignee&quot;: &quot;Whyverum&quot;
}
}</component>
<component name="GithubPullRequestsUISettings">{
&quot;selectedUrlAndAccountId&quot;: {
&quot;url&quot;: &quot;https://github.com/Whyverum/PrimoAranaraBot.git&quot;,
&quot;accountId&quot;: &quot;0f62da85-b1da-4c18-9e57-3daced58edde&quot;
}
}</component> }</component>
<component name="ProjectColorInfo">{ <component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 6 &quot;associatedIndex&quot;: 0
}</component> }</component>
<component name="ProjectId" id="30zwIGAUUSITtvba70bSTcC47qk" /> <component name="ProjectId" id="32P2csT3G3Y5r1zbGiF0CTQeIeJ" />
<component name="ProjectViewState"> <component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent">{ <component name="PropertiesComponent"><![CDATA[{
&quot;keyToString&quot;: { "keyToString": {
&quot;ModuleVcsDetector.initialDetectionPerformed&quot;: &quot;true&quot;, "ModuleVcsDetector.initialDetectionPerformed": "true",
&quot;Python.main.executor&quot;: &quot;Run&quot;, "Python.main.executor": "Run",
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;, "RunOnceActivity.ShowReadmeOnStart": "true",
&quot;RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager&quot;: &quot;true&quot;, "RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
&quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;, "RunOnceActivity.git.unshallow": "true",
&quot;git-widget-placeholder&quot;: &quot;master&quot;, "git-widget-placeholder": "master",
&quot;last_opened_file_path&quot;: &quot;C:/Users/admin/Documents/Projects/Python/PrimoAranarBot&quot;, "last_opened_file_path": "C:/Users/admin/PycharmProjects/PythonProject/assets",
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;, "node.js.detected.package.eslint": "true",
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;, "node.js.detected.package.tslint": "true",
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;, "node.js.selected.package.eslint": "(autodetect)",
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;, "node.js.selected.package.tslint": "(autodetect)",
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;, "nodejs_package_manager_path": "npm",
&quot;settings.editor.selected.configurable&quot;: &quot;com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable&quot;, "settings.editor.selected.configurable": "project.propVCSSupport.DirectoryMappings",
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot; "vue.rearranger.settings.migration": "true"
} }
}</component> }]]></component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="C:\Users\admin\Documents\Projects\Python\PrimoAranarBot" /> <recent name="C:\Users\admin\PycharmProjects\PythonProject\assets" />
<recent name="C:\Users\admin\Documents\Projects\Python\YashaSystemBot" />
<recent name="C:\Users\admin\Documents\Projects\Python\YashaSystemBot\middleware" />
<recent name="C:\Users\admin\Documents\Projects\Python\YashaSystemBot\locales\uk\LC_MESSAGES" />
<recent name="C:\Users\admin\Documents\Projects\Python\YashaSystemBot\locales\ru\LC_MESSAGES" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="C:\Users\admin\Documents\Projects\Python\PrimoAranarBot\bot\handlers\secret2" />
<recent name="C:\Users\admin\Documents\Projects\Python\PrimoAranarBot\bot\handlers" />
<recent name="C:\Users\admin\Documents\Projects\Python\YashaSystemBot" />
<recent name="C:\Users\admin\Documents\Projects\Python\YashaSystemBot\bot\core" />
<recent name="C:\Users\admin\Documents\Projects\Python\YashaSystemBot\middleware\loggers" />
</key> </key>
</component> </component>
<component name="RunManager"> <component name="RunManager">
<configuration name="main" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true"> <configuration name="main" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="PrimoAranarBot" /> <module name="PythonProject" />
<option name="ENV_FILES" value="" /> <option name="ENV_FILES" value="" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" /> <option name="PARENT_ENVS" value="true" />
@@ -160,9 +83,8 @@
<env name="PYTHONUNBUFFERED" value="1" /> <env name="PYTHONUNBUFFERED" value="1" />
</envs> </envs>
<option name="SDK_HOME" value="" /> <option name="SDK_HOME" value="" />
<option name="SDK_NAME" value="Python 3.13 (PrimoAranarBot)" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="false" /> <option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
@@ -184,75 +106,27 @@
<component name="SharedIndexes"> <component name="SharedIndexes">
<attachedChunks> <attachedChunks>
<set> <set>
<option value="bundled-js-predefined-d6986cc7102b-09060db00ec0-JavaScript-PY-251.26927.90" /> <option value="bundled-js-predefined-d6986cc7102b-b598e85cdad2-JavaScript-PY-252.25557.178" />
<option value="bundled-python-sdk-41e8cd69c857-64d779b69b7a-com.jetbrains.pycharm.pro.sharedIndexes.bundled-PY-251.26927.90" /> <option value="bundled-python-sdk-ce6832f46686-7b97d883f26b-com.jetbrains.pycharm.pro.sharedIndexes.bundled-PY-252.25557.178" />
</set> </set>
</attachedChunks> </attachedChunks>
</component> </component>
<component name="TaskManager"> <component name="TaskManager">
<task active="true" id="Default" summary="Default task"> <task active="true" id="Default" summary="Default task">
<changelist id="2643be13-7905-4315-bb25-9c65e899084f" name="Changes" comment="" /> <changelist id="680839da-ebfb-41aa-b3dc-c95e51f8d3d6" name="Changes" comment="" />
<created>1754643627985</created> <created>1757307968095</created>
<option name="number" value="Default" /> <option name="number" value="Default" />
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1754643627985</updated> <updated>1757307968095</updated>
<workItem from="1754643629040" duration="10355000" /> <workItem from="1757307969094" duration="783000" />
<workItem from="1754662667867" duration="7333000" /> <workItem from="1757310400690" duration="12982000" />
<workItem from="1754744202078" duration="9537000" />
<workItem from="1754831073792" duration="2983000" />
<workItem from="1754834942318" duration="73000" />
<workItem from="1755110743443" duration="663000" />
<workItem from="1755117853241" duration="600000" />
<workItem from="1755158975813" duration="2965000" />
<workItem from="1755338132928" duration="757000" />
<workItem from="1756535467015" duration="566000" />
<workItem from="1756536041631" duration="326000" />
<workItem from="1756536379874" duration="386000" />
<workItem from="1756536789625" duration="4088000" />
<workItem from="1756649477917" duration="228000" />
<workItem from="1756649731073" duration="9987000" />
<workItem from="1757043734454" duration="3772000" />
<workItem from="1757061298817" duration="13000" />
<workItem from="1757131608578" duration="1256000" />
<workItem from="1757133500304" duration="12844000" />
<workItem from="1757256800838" duration="196000" />
<workItem from="1757257115686" duration="2310000" />
<workItem from="1757259792275" duration="5293000" />
</task> </task>
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" /> <option name="version" value="3" />
</component> </component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/bot/handlers/__init__.py</url>
<option name="timeStamp" value="1" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/bot/handlers/secret/secret1.py</url>
<option name="timeStamp" value="3" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/bot/handlers/messages/__init__.py</url>
<option name="timeStamp" value="4" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/bot/handlers/messages/default.py</url>
<line>59</line>
<option name="timeStamp" value="9" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/bot/core/__init__.py</url>
<option name="timeStamp" value="10" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
<component name="com.intellij.coverage.CoverageDataManagerImpl"> <component name="com.intellij.coverage.CoverageDataManagerImpl">
<SUITE FILE_PATH="coverage/YashaSystemBot$main.coverage" NAME="main Coverage Results" MODIFIED="1754831895813" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" /> <SUITE FILE_PATH="coverage/PythonProject$main.coverage" NAME="main Coverage Results" MODIFIED="1757323358286" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/PrimoAranarBot$main.coverage" NAME="main Coverage Results" MODIFIED="1755353593880" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
</component> </component>
</project> </project>

BIN
assets/arsenal_secret2.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 KiB

View File

@@ -13,7 +13,7 @@ from aiogram.types import (
) )
from aiogram.utils.i18n import I18n, SimpleI18nMiddleware from aiogram.utils.i18n import I18n, SimpleI18nMiddleware
from configs.config import BotSettings, BotEdit, Webhook, Permission from configs.config import BotSettings, BotEdit, Webhook
from middleware.loggers import log from middleware.loggers import log
__all__ = ("dp", "bot", "BotInfo", "i18n") __all__ = ("dp", "bot", "BotInfo", "i18n")
@@ -193,7 +193,7 @@ class BotInfo:
@classmethod @classmethod
@log(level="INFO", log_type="START", text="Процесс запуска бота!") @log(level="INFO", log_type="START", text="Процесс запуска бота!")
async def setup(cls, bots: Bot = bot, perm: bool = Permission.BOT_EDIT): async def setup(cls, bots: Bot = bot, perm: bool = BotEdit.ALLOW):
await cls.webhook(bots=bots) await cls.webhook(bots=bots)
await cls.info(bots=bots) await cls.info(bots=bots)
if perm: if perm:

View File

@@ -14,11 +14,11 @@ from database import db
__all__ = ("router",) __all__ = ("router",)
CMD: str = "active".lower() CMD: str = "active".casefold()
router: Router = Router(name=f"{CMD}_cmd_router") router: Router = Router(name=f"{CMD}_cmd_router")
@router.callback_query(F.data.lower() == CMD) @router.callback_query(F.data.casefold() == CMD)
@router.message(Command(*COMMANDS[CMD], prefix=BotInfo.prefix, ignore_case=True)) @router.message(Command(*COMMANDS[CMD], prefix=BotInfo.prefix, ignore_case=True))
async def active_cmd(message: Message | CallbackQuery, state: FSMContext) -> None: async def active_cmd(message: Message | CallbackQuery, state: FSMContext) -> None:
"""Обработчик команды /active""" """Обработчик команды /active"""

View File

@@ -1,6 +1,6 @@
from aiogram import Router from aiogram import Router
from .secret1 import router as secret1_router from .secret1 import router as secret1_router
#from .secret2 import router as secret2_router from .secret2 import router as secret2_router
# Настройка экспорта и роутера # Настройка экспорта и роутера
__all__ = ('router',) __all__ = ('router',)
@@ -9,5 +9,5 @@ router: Router = Router(name=__name__)
# Подключение секретного роутера # Подключение секретного роутера
router.include_routers( router.include_routers(
secret1_router, secret1_router,
#secret2_router, secret2_router,
) )

View File

@@ -11,7 +11,7 @@ router: Router = Router(name="secret_router")
CMD: str = "secret_1" CMD: str = "secret_1"
@router.message(F.text.lower() == "истинная цель короля всегда было мироздание") @router.message(F.text.casefold() == "истинная цель короля всегда было мироздание")
@log(level='INFO', log_type=CMD.upper(), text=f"использовал команду /{CMD}") @log(level='INFO', log_type=CMD.upper(), text=f"использовал команду /{CMD}")
async def secret1_cmd(message: Message, state: FSMContext) -> None: async def secret1_cmd(message: Message, state: FSMContext) -> None:
"""Обработчик секретов""" """Обработчик секретов"""

View File

@@ -1,134 +1,232 @@
from asyncio import sleep
from typing import Dict, Any
from aiogram import Router, F from aiogram import Router, F
from aiogram.filters import Command, StateFilter from aiogram.filters import Command, StateFilter
from aiogram.fsm.context import FSMContext from aiogram.fsm.context import FSMContext
from aiogram.fsm.state import State, StatesGroup from aiogram.fsm.state import State, StatesGroup
from aiogram.types import Message from aiogram.types import Message, FSInputFile
from aiogram.utils.markdown import hide_link
# Создаем роутер from configs import ID_TO_ROLE
knowledge_router = Router()
router: Router = Router()
# Определяем состояния
class KnowledgeStates(StatesGroup): class KnowledgeStates(StatesGroup):
question1 = State() """Состояния для викторины"""
question2 = State() question1: State = State()
question3 = State() question2: State = State()
question4 = State() question3: State = State()
question5 = State() question4: State = State()
question6 = State() question5: State = State()
question6: State = State()
class Secret2(StatesGroup):
"""Состояния для страха"""
name: State = State()
result: State = State()
# Вопросы и ответы (замените на свои)
QUESTIONS = { QUESTIONS: Dict[int, str] = {
1: "Вопрос1", 1: "Начнем с простого. Уравнение расчета коэффициента анти-магической стали с добавлением углеродно-никилиевой добавки?",
2: "Вопрос2", 2: "Как зовут малышку, что обитает в лаборатории Дотторе?",
3: "Вопрос3", 3: "Какое блюдо мы, аранары, любим больше всего? Ты то должен знать наверняка!",
4: "Вопрос4", 4: "Господин все время, что-то рисует на чертеже, но для чего..? Каков Его следующий ход?",
5: "Вопрос5", 5: "Брошь Дотторе ужасно интересна… А в чем её особенность? Как она сделана?",
6: "Вопрос6" 6: "Что самое важное для тебя, дорогой Друг?"
} }
ANSWERS = { ANSWERS: Dict[int, Dict[str, str]] = {
1: {"Ответ 11": "СообщениеА1", "Ответ 12": "СообщениеБ1"}, 1: {"96h-69ctg30x": "Верно! Основная часть уравнения Логосской Экклесии, вроде бы...", "2x+3": "Кхм.. Кажется все в п̄͠о̶̩р́ͫя̦̚дке? Продолжим!"},
2: {"Ответ 21": "СообщениеА2", "Ответ 22": "СообщениеБ2"}, 2: {"Эмилия": "Эмилия! Эми! Очень красивое имя! Я помню эту малышку, её принес Дотторе в кро—", "Убийца": "Н̱͞е́̇т̆͝.. Я͔́ н̴ͫе̑͢ х̧ͬоͤ͡т̧̌е̡ͭл̂͞.."},
3: {"Ответ 31": "СообщениеА3", "Ответ 32": "СообщениеБ3"}, 3: {"Сладости": "ДА! Я ОБОЖАЮ СЛАДОСТИ! Я состою более чем на 26% из глюкозы! Хе-хе-хе!", "Бедренная кость": "О͙̃т̻ͥч͍̺е̛͓т̜̓ #77. П̏͘о̮ͧс̸̪л͔͡е̛̄ с͈̄лͥ͝о̢̲м̮̇а̡̤н̬͜н͙̀ы͓́х̸̭ к͒͡о̆̌с̴̟т̯͒е̱͘й̘͘ п̏̕р̵͂и̉͘ш̙̘е̸̾л̰͢ оͭͅн̽͢."},
4: {"Ответ 41": "СообщениеА4", "Ответ 42": "СообщениеБ4"}, 4: {"Броня": "Броня? Ари думал это металлическая пижама на вечеринку.. Почему все так сложнооо?(", "F5:С8": "К̻̻̀у̧̺ͥл̯͚̽ьͥ̀̇т̴̵͈ в̡̝̲с͓̦͂е̜͒̀ б̞ͮ̂л̡̝͞и̉ͨ͢ж̲ͭ̕е̡͈̽. О̽͐͘н͕̀͟и̶ͭ с̸͆͠к̵̤̓о̺͔͊р̴͙ͪоͤ̕ͅ н̘̖͠а̲͢й̝͟͝д̠ͯ͘у͚͌̕т̪̼ͯ м̋͢͜ѐ͚̍нͨ̄̕я̵̱. Я̷͚ͦ з̛̉͘н̫͢ͅа̷̦͒юͯͨ. Н̵ͭ͠у̶̯͖ж̢ͯ̇н̜́о̸̜̏ у̞̾͜с̱͋́т̮̚͢а̜̺̑н̨͕͊о̵̋ͅв̛̄̉и̛̜̅т̆͋͑ь̢͐ͥ р̢̼̏а̠ͭ̀с̞ͤ͜т̞̦͜я͙̑͟ж̵̩̖к̩̚͜у̷̩ͣ н̨̈́̽а͕ͮ͟ д̛̬͞в̥ͧͫе̘ͯ̕р̠͖̍и͕͎́.."},
5: {"Ответ 51": "СообщениеА5", "Ответ 52": "СообщениеБ5"}, 5: {"Аугментум": "Верно! Внутри броши Дотторе, целая карманная лаборатория!", "Серый": "Р̟̀у̠̫н̸̶и̶̇ч̐͒е͎͜с̡̞к̦̉а̶͚я̙̤ м̟̏а̨̏т͕͋р̞ͥи̵̜ц͓̀а̶͠.. Ч͕͕ё͔рͪ̉т̄̕."},
6: {"Ответ 61": "СообщениеА6", "Ответ 62": "СообщениеБ6"} 6: {"": "Для меня это тоже важно!", "Истина": "Д̺̎о̦͠б͖̀рͨ͞о̢͝ п͎̕о̩ͯж͙͘а̠͓л̸͈о̗͟в͖̀а̸ͫт̰̏ьͯ͠! Д̷̖р̂͝уͨ́з̡͓ь̼͐я̈́͡!"}
}
FINAL_MESSAGES = {
"all_1": "ИТОГ1 - Все ответы первого типа!",
"all_2": "ИТОГ2 - Все ответы второго типа!",
"mixed": "ИТОГ1 - Смешанные ответы!"
} }
# Запуск сессии знаний @router.message(StateFilter(None), Command("знания"))
@knowledge_router.message(StateFilter(None), Command("знания")) @router.message(StateFilter(None), F.text.casefold() == "пора заняться знаниями")
@knowledge_router.message(StateFilter(None), F.text.casefold() == "пора заняться знаниями") async def start_knowledge_session(message: Message, state: FSMContext) -> None:
async def start_knowledge_session(message: Message, state: FSMContext): """Запуск сессии знаний"""
await message.answer("Отлично! Начинаем сессию знаний! 🧠") await message.answer("""
await message.answer(QUESTIONS[1]) Отлично! Начинаем сессию знаний! 🧠
Я буду задавать вам вопросы, а вы должны ответить на них!
""")
await message.reply(QUESTIONS[1])
await state.set_state(KnowledgeStates.question1) await state.set_state(KnowledgeStates.question1)
await state.update_data(answers={}) await state.update_data(answers={})
# Обработчики для каждого вопроса async def save_answer(
@knowledge_router.message(KnowledgeStates.question1, F.text.in_(ANSWERS[1].keys())) state: FSMContext, question_key: str, user_answer: str, correct_option: str
async def process_question1(message: Message, state: FSMContext): ) -> None:
user_answer = message.text """Сохраняет ответ (1 — первый тип, 2 — второй тип)"""
response_message = ANSWERS[1][user_answer] answer_code: int = 1 if user_answer == correct_option else 2
data: Dict[str, Any] = await state.get_data()
answers: Dict[str, int] = data.get("answers", {})
answers[question_key] = answer_code
await state.update_data(answers=answers)
# Сохраняем ответ
answer_code = 1 if user_answer == "Ответ 11" else 2
await state.update_data(answers={"q1": answer_code})
# Отправляем сообщение и следующий вопрос # ==================== ОБРАБОТЧИКИ ВОПРОСОВ ====================
await message.answer(response_message + "\n\n" + QUESTIONS[2])
@router.message(KnowledgeStates.question1, F.text.in_(ANSWERS[1].keys()))
async def process_question1(message: Message, state: FSMContext) -> None:
await save_answer(state, "q1", message.text, "96h-69")
await message.reply(f"{ANSWERS[1][message.text]}\n\n<blockquote>{QUESTIONS[2]}</blockquote>")
await state.set_state(KnowledgeStates.question2) await state.set_state(KnowledgeStates.question2)
@knowledge_router.message(KnowledgeStates.question2, F.text.in_(ANSWERS[2].keys())) @router.message(KnowledgeStates.question2, F.text.in_(ANSWERS[2].keys()))
async def process_question2(message: Message, state: FSMContext): async def process_question2(message: Message, state: FSMContext) -> None:
user_answer = message.text await save_answer(state, "q2", message.text, "Алиса")
response_message = ANSWERS[2][user_answer] await message.reply(f"{ANSWERS[2][message.text]}\n\n<blockquote>{QUESTIONS[3]}</blockquote>")
# Сохраняем ответ
answer_code = 1 if user_answer == "Ответ 21" else 2
data = await state.get_data()
answers = data.get("answers", {})
answers["q2"] = answer_code
await state.update_data(answers=answers)
# Отправляем сообщение и следующий вопрос
await message.answer(response_message + "\n\n" + QUESTIONS[3])
await state.set_state(KnowledgeStates.question3) await state.set_state(KnowledgeStates.question3)
# Добавьте аналогичные обработчики для question3-question5 @router.message(KnowledgeStates.question3, F.text.in_(ANSWERS[3].keys()))
async def process_question3(message: Message, state: FSMContext) -> None:
await save_answer(state, "q3", message.text, "Сладости")
await message.reply(f"{ANSWERS[3][message.text]}\n\n<blockquote>{QUESTIONS[4]}</blockquote>")
await state.set_state(KnowledgeStates.question4)
@knowledge_router.message(KnowledgeStates.question6, F.text.in_(ANSWERS[6].keys()))
async def process_question6(message: Message, state: FSMContext):
user_answer = message.text
response_message = ANSWERS[6][user_answer]
# Сохраняем ответ @router.message(KnowledgeStates.question4, F.text.in_(ANSWERS[4].keys()))
answer_code = 1 if user_answer == "Ответ 61" else 2 async def process_question4(message: Message, state: FSMContext) -> None:
await save_answer(state, "q4", message.text, "---")
await message.reply(f"{ANSWERS[4][message.text]}\n\n<blockquote>{QUESTIONS[5]}</blockquote>")
await state.set_state(KnowledgeStates.question5)
@router.message(KnowledgeStates.question5, F.text.in_(ANSWERS[5].keys()))
async def process_question5(message: Message, state: FSMContext) -> None:
await save_answer(state, "q5", message.text, "Аугментум")
await message.reply(f"{ANSWERS[5][message.text]}\n\n<blockquote>{QUESTIONS[6]}</blockquote>")
await state.set_state(KnowledgeStates.question6)
@router.message(KnowledgeStates.question6)
async def process_question6(message: Message, state: FSMContext) -> None:
user_answer: str = message.text
# Определяем логику: "Истина" → второй тип, иначе → первый тип
if user_answer == "Истина":
answer_code: int = 2
response_message: str = ANSWERS[6]["Истина"]
else:
answer_code: int = 1
# Для любого ответа кроме "Истина" выводим либо заготовку, либо сам текст
response_message: str = ANSWERS[6].get("Мир", f"Ты прав! Ты———")
# Сохраняем результат
data = await state.get_data() data = await state.get_data()
answers = data.get("answers", {}) answers = data.get("answers", {})
answers["q6"] = answer_code answers["q6"] = answer_code
await state.update_data(answers=answers) await state.update_data(answers=answers)
# Отправляем финальное сообщение # Отправляем сообщение и завершаем сессию
await message.answer(response_message) await message.reply(response_message)
await finish_knowledge_session(message, state) await finish_knowledge_session(message, state)
# Обработчики для некорректных ответов
@knowledge_router.message(KnowledgeStates.question1) # ==================== ОБРАБОТЧИК НЕВЕРНЫХ ОТВЕТОВ ====================
async def process_incorrect_answer1(message: Message):
await message.answer("Пожалуйста, выберите один из предложенных вариантов ответа.") @router.message(StateFilter(
await message.answer(QUESTIONS[1]) KnowledgeStates.question1,
KnowledgeStates.question2,
KnowledgeStates.question3,
KnowledgeStates.question4,
KnowledgeStates.question5,
KnowledgeStates.question6,
))
async def process_incorrect_answer(message: Message, state: FSMContext) -> None:
"""Отвечает пользователю, если он ввёл что-то не из списка"""
current_state: str = (await state.get_state()).split(":")[-1]
question_number: int = {
"question1": 1,
"question2": 2,
"question3": 3,
"question4": 4,
"question5": 5,
"question6": 6,
}[current_state]
await message.reply(
f"Пожалуйста, выберите один из предложенных вариантов ответа.\n\n<blockquote>{QUESTIONS[question_number]}</blockquote>"
)
@knowledge_router.message(KnowledgeStates.question2) # ==================== ЗАВЕРШЕНИЕ ====================
async def process_incorrect_answer2(message: Message): # ------------------- Завершение сессии знаний -------------------
await message.answer("Пожалуйста, выберите один из предложенных вариантов ответа.") @router.message(Command("secret2676"))
await message.answer(QUESTIONS[2])
async def finish_knowledge_session(message: Message, state: FSMContext) -> None:
"""Завершает сессию знаний"""
data: Dict[str, Any] = await state.get_data()
answers: Dict[str, int] = data.get("answers", {})
# Добавьте аналогичные обработчики для остальных вопросов
# Завершение сессии
async def finish_knowledge_session(message: Message, state: FSMContext):
data = await state.get_data()
answers = data.get("answers", {})
# Проверяем результаты
if all(answer == 2 for answer in answers.values()): if all(answer == 2 for answer in answers.values()):
await message.answer(FINAL_MESSAGES["all_2"]) await message.answer(
f"""{hide_link("https://i.pinimg.com/originals/e0/ab/f7/e0abf78d8a8eba5fa8ae9cb7b9b1c410.gif")}
Дᴀʙнᴏ… ᴄᴧиɯᴋᴏʍ дᴀʙнᴏ ʍы нᴇ ʙᴄᴛᴩᴇчᴀᴧиᴄь, Нᴀбᴧюдᴀᴛᴇᴧь.
Тʙᴏи ᴦᴧᴀɜᴀ… ᴏни ᴄᴧᴇдяᴛ ɜᴀ ʍнᴏй ᴄᴋʙᴏɜь ᴛьʍу, нᴇ ʍиᴦᴀя.
Сᴋᴀжи… ᴄᴋᴀжи хᴏᴛя бы ᴄʙᴏё иʍя… ᴨᴩᴇждᴇ чᴇʍ ᴛьʍᴀ ᴨᴩᴏᴦᴧᴏᴛиᴛ нᴀᴄ ᴏᴋᴏнчᴀᴛᴇᴧьнᴏ.
"""
)
await state.set_state(Secret2.name)
else: else:
await message.answer(FINAL_MESSAGES["mixed"]) await message.reply_photo(photo=FSInputFile("assets/arsenal_secret2.jpeg"),
caption="""
┏━━━━━━━━━━━━━━━━━━━┓
<i>…От той группы не осталось даже тени. Никаких следов, только пустота, словно их поглотила сама тьма.
Но сканер… сканер выдал странные, тревожные результаты. На их основе можно сделать выводы… выводы, которые лучше бы остались тайной.
Трёхдневные графики активности Омута… они словно шепчут сквозь цифровой шум. Если использовать заражение… если рискнуть… я смогу превратить хаос в новые материалы.
Но для этого нужна новая группа. Свежие люди… на чьих плечах может лечь эта тьма. Придётся… найти их. И отправить.</i>
┗━━━━━━━━━━━━━━━━━━━┛
""")
await state.clear() await state.clear()
# ------------------- Проверка имени -------------------
@router.message(StateFilter(Secret2.name))
async def hard_secret_name(message: Message, state: FSMContext) -> None:
user_id: int = message.from_user.id
text: str = message.text.strip()
expected_role: str = ID_TO_ROLE.get(user_id)
if expected_role is None:
await message.reply("Ты не значишь ничего для этой тайны…")
await state.clear()
return
if text.lower() == expected_role.lower():
await message.reply(f"""{hide_link("https://i.pinimg.com/originals/d3/ae/62/d3ae62df6150066abc4f814d06070033.gif")}
Кхʍ.. Знᴀчиᴛ ᴛы <b>{expected_role}</b>? Инᴛᴇᴩᴇᴄнᴏᴇ иʍя, нᴏ нᴀᴄᴛᴏящᴇᴇ ᴧи ᴏнᴏ? Чᴛᴏ ж, ϶ᴛᴏ нᴇ ʙᴀжнᴏ, ᴄᴋᴀжи ʍнᴇ <b>{expected_role}</b>, чᴛᴏ жᴇ ᴛы ʙыбᴩᴀᴧ бы?
Убиᴛь дᴇʙᴏчᴋу, ᴩᴀди ʍиᴩᴀ
Иᴧи убиᴛь ʍиᴩ, ᴩᴀди дᴇʙуɯᴋи?
""")
else:
await message.reply(f"""{hide_link("https://i.pinimg.com/originals/a8/a5/a2/a8a5a29dd1613a48ef0a680e19973ff6.gif")}
Нᴇᴛ, ϶ᴛᴏ нᴇ ᴛы. Тʙᴏᴇ нᴀᴄᴛᴏящᴇᴇ иʍя <b>{expected_role}</b>. Ты ʍнᴇ ʙнᴏʙь ᴄᴏʙᴩᴀᴧ. Инᴛᴇᴩᴇᴄнᴏ, чᴛᴏ ᴛᴇбя ᴨᴏбудиᴧᴏ. Н ϶ᴛᴏ нᴇ ʙᴀжнᴏ, ᴄᴋᴀжи ʍнᴇ <b>{expected_role}</b>, чᴛᴏ жᴇ ᴛы ʙыбᴩᴀᴧ бы?
Убиᴛь дᴇʙᴏчᴋу, ᴩᴀди ʍиᴩᴀ
Иᴧи убиᴛь ʍиᴩ, ᴩᴀди дᴇʙуɯᴋи?
""")
await state.update_data(role=expected_role)
await state.set_state(Secret2.result)
# ------------------- Финальный результат -------------------
@router.message(StateFilter(Secret2.result))
async def secret2_result(message: Message, state: FSMContext) -> None:
await message.reply(f"Я ɜᴀᴨᴏʍню твой ответ.")
await sleep(120)
await message.reply("<b>Чужой мира сего.</b>")
await state.clear()

View File

@@ -16,7 +16,7 @@ def interesting_fact(mode: str = "факт", lists: Optional[list[str]] = None)
if lists is not None: if lists is not None:
return choice(lists) return choice(lists)
mode = mode.lower() mode = mode.casefold()
if mode == "анекдот": if mode == "анекдот":
source: list[str] = Lists.jokes source: list[str] = Lists.jokes
@@ -42,7 +42,7 @@ def get_best_response(
:param random_phrases: список случайных фраз, если совпадений нет :param random_phrases: список случайных фраз, если совпадений нет
:return: строка с ответом :return: строка с ответом
""" """
normalized_text: str = user_text.lower() normalized_text: str = user_text.casefold()
# Перебор ключевых слов в словаре # Перебор ключевых слов в словаре
for _, data in responses.items(): for _, data in responses.items():

View File

@@ -313,7 +313,7 @@ class ImportantID:
class BotEdit: class BotEdit:
"""Алиасы для настроек редактирования бота.""" """Алиасы для настроек редактирования бота."""
ALLOW_PERMISSION: Final[bool] = settings.BOT_EDIT ALLOW: Final[bool] = settings.BOT_EDIT
PROJECT_NAME: Final[str] = settings.PROJECT_NAME PROJECT_NAME: Final[str] = settings.PROJECT_NAME
NAME: Final[str] = settings.BOT_NAME NAME: Final[str] = settings.BOT_NAME
DESCRIPTION: Final[str] = settings.BOT_DESCRIPTION DESCRIPTION: Final[str] = settings.BOT_DESCRIPTION

View File

@@ -1,7 +1,40 @@
from typing import Dict
from database import RoleRegion from database import RoleRegion
# Настройка экспорта # Настройка экспорта
__all__ = ("genshin_roles", "hsr_roles", "all_roles",) __all__ = ("genshin_roles", "hsr_roles", "ID_TO_ROLE", "all_roles",)
# Словарь с ID пользователей и их ролями
ID_TO_ROLE: Dict[int, str] = {
6639261502: "Рацио",
7435095514: "Панталоне",
6250345032: "Сандэй",
5683309573: "Хохо",
833230790: "Сампо",
6688236743: "Аглая",
459453807: "Флинс",
7831579419: "Анакса",
7749831743: "Венти",
1364984004: "Аргенти",
1369873051: "Альбедо",
1222399228: "Химеко",
8199185983: "Лоча",
7576341592: "Фуга",
5426987140: "Варка",
1316852704: "Аха",
1764269904: "Цзин Юань",
1992416693: "Бутхилл",
1314539668: "Кафка",
1207917053: "Топаз",
5025299829: "Вельт",
991994028: "Авантюрин",
1362425172: "Цифер",
2006013059: "Жуань Мэй",
7794291575: "Стивен Ллойд",
6751720805: "Дотторе",
5260895056: "Фэйсяо",
1438721683: "Бай Чжу",
}
genshin_roles: list = [ genshin_roles: list = [
# Мондштадт # Мондштадт

View File

@@ -81,7 +81,7 @@ class Logger:
# Раздельные логи по уровням # Раздельные логи по уровням
for level_name in ['INFO', 'WARNING', 'ERROR', 'DEBUG', 'CRITICAL']: for level_name in ['INFO', 'WARNING', 'ERROR', 'DEBUG', 'CRITICAL']:
logger.add( logger.add(
sink=log_dir / f'{level_name.lower()}.log', sink=log_dir / f'{level_name.casefold()}.log',
rotation='10 MB', rotation='10 MB',
retention='7 days', retention='7 days',
format=self._log_format, format=self._log_format,

View File

@@ -17,8 +17,6 @@ dependencies = [
"aiosqlite (>=0.21.0,<0.22.0)", "aiosqlite (>=0.21.0,<0.22.0)",
"email-validator (>=2.3.0,<3.0.0)", "email-validator (>=2.3.0,<3.0.0)",
"apscheduler (>=3.11.0,<4.0.0)", "apscheduler (>=3.11.0,<4.0.0)",
"fastapi (>=0.116.1,<0.117.0)",
"uvicorn (>=0.35.0,<0.36.0)",
] ]