Compare commits
2
Commits
bd2724c612
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
693703edef | ||
|
|
4b0d014d6c |
@@ -26,9 +26,14 @@ if not BOT_OWNER_ID:
|
|||||||
raise ValueError("No BOT_OWNER_ID provided. Please set the BOT_OWNER_ID environment variable.")
|
raise ValueError("No BOT_OWNER_ID provided. Please set the BOT_OWNER_ID environment variable.")
|
||||||
FILE_PATH = "/app/data/users.txt"
|
FILE_PATH = "/app/data/users.txt"
|
||||||
FILE_PATH_WINDOWS = "./users.txt"
|
FILE_PATH_WINDOWS = "./users.txt"
|
||||||
# Настраиваем логирование
|
if LOG_LEVEL == "ERROR":
|
||||||
|
logging.basicConfig(level=logging.ERROR)
|
||||||
|
elif LOG_LEVEL == "WARNING":
|
||||||
|
logging.basicConfig(level=logging.WARNING)
|
||||||
|
elif LOG_LEVEL == "INFO":
|
||||||
logging.basicConfig(level=logging.INFO)
|
logging.basicConfig(level=logging.INFO)
|
||||||
|
else:
|
||||||
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
# Инициализация бота
|
# Инициализация бота
|
||||||
bot = Bot(token=BOT_TOKEN)
|
bot = Bot(token=BOT_TOKEN)
|
||||||
dp = Dispatcher()
|
dp = Dispatcher()
|
||||||
@@ -45,7 +50,6 @@ class ThrottlingMiddleware(BaseMiddleware):
|
|||||||
user_id = event.from_user.id
|
user_id = event.from_user.id
|
||||||
now = asyncio.get_event_loop().time()
|
now = asyncio.get_event_loop().time()
|
||||||
if user_id in self.last_time and now - self.last_time[user_id] < self.rate_limit:
|
if user_id in self.last_time and now - self.last_time[user_id] < self.rate_limit:
|
||||||
await event.answer("Подождите немного перед повторным нажатием!")
|
|
||||||
return
|
return
|
||||||
self.last_time[user_id] = now
|
self.last_time[user_id] = now
|
||||||
return await handler(event, data)
|
return await handler(event, data)
|
||||||
@@ -200,7 +204,7 @@ async def send_file(message: Message):
|
|||||||
|
|
||||||
|
|
||||||
@dp.message()
|
@dp.message()
|
||||||
async def default_message():
|
async def default_message(message: Message):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
|
|||||||
+10
-9
@@ -1,25 +1,26 @@
|
|||||||
aio-pika==9.5.4
|
aio-pika==9.5.4
|
||||||
aiofiles==24.1.0
|
aiofiles==24.1.0
|
||||||
aiogram==3.17.0
|
aiogram==3.17.0
|
||||||
aiohappyeyeballs==2.4.0
|
aiohappyeyeballs==2.4.4
|
||||||
aiohttp==3.11.11
|
aiohttp==3.11.11
|
||||||
aiormq==6.8.1
|
aiormq==6.8.1
|
||||||
aiosignal==1.3.1
|
aiosignal==1.3.2
|
||||||
annotated-types==0.7.0
|
annotated-types==0.7.0
|
||||||
attrs==24.2.0
|
attrs==25.1.0
|
||||||
certifi==2024.8.30
|
certifi==2025.1.31
|
||||||
charset-normalizer==3.3.2
|
charset-normalizer==3.4.1
|
||||||
exceptiongroup==1.2.2
|
exceptiongroup==1.2.2
|
||||||
frozenlist==1.4.1
|
frozenlist==1.5.0
|
||||||
idna==3.8
|
idna==3.10
|
||||||
magic-filter==1.0.12
|
magic-filter==1.0.12
|
||||||
multidict==6.0.5
|
multidict==6.1.0
|
||||||
pamqp==3.3.0
|
pamqp==3.3.0
|
||||||
propcache==0.2.1
|
propcache==0.2.1
|
||||||
pydantic==2.10.6
|
pydantic==2.10.6
|
||||||
pydantic_core==2.27.2
|
pydantic_core==2.27.2
|
||||||
python-dotenv==1.0.1
|
python-dotenv==1.0.1
|
||||||
requests==2.32.3
|
requests==2.32.3
|
||||||
|
setuptools==75.8.0
|
||||||
typing_extensions==4.12.2
|
typing_extensions==4.12.2
|
||||||
urllib3==2.2.2
|
urllib3==2.3.0
|
||||||
yarl==1.18.3
|
yarl==1.18.3
|
||||||
|
|||||||
Reference in New Issue
Block a user