Skip to content

Commit

Permalink
feat(core): add bot.getMsg()
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Oct 18, 2020
1 parent 2bfb615 commit abe85f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/adapter-cqhttp/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ defineAsync('set_group_anonymous', 'group_id', 'enable')
defineAsync('set_group_card', 'group_id', 'user_id', 'card')
defineAsync('set_group_leave', 'group_id', 'is_dismiss')
defineAsync('set_group_special_title', 'group_id', 'user_id', 'special_title', 'duration')
defineSync('get_msg', 'message_id')
defineSync('get_login_info')
defineSync('get_stranger_info', 'user_id', 'no_cache')
defineSync('get_friend_list')
Expand Down
3 changes: 2 additions & 1 deletion packages/koishi-core/src/server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { camelCase, paramCase, sleep } from 'koishi-utils'
import { Session, MessageType, Meta } from './session'
import { Session, MessageType, Meta, MessageInfo } from './session'
import { App, AppStatus } from './app'
import * as http from 'http'
import type Koa from 'koa'
Expand Down Expand Up @@ -112,6 +112,7 @@ export enum BotStatusCode {
export interface Bot extends BotOptions {
ready?: boolean
version?: string
getMsg(messageId: number): Promise<MessageInfo>
getSelfId(): Promise<number>
getStatusCode(): Promise<BotStatusCode>
getMemberMap(groupId: number): Promise<Record<number, string>>
Expand Down

0 comments on commit abe85f8

Please sign in to comment.