mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Shortened the code
This commit is contained in:
parent
fec148aac2
commit
0ee9cc02a6
1 changed files with 3 additions and 5 deletions
|
|
@ -30,12 +30,10 @@ class UserMiddleware(LifetimeControllerMiddleware):
|
|||
update: Union[types.Message, types.CallbackQuery],
|
||||
data: dict,
|
||||
):
|
||||
if update.from_user.id in fake_db:
|
||||
data["user_in_db"] = fake_db[update.from_user.id]
|
||||
|
||||
else:
|
||||
if update.from_user.id not in fake_db:
|
||||
fake_db[update.from_user.id] = {"ban": False}
|
||||
data["user_in_db"] = fake_db[update.from_user.id]
|
||||
|
||||
data["user_in_db"] = fake_db[update.from_user.id]
|
||||
|
||||
|
||||
class BanUserFilter(BoundFilter):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue