File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ import {
3333 StateEvent ,
3434 Logger ,
3535 MultipleErrors ,
36+ ClientCapabilitiesNegotiation ,
37+ ClientCapabilitiesResponse ,
3638} from 'matrix-protection-suite' ;
3739import { MatrixSendClient } from '../MatrixEmitter' ;
3840import { getRelationsForEvent } from './PaginationAPIs' ;
@@ -148,6 +150,7 @@ export function resultifyBotSDKRequestError(
148150
149151export class BotSDKBaseClient
150152 implements
153+ ClientCapabilitiesNegotiation ,
151154 RoomBanner ,
152155 RoomCreator ,
153156 RoomEventGetter ,
@@ -173,6 +176,17 @@ export class BotSDKBaseClient
173176 // nothing to do.
174177 }
175178
179+ public async getClientCapabilities ( ) : Promise <
180+ ActionResult < ClientCapabilitiesResponse >
181+ > {
182+ return await this . client
183+ . doRequest ( 'GET' , '/_matrix/client/v3/capabilities' )
184+ . then (
185+ ( value ) => Value . Decode ( ClientCapabilitiesResponse , value ) ,
186+ resultifyBotSDKRequestError
187+ ) ;
188+ }
189+
176190 public async sendMessage < TContent extends MessageContent > (
177191 roomID : StringRoomID ,
178192 content : TContent
Original file line number Diff line number Diff line change 33// SPDX-License-Identifier: AFL-3.0
44
55import {
6+ ClientCapabilitiesNegotiation ,
67 ClientPlatform ,
78 RoomBanner ,
89 RoomCreator ,
@@ -25,6 +26,11 @@ export class BotSDKClientPlatform implements ClientPlatform {
2526 constructor ( private readonly allClient : BotSDKBaseClient ) {
2627 // nothing to do,
2728 }
29+
30+ toClientCapabilitiesNegotiation ( ) : ClientCapabilitiesNegotiation {
31+ return this . allClient ;
32+ }
33+
2834 toRoomBanner ( ) : RoomBanner {
2935 return this . allClient ;
3036 }
You can’t perform that action at this time.
0 commit comments