Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
maubot-rt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
isgphys
maubot-rt
Commits
4a250bd6
Commit
4a250bd6
authored
5 years ago
by
Sven Mäder
Browse files
Options
Downloads
Patches
Plain Diff
Fix ticket number regex
parent
6f49101e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rt.py
+4
-2
4 additions, 2 deletions
rt.py
with
4 additions
and
2 deletions
rt.py
+
4
−
2
View file @
4a250bd6
...
...
@@ -18,8 +18,10 @@ class Config(BaseProxyConfig):
class
RT
(
Plugin
):
prefix
:
str
whitelist
:
Set
[
UserID
]
api
:
str
post_data
:
dict
headers
=
{
"
User-agent
"
:
"
maubot-rt
"
}
regex_number
=
re
.
compile
(
r
'
[0-9]
{6}
'
)
regex_number
=
re
.
compile
(
r
'
[0-9]
+
'
)
regex_properties
=
re
.
compile
(
r
'
([a-zA-z]+): (.+)
'
)
regex_history
=
re
.
compile
(
r
'
([0-9]+): (.+)
'
)
regex_entry
=
re
.
compile
(
r
'
([a-zA-z]+): (.+(?:\n {8}.*)*)
'
,
re
.
MULTILINE
)
...
...
@@ -92,7 +94,7 @@ class RT(Plugin):
ticket
[
'
Content
'
]
=
formatted_content
.
rstrip
()
return
ticket
@command.passive
(
"
((^| )([rR][tT]#?))([0-9]
{6}
)
"
,
multiple
=
True
)
@command.passive
(
"
((^| )([rR][tT]#?))([0-9]
+
)
"
,
multiple
=
True
)
async
def
handler
(
self
,
evt
:
MessageEvent
,
subs
:
List
[
Tuple
[
str
,
str
]])
->
None
:
await
evt
.
mark_read
()
msg_lines
=
[]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment