From 192b7d04bb5b5cd5a3ca4219b7f35c28a801c6d1 Mon Sep 17 00:00:00 2001 From: HypoxiE Date: Sat, 26 Jul 2025 21:34:58 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=84=D0=BE=D1=80=D0=BC=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=B0=D0=BD=D0=B0=D0=BB=D0=B0=20?= =?UTF-8?q?=D0=BD=D0=B0=D0=B2=D0=B8=D0=B3=D0=B0=D1=86=D0=B8=D0=B8=20|=20ve?= =?UTF-8?q?rsion:=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CoreSub.py | 32 ++++++++++++++++++++++++++++++-- commit.bat | 35 +++++++++++++++++++++++++++++++++++ version.txt | 2 ++ 3 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 commit.bat create mode 100644 version.txt diff --git a/CoreSub.py b/CoreSub.py index a4eee29..fd40899 100644 --- a/CoreSub.py +++ b/CoreSub.py @@ -9,8 +9,8 @@ from data.secrets.TOKEN import token class Bot(commands.Bot): def __init__(self): super().__init__( - command_prefix="=", - intents=disnake.Intents.all() + command_prefix="=", + intents=disnake.Intents.all() ) self.shutdown_flag = asyncio.Event() @@ -21,8 +21,36 @@ class Bot(commands.Bot): await self.change_presence(status=disnake.Status.online, activity=disnake.Game("Работаю")) print(f"{datetime.datetime.now().strftime('%H:%M:%S %d-%m-%Y')}:: KrekSupportBot activated") + await self.send_navigation() + self.shutdown_flag.set() + class embed(disnake.Embed): + def __init__(self, **kwargs): + super().__init__( + color = 0x944509, + **kwargs + ) + + async def send_navigation(self): + navigation_channel = await self.krekchat.fetch_channel(1398723447399387247) + embeds = [] + + embeds.append( + self.embed( + title = "Краткое изложение", + description = """ + ❓Если вам просто спросить: <#649314697425846272> + """ + ) + ) + + await navigation_channel.purge(limit=1) + + webhooks = await navigation_channel.webhooks() + webhook = webhooks[0] + await webhook.send("", embeds=embeds, username="Навигатор") + async def main(): bot = Bot() try: diff --git a/commit.bat b/commit.bat new file mode 100644 index 0000000..5e530a3 --- /dev/null +++ b/commit.bat @@ -0,0 +1,35 @@ +@echo off +REM Скрипт для коммита и пуша в Git +setlocal enabledelayedexpansion +chcp 65001 + +REM Переход в директорию проекта (при необходимости) +cd /d "%~dp0" + +set count=0 + +for /f "usebackq delims=" %%A in ("version.txt") do ( + set /a count+=1 + + if !count! EQU 1 set "description=%%A" + if !count! EQU 2 set "version=%%A" + + if !count! GEQ 2 goto done +) +:done + +REM Получение комментария к коммиту +set commit_msg="%description% | version: %version%" + +REM echo %commit_msg% + +REM Добавление всех изменений +git add . + +REM Создание коммита +git commit -m %commit_msg% + +REM Отправка в основную ветку (main или master) +REM git push + +pause \ No newline at end of file diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..922f7eb --- /dev/null +++ b/version.txt @@ -0,0 +1,2 @@ +Оформление канала навигации +1 \ No newline at end of file