Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
altlinux-packages-bot
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Unitsaev
altlinux-packages-bot
Commits
7715ffe5
Verified
Commit
7715ffe5
authored
Jul 22, 2025
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
profile module: update settings
parent
0e32940e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
27 deletions
+16
-27
profile.py
src/handlers/profile.py
+16
-27
No files found.
src/handlers/profile.py
View file @
7715ffe5
from
telegrinder
import
Dispatch
,
Message
,
CallbackQuery
,
MESSAGE_FROM_USER
,
WaiterMachine
from
telegrinder.rules
import
Command
,
PayloadEqRule
,
PayloadMarkupRule
,
Text
,
IsPrivate
,
HasText
from
asyncio
import
sleep
from
database.func
import
DB
from
data.keyboards
import
profile_keyboards
...
...
@@ -55,11 +57,7 @@ async def callback_confirm_handler(cb: CallbackQuery) -> None:
@dp.callback_query
(
PayloadEqRule
(
"profile/settings/maintainer"
))
async
def
callback_confirm_handler
(
cb
:
CallbackQuery
)
->
None
:
await
cb
.
ctx_api
.
send_message
(
chat_id
=
cb
.
from_user
.
id
,
text
=
"Введите никнейм сопровождающего:"
,
)
await
cb
.
answer
()
await
cb
.
edit_text
(
"Введите никнейм сопровождающего:"
)
api_data
=
await
altrepo
.
api
.
site
.
all_maintainers
(
"sisyphus"
)
while
True
:
...
...
@@ -67,48 +65,39 @@ async def callback_confirm_handler(cb: CallbackQuery) -> None:
maintainer
=
msg
.
text
.
unwrap
()
.
lower
()
if
any
(
_m
.
packager_nickname
==
maintainer
for
_m
in
api_data
.
maintainers
):
await
msg
.
answer
(
f
"Вы выбрали {maintainer}"
)
await
msg
.
delete
()
await
cb
.
edit_text
(
f
"Вы выбрали {maintainer}"
)
DB
.
user
.
change_maintainer
(
cb
.
from_user
.
id
,
maintainer
)
await
sleep
(
3.0
)
await
cb
.
delete
()
break
else
:
await
msg
.
answer
(
await
cb
.
edit_text
(
f
"Сопровождающий {maintainer} не найден.
\n
"
"Введите никнейм сопровождающего:"
)
@dp.callback_query
(
PayloadEqRule
(
"profile/settings/branch"
))
async
def
callback_confirm_handler
(
cb
:
CallbackQuery
)
->
None
:
await
cb
.
ctx_api
.
edit_message_text
(
chat_id
=
cb
.
from_user
.
id
,
text
=
"Выберите репозиторий"
,
message_id
=
cb
.
message_id
.
unwrap
()
await
cb
.
edit_text
(
"Выберите репозиторий"
,
reply_markup
=
profile_keyboards
.
profile_settings_branch_kb
()
)
await
cb
.
answer
()
await
cb
.
ctx_api
.
edit_message_reply_markup
(
chat_id
=
cb
.
from_user
.
id
,
reply_markup
=
profile_keyboards
.
profile_settings_branch_kb
(),
message_id
=
cb
.
message_id
.
unwrap
()
)
@dp.callback_query
(
PayloadMarkupRule
(
"profile/settings/branch/<branch>"
))
async
def
callback_confirm_handler
(
cb
:
CallbackQuery
,
branch
:
str
)
->
None
:
await
cb
.
ctx_api
.
edit_message_text
(
chat_id
=
cb
.
from_user
.
id
,
text
=
f
"Вы выбрали {branch}"
,
message_id
=
cb
.
message_id
.
unwrap
()
)
await
cb
.
answer
()
await
cb
.
edit_text
(
f
"Вы выбрали {branch}"
)
DB
.
user
.
change_default_branch
(
cb
.
from_user
.
id
,
branch
)
await
sleep
(
3.0
)
await
cb
.
delete
()
@dp.callback_query
(
PayloadEqRule
(
"command/menu"
))
async
def
menu_handler
(
cb
:
CallbackQuery
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment