mirror of
https://github.com/maubot/maubot
synced 2025-08-29 08:50:38 +00:00
Compare commits
2 commits
905c91c285
...
94c4e5aaaf
Author | SHA1 | Date | |
---|---|---|---|
|
94c4e5aaaf | ||
|
beaba079ca |
4 changed files with 13 additions and 5 deletions
|
@ -10,7 +10,7 @@ default:
|
||||||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||||
|
|
||||||
build frontend:
|
build frontend:
|
||||||
image: node:22-alpine
|
image: node:24-alpine
|
||||||
stage: build frontend
|
stage: build frontend
|
||||||
before_script: []
|
before_script: []
|
||||||
variables:
|
variables:
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
FROM node:22 AS frontend-builder
|
FROM node:24 AS frontend-builder
|
||||||
|
|
||||||
COPY ./maubot/management/frontend /frontend
|
COPY ./maubot/management/frontend /frontend
|
||||||
RUN cd /frontend && yarn --prod && yarn build
|
RUN cd /frontend && yarn --prod && yarn build
|
||||||
|
|
||||||
FROM alpine:3.21
|
FROM alpine:3.22
|
||||||
|
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
python3 py3-pip py3-setuptools py3-wheel \
|
python3 py3-pip py3-setuptools py3-wheel \
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM alpine:3.21
|
FROM alpine:3.22
|
||||||
|
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
python3 py3-pip py3-setuptools py3-wheel \
|
python3 py3-pip py3-setuptools py3-wheel \
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Awaitable
|
from typing import Any, Awaitable
|
||||||
from html import escape
|
from html import escape
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
|
@ -88,6 +88,7 @@ class MaubotMessageEvent(MessageEvent):
|
||||||
reply: bool | str = False,
|
reply: bool | str = False,
|
||||||
in_thread: bool | None = None,
|
in_thread: bool | None = None,
|
||||||
edits: EventID | MessageEvent | None = None,
|
edits: EventID | MessageEvent | None = None,
|
||||||
|
extra_content: dict[str, Any] | None = None,
|
||||||
) -> EventID:
|
) -> EventID:
|
||||||
"""
|
"""
|
||||||
Respond to the message.
|
Respond to the message.
|
||||||
|
@ -107,6 +108,7 @@ class MaubotMessageEvent(MessageEvent):
|
||||||
the root if necessary.
|
the root if necessary.
|
||||||
edits: An event ID or MessageEvent to edit. If set, the reply and in_thread parameters
|
edits: An event ID or MessageEvent to edit. If set, the reply and in_thread parameters
|
||||||
are ignored, as edits can't change the reply or thread status.
|
are ignored, as edits can't change the reply or thread status.
|
||||||
|
extra_content: Extra content to add to the event.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The ID of the response event.
|
The ID of the response event.
|
||||||
|
@ -143,6 +145,9 @@ class MaubotMessageEvent(MessageEvent):
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
content.set_reply(self)
|
content.set_reply(self)
|
||||||
|
if extra_content:
|
||||||
|
for k, v in extra_content.items():
|
||||||
|
content[k] = v
|
||||||
return await self.client.send_message_event(self.room_id, event_type, content)
|
return await self.client.send_message_event(self.room_id, event_type, content)
|
||||||
|
|
||||||
def reply(
|
def reply(
|
||||||
|
@ -152,6 +157,7 @@ class MaubotMessageEvent(MessageEvent):
|
||||||
markdown: bool = True,
|
markdown: bool = True,
|
||||||
allow_html: bool = False,
|
allow_html: bool = False,
|
||||||
in_thread: bool | None = None,
|
in_thread: bool | None = None,
|
||||||
|
extra_content: dict[str, Any] | None = None,
|
||||||
) -> Awaitable[EventID]:
|
) -> Awaitable[EventID]:
|
||||||
"""
|
"""
|
||||||
Reply to the message. The parameters are the same as :meth:`respond`,
|
Reply to the message. The parameters are the same as :meth:`respond`,
|
||||||
|
@ -169,6 +175,7 @@ class MaubotMessageEvent(MessageEvent):
|
||||||
thread. If set to ``False``, the response will never be in a thread. If set to
|
thread. If set to ``False``, the response will never be in a thread. If set to
|
||||||
``True``, the response will always be in a thread, creating one with this event as
|
``True``, the response will always be in a thread, creating one with this event as
|
||||||
the root if necessary.
|
the root if necessary.
|
||||||
|
extra_content: Extra content to add to the event.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The ID of the response event.
|
The ID of the response event.
|
||||||
|
@ -180,6 +187,7 @@ class MaubotMessageEvent(MessageEvent):
|
||||||
reply=True,
|
reply=True,
|
||||||
in_thread=in_thread,
|
in_thread=in_thread,
|
||||||
allow_html=allow_html,
|
allow_html=allow_html,
|
||||||
|
extra_content=extra_content,
|
||||||
)
|
)
|
||||||
|
|
||||||
def mark_read(self) -> Awaitable[None]:
|
def mark_read(self) -> Awaitable[None]:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue