Skip to content

Commit

Permalink
fix: reply id string=>int
Browse files Browse the repository at this point in the history
  • Loading branch information
lc-cn committed Jan 14, 2024
1 parent afe2e37 commit 67a17e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
14 changes: 4 additions & 10 deletions src/adapters/icqq/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,17 +264,11 @@ export default class IcqqAdapter extends Adapter<"icqq"> {
getMessage<V extends OneBot.Version>(
uin: string,
version: V,
args: [string],
[message_id]: [string],
): Promise<OneBot.Message<V>> {
const oneBot = this.getOneBot<Client>(uin);
const num = Number(args[0]);
if (num) {
return oneBot[version].action.getMsg.call(oneBot[version], num) as Promise<
OneBot.Message<V>
>;
} else {
return oneBot.internal.getMsg(args[0]);
}
if (!oneBot) throw new Error("No one");
return oneBot.internal.getMsg(message_id);
}

call<V extends OneBot.Version>(
Expand Down Expand Up @@ -354,7 +348,7 @@ export default class IcqqAdapter extends Adapter<"icqq"> {
data: Object.fromEntries(
valueArr.map(item => {
const [key, value] = item.split("=");
return [key, value];
return [key, type === "reply" && key === "id" ? +value : value];
}),
),
});
Expand Down
2 changes: 1 addition & 1 deletion src/service/V12/action/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class CommonAction {
* 获取消息详情
*/
async getMsg(this: V12, message_id: string) {
const message = await this.adapter.call(this.oneBot.uin, "V12", "getMsg", [message_id]);
const message = await this.adapter.call(this.oneBot.uin, "V12", "getMessage", [message_id]);
if (!message) throw new Error("消息不存在");
return message;
}
Expand Down

0 comments on commit 67a17e0

Please sign in to comment.