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
9092413f
Verified
Commit
9092413f
authored
Jul 12, 2025
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add bugs
parent
e0ed0a49
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
4 deletions
+48
-4
config.py
src/config.py
+3
-2
menu.py
src/data/keyboards/menu.py
+2
-2
bugs.py
src/handlers/bugs.py
+43
-0
No files found.
src/config.py
View file @
9092413f
...
...
@@ -15,4 +15,6 @@ DEFAUIL_BRANCHES = [
"p11"
,
"p10"
,
"p9"
]
\ No newline at end of file
]
BUGS_URL
=
"https://bugzilla.altlinux.org/"
src/data/keyboards/menu.py
View file @
9092413f
...
...
@@ -5,6 +5,7 @@ menu_kb = (
.
add
(
Button
(
"Профиль"
))
.
row
()
.
add
(
Button
(
"Отслеживание"
))
.
add
(
Button
(
"Ошибки"
))
.
row
()
.
add
(
Button
(
"Статистика"
))
)
.
get_markup
()
\ No newline at end of file
)
.
get_markup
()
src/handlers/bugs.py
0 → 100644
View file @
9092413f
from
telegrinder
import
Dispatch
,
Message
from
telegrinder.rules
import
Command
,
Text
,
IsUser
from
telegrinder.tools.formatting
import
HTMLFormatter
from
api
import
api
from
database.models
import
User
from
config
import
BUGS_URL
dp
=
Dispatch
()
dp
.
message
.
auto_rules
=
IsUser
()
@dp.message
(
Command
(
"bugs"
)
|
Text
([
"bugs"
,
"ошибки"
],
ignore_case
=
True
))
async
def
watch_handler
(
m
:
Message
,
user
:
User
|
None
)
->
None
:
if
user
is
None
:
return
bugs_data
=
await
api
.
bug
.
bugzilla_by_maintainer
(
user
.
maintainer
)
unresolved_bugs
=
[
bug
for
bug
in
bugs_data
.
bugs
if
bug
.
status
not
in
[
"RESOLVED"
,
"CLOSED"
]]
if
not
len
(
unresolved_bugs
):
await
m
.
answer
(
"У вас нет открытых багов"
)
return
bugs_message
=
"Ошибки:
\n\n
"
for
i
,
bug
in
enumerate
(
unresolved_bugs
):
if
i
==
20
:
break
bugs_message
+=
HTMLFormatter
(
f
"<a href='{BUGS_URL}/{bug.id}'>#{bug.id}</a>"
)
+
\
f
" | {bug.product} - {bug.component} | {bug.severity}
\n
"
if
len
(
unresolved_bugs
)
>
20
:
bugs_message
+=
"
\n
..."
await
m
.
answer
(
bugs_message
)
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