Skip to content

Commit

Permalink
fix: 修正 ReactMessageWithEmoji Api错误
Browse files Browse the repository at this point in the history
  • Loading branch information
CakmLexi committed Jul 3, 2024
1 parent fcb3019 commit 8b29230
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
19 changes: 9 additions & 10 deletions src/adapter/onebot/onebot11.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1299,15 +1299,15 @@ export class AdapterOneBot11 implements KarinAdapter {
return result
}

// /**
// * 对消息进行表情回应
// * @param Contact - 联系人信息
// * @param message_id - 消息ID
// * @param face_id - 表情ID
// */
// async ReactMessageWithEmoji(Contact: any, message_id: any, face_id: any, is_set = true) {
// return await this.SendApi('set_msg_emoji_like', { message_id, emoji_id: face_id, is_set })
// }
/**
* 对消息进行表情回应
* @param contact - 联系人信息
* @param message_id - 消息ID
* @param face_id - 表情ID
*/
async ReactMessageWithEmoji (contact: contact, message_id: string, face_id: number, is_set = true) {
return await this.SendApi('set_msg_emoji_like', { message_id, emoji_id: face_id, is_set })
}

/**
* 获取版本信息
Expand All @@ -1329,7 +1329,6 @@ export class AdapterOneBot11 implements KarinAdapter {
async SetFriendApplyResult () { }
async SetGroupApplyResult () { }
async SetInvitedJoinGroupResult () { }
async ReactMessageWithEmoji () { }
async UploadPrivateFile () { }
async UploadGroupFile () { }
async sendForwardMessage () {
Expand Down
19 changes: 18 additions & 1 deletion src/types/onebots11.ts
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ export type ByPostType<T extends EventPostType> = Extract<OneBot11Event, { post_
/**
* - OneBot11公开Api
*/
export type OneBot11Api = 'send_private_msg' | 'send_group_msg' | 'send_msg' | 'delete_msg' | 'get_msg' | 'get_forward_msg' | 'send_like' | 'set_group_kick' | 'set_group_ban' | 'set_group_anonymous_ban' | 'set_group_whole_ban' | 'set_group_admin' | 'set_group_anonymous' | 'set_group_card' | 'set_group_name' | 'set_group_leave' | 'set_group_special_title' | 'set_friend_add_request' | 'set_group_add_request' | 'get_login_info' | 'get_stranger_info' | 'get_friend_list' | 'get_group_info' | 'get_group_list' | 'get_group_member_info' | 'get_group_member_list' | 'get_group_honor_info' | 'get_cookies' | 'get_csrf_token' | 'get_credentials' | 'get_record' | 'get_image' | 'can_send_image' | 'can_send_record' | 'get_status' | 'get_version_info' | 'set_restart' | 'clean_cache' | 'get_version' | 'send_forward_msg' | 'get_friend_msg_history' | 'get_group_msg_history'
export type OneBot11Api = 'send_private_msg' | 'send_group_msg' | 'send_msg' | 'delete_msg' | 'get_msg' | 'get_forward_msg' | 'send_like' | 'set_group_kick' | 'set_group_ban' | 'set_group_anonymous_ban' | 'set_group_whole_ban' | 'set_group_admin' | 'set_group_anonymous' | 'set_group_card' | 'set_group_name' | 'set_group_leave' | 'set_group_special_title' | 'set_friend_add_request' | 'set_group_add_request' | 'get_login_info' | 'get_stranger_info' | 'get_friend_list' | 'get_group_info' | 'get_group_list' | 'get_group_member_info' | 'get_group_member_list' | 'get_group_honor_info' | 'get_cookies' | 'get_csrf_token' | 'get_credentials' | 'get_record' | 'get_image' | 'can_send_image' | 'can_send_record' | 'get_status' | 'get_version_info' | 'set_restart' | 'clean_cache' | 'get_version' | 'send_forward_msg' | 'get_friend_msg_history' | 'get_group_msg_history' | 'set_msg_emoji_like'

/**
* - OneBot11公开Api参数 params
Expand Down Expand Up @@ -1420,6 +1420,23 @@ export type OneBot11ApiParams = {
*/
message_count: number
}
/**
* - 对消息进行表情回应
*/
set_msg_emoji_like: {
/**
* - 需要回应的消息 ID
*/
message_id: string
/**
* - 回应的表情 ID
*/
emoji_id: number
/**
* - 设置、取消
*/
is_set: boolean
}
}

/**
Expand Down

0 comments on commit 8b29230

Please sign in to comment.