File tree Expand file tree Collapse file tree 4 files changed +38
-0
lines changed Expand file tree Collapse file tree 4 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,9 @@ class Client {
172
172
changeAudienceGroupAuthorityLevel(
173
173
authorityLevel : Types .AudienceGroupAuthorityLevel
174
174
): Promise <{}>
175
+
176
+ // Bot
177
+ getBotInfo(): Promise <BotInfoResponse >
175
178
}
176
179
```
177
180
@@ -667,3 +670,9 @@ It corresponds to the [Get number of followers](https://developers.line.biz/en/r
667
670
#### ` getFriendDemographics(): Promise<Types.FriendDemographics> `
668
671
669
672
It corresponds to the [ Get friend demographics] ( https://developers.line.biz/en/reference/messaging-api/#get-demographic ) API.
673
+
674
+ ### Bot
675
+
676
+ #### ` getBotInfo(): Promise<BotInfoResponse> `
677
+
678
+ It corresponds to the [ Get bot info] ( https://developers.line.biz/en/reference/messaging-api/#get-bot-info ) API.
Original file line number Diff line number Diff line change @@ -630,6 +630,13 @@ export default class Client {
630
630
) ;
631
631
return ensureJSON ( res ) ;
632
632
}
633
+
634
+ public async getBotInfo ( ) : Promise < Types . BotInfoResponse > {
635
+ const res = await this . http . get < Types . BotInfoResponse > (
636
+ `${ MESSAGING_API_PREFIX } /info` ,
637
+ ) ;
638
+ return ensureJSON ( res ) ;
639
+ }
633
640
}
634
641
635
642
export class OAuth {
Original file line number Diff line number Diff line change @@ -2482,3 +2482,18 @@ export type GroupSummaryResponse = {
2482
2482
export type MembersCountResponse = {
2483
2483
count : number ;
2484
2484
} ;
2485
+
2486
+ /**
2487
+ * Response body of get bot info.
2488
+ *
2489
+ * @see [Get bot info](https://developers.line.biz/en/reference/messaging-api/#get-bot-info)
2490
+ */
2491
+ export type BotInfoResponse = {
2492
+ userId : string ;
2493
+ basicId : string ;
2494
+ premiumId ?: string ;
2495
+ displayName : string ;
2496
+ pictureUrl ?: string ;
2497
+ chatMode : "chat" | "bot" ;
2498
+ markAsReadMode : "auto" | "manual" ;
2499
+ } ;
Original file line number Diff line number Diff line change @@ -960,6 +960,13 @@ describe("client", () => {
960
960
equal ( err . message , "invalid data type for binary data" ) ;
961
961
}
962
962
} ) ;
963
+
964
+ it ( "getBotInfo" , async ( ) => {
965
+ const scope = mockGet ( MESSAGING_API_PREFIX , `/info` ) ;
966
+
967
+ await client . getBotInfo ( ) ;
968
+ equal ( scope . isDone ( ) , true ) ;
969
+ } ) ;
963
970
} ) ;
964
971
965
972
const oauth = new OAuth ( ) ;
You can’t perform that action at this time.
0 commit comments