mautrix.appservice

class mautrix.appservice.AppService

Bases: mautrix.appservice.AppServiceServerMixin

The main AppService container.

__init__(server, domain, as_token, hs_token, bot_localpart, id, loop=None, log=None, verify_ssl=True, tls_cert=None, tls_key=None, query_user=None, query_alias=None, bridge_name=None, state_store=None, aiohttp_params=None, ephemeral_events=False, encryption_events=False, default_ua='mautrix-python/0.20.6 aiohttp/3.8.1 Python/3.10.0', default_http_retry_count=0, connection_limit=None)
Parameters
  • server (str) –

  • domain (str) –

  • as_token (str) –

  • hs_token (str) –

  • bot_localpart (str) –

  • id (str) –

  • loop (Optional[asyncio.events.AbstractEventLoop]) –

  • log (Optional[Union[logging.Logger, str]]) –

  • verify_ssl (bool) –

  • tls_cert (Optional[str]) –

  • tls_key (Optional[str]) –

  • query_user (Optional[Callable[[aiohttp.web_request.Request], Awaitable[Optional[aiohttp.web_response.Response]]]]) –

  • query_alias (Optional[Callable[[aiohttp.web_request.Request], Awaitable[Optional[aiohttp.web_response.Response]]]]) –

  • bridge_name (Optional[str]) –

  • state_store (Optional[mautrix.appservice.ASStateStore]) –

  • aiohttp_params (Optional[dict]) –

  • ephemeral_events (bool) –

  • encryption_events (bool) –

  • default_ua (str) –

  • default_http_retry_count (int) –

  • connection_limit (Optional[int]) –

Return type

None

property http_session: aiohttp.ClientSession
property intent: mautrix.appservice.IntentAPI
async ping_self(txn_id=None)
Parameters

txn_id (Optional[str]) –

Return type

int

async start(host='127.0.0.1', port=8080)
Parameters
  • host (str) –

  • port (int) –

Return type

None

async stop()
Return type

None

server: str
domain: str
id: str
verify_ssl: bool
tls_cert: str | None
tls_key: str | None
as_token: str
hs_token: str
bot_mxid: UserID
default_ua: str
default_http_retry_count: int
bridge_name: str | None
state_store: ASStateStore
transactions: set[str]
query_user: Callable[[UserID], JSON]
query_alias: Callable[[RoomAlias], JSON]
ready: bool
live: bool
loop: asyncio.AbstractEventLoop
log: TraceLogger
app: web.Application
runner: web.AppRunner | None