testing #12
1
.gitignore
vendored
1
.gitignore
vendored
@ -17,5 +17,6 @@ __pycache__/
|
|||||||
*.txt
|
*.txt
|
||||||
!requirements.txt
|
!requirements.txt
|
||||||
test.py
|
test.py
|
||||||
|
engineering_works.py
|
||||||
venv/
|
venv/
|
||||||
.vscode/
|
.vscode/
|
47
1.patch
47
1.patch
@ -1,47 +0,0 @@
|
|||||||
diff --git a/filters/main.py b/filters/main.py
|
|
||||||
index 849e6de..7539de0 100644
|
|
||||||
--- a/filters/main.py
|
|
||||||
+++ b/filters/main.py
|
|
||||||
@@ -28,7 +28,7 @@ class BotAdmin(BoundFilter):
|
|
||||||
self.admin = admin
|
|
||||||
|
|
||||||
async def check(self, message: types.Message):
|
|
||||||
- if message.from_user.id in config.admin_user:
|
|
||||||
+ if message.from_user.id in [int(i) for i in config.admin_users.split(",")]:
|
|
||||||
return True
|
|
||||||
else:
|
|
||||||
await message.answer("Хорошая попытка, но ты не администратор!")
|
|
||||||
diff --git a/handlers/private/main.py b/handlers/private/main.py
|
|
||||||
index de03596..370218a 100644
|
|
||||||
--- a/handlers/private/main.py
|
|
||||||
+++ b/handlers/private/main.py
|
|
||||||
@@ -45,7 +45,7 @@ async def get_replace(message: types.Message, state: FSMContext):
|
|
||||||
|
|
||||||
link = (
|
|
||||||
'<a href="{}">Проверьте замены тут</a>'
|
|
||||||
- .format(config.bot("link"))
|
|
||||||
+ .format(config.link)
|
|
||||||
)
|
|
||||||
logging.info("User: {user_id} - {username}".format(
|
|
||||||
user_id=str(message.from_user.id),
|
|
||||||
@@ -94,7 +94,7 @@ async def get_replace(message: types.Message, state: FSMContext):
|
|
||||||
async def get_link(message: types.Message):
|
|
||||||
msg = (
|
|
||||||
'<a href="{}">Проверьте замены тут</a>'
|
|
||||||
- .format(config.bot("link"))
|
|
||||||
+ .format(config.link)
|
|
||||||
)
|
|
||||||
await bot.send_message(
|
|
||||||
message.chat.id,
|
|
||||||
diff --git a/utils/bot_commands.py b/utils/bot_commands.py
|
|
||||||
index b65bc62..3de6ed1 100644
|
|
||||||
--- a/utils/bot_commands.py
|
|
||||||
+++ b/utils/bot_commands.py
|
|
||||||
@@ -7,6 +7,6 @@ async def set_commands(dp):
|
|
||||||
types.BotCommand("help", "информация"),
|
|
||||||
types.BotCommand("link", "получить ссылку на файл"),
|
|
||||||
types.BotCommand('timetable', "Розклад"),
|
|
||||||
- types.BotCommand('feedback', "Звязок з адміністратором")
|
|
||||||
+ types.BotCommand('feedback', "Звязок з адміністратором"),
|
|
||||||
types.BotCommand("reload", "только для администрации"),
|
|
||||||
])
|
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import asyncio
|
import asyncio
|
||||||
import aioschedule as schedule
|
import aioschedule as schedule
|
||||||
@ -15,8 +16,8 @@ async def announce():
|
|||||||
except Exception:
|
except Exception:
|
||||||
message = "Ошибка обновления данных!"
|
message = "Ошибка обновления данных!"
|
||||||
if config.admin_users.split(',') is not None:
|
if config.admin_users.split(',') is not None:
|
||||||
for user_id in config.admin_users.split(','):
|
for user_id in [int(i) for i in config.admin_users.split(',')]:
|
||||||
if user_id in config.exclude:
|
if user_id in [int(i) for i in config.exclude.split(",")]:
|
||||||
continue
|
continue
|
||||||
await dp.bot.send_message(user_id, message)
|
await dp.bot.send_message(user_id, message)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user