Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
maubot
echo
Commits
0d8d59eb
Commit
0d8d59eb
authored
Jul 08, 2019
by
Tulir Asokan
🐈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix incorrect html pong message and bump version to 1.3.1
parent
e5454924
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
echo.py
echo.py
+2
-2
maubot.yaml
maubot.yaml
+1
-1
No files found.
echo.py
View file @
0d8d59eb
...
...
@@ -39,11 +39,11 @@ class EchoBot(Plugin):
async
def
ping_handler
(
self
,
evt
:
MessageEvent
,
message
:
str
=
""
)
->
None
:
diff
=
int
(
time
()
*
1000
)
-
evt
.
timestamp
pretty_diff
=
self
.
prettify_diff
(
diff
)
message
=
f
'"
{
message
[:
20
]
}
" took'
if
message
else
"took"
text_
message
=
f
'"
{
message
[:
20
]
}
" took'
if
message
else
"took"
html_message
=
f
'"
{
escape
(
message
[:
20
])
}
" took'
if
message
else
"took"
content
=
TextMessageEventContent
(
msgtype
=
MessageType
.
NOTICE
,
format
=
Format
.
HTML
,
body
=
f
"
{
evt
.
sender
}
: Pong! (ping
{
message
}
{
pretty_diff
}
to arrive)"
,
body
=
f
"
{
evt
.
sender
}
: Pong! (ping
{
text_
message
}
{
pretty_diff
}
to arrive)"
,
formatted_body
=
f
"<a href='https://matrix.to/#/
{
evt
.
sender
}
'>
{
evt
.
sender
}
</a>: Pong! "
f
"(<a href='https://matrix.to/#/
{
evt
.
room_id
}
/
{
evt
.
event_id
}
'>ping</a>
{
html_message
}
"
f
"
{
pretty_diff
}
to arrive)"
)
...
...
maubot.yaml
View file @
0d8d59eb
maubot
:
0.1.0
id
:
xyz.maubot.echo
version
:
1.3.
0
version
:
1.3.
1
license
:
MIT
modules
:
-
echo
...
...
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