Skip to content

Commit

Permalink
docs: 更新开发文档
Browse files Browse the repository at this point in the history
  • Loading branch information
msojocs committed Nov 8, 2024
1 parent cd07a60 commit 8b5cd63
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 12 deletions.
23 changes: 18 additions & 5 deletions docs/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,38 @@

1. 进入官网:https://im.qq.com/index/
2. 下载对应平台的安装包
3. ***解压*** 到任意文件夹,移动其中的Files目录中的文件到 **项目**`program`目录下(注意,**不能**将文件夹下的文件加入git版本控制)
3. 使用7z打开安装包
4. ***解压*** `/Files/versions/x.x.xx-xxxxx` 目录中的文件到 **项目**`program`目录下(注意,**不能**将文件夹下的文件加入git版本控制)
5. 解压 `QQ.exe` 文件到**项目**`program`目录下。

大致结构如下:
```
Yui
├─program
│ ├─lib
│ ├─locales
│ ├─obj
│ └─resources
│ ├─resources
│ ├─versions
│ ├─....
│ └─QQ.exe
├─src
├─tools
....
```

双击 QQ.exe,能启动,说明此步骤成功。

## 3. 跳过启动验证

1. 打开地址: https://github.com/project-yui/Yui-patch
2. 下载 release 中的 `dbghelp.dll` 文件,放置于 pragram 文件夹下。
3. 复制 `program\resources\app\package.json`, `program\resources\app\package.patch.json`;
4. 修改 `package.patch.json` 内容,`main` 字段修改为 `./app_launcher/index.js`

## 4. 启动

1. pnpm run dev
2. pnpm run nodestart
3. 看到输出中包含:`Hi Yui bot!!`

# 二、开发介绍

Expand Down
Binary file removed resources/hack/dbghelp.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions resources/hack/patch.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"resources\\app\\package.json": {
"target": "resources\\app\\package.original.json",
"target": "resources\\app\\package.patch.json",
"content": "",
"cur": 0,
"start": 3,
"start": 1,
"end": 4
}
}
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { hookWrapper } from "./wrapper/hook";
global.module = module
const log = useLogger('Index')
try {
log.info('hi ntqq bot!! v0.0.2')
log.info('Hi Yui bot!!')
console.log(process.version)

process.on('unhandledRejection', (err) => {
Expand Down
2 changes: 1 addition & 1 deletion src/ntqq/core/service/nt-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const useNTWrapper = () => {
userStore[uin] = {
moduleIndex: idx,
info: {
uin: undefined,
uin: 0,
uid: undefined,
userNick: ""
},
Expand Down
6 changes: 3 additions & 3 deletions src/onebot/event/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const onRecvMsg = () => {
}
const ret: EventDataType<BotMessageData> = {
self: {
id: parseInt(user.uin),
id: user.uin,
uid: user.uid
},
time: parseInt(msg.msgTime),
Expand Down Expand Up @@ -113,7 +113,7 @@ const onAddSendMsg = () => {
const senderUserInfo = await getUserInfoByUid(msg.senderUid)
const ret: EventDataType<BotMessageData> = {
self: {
id: parseInt(user.uin),
id: user.uin,
uid: user.uid
},
time: parseInt(msg.msgTime),
Expand Down Expand Up @@ -166,7 +166,7 @@ const onUpdateMsg = () => {
// 是撤回消息
const ret: EventDataType<RecallMessageData> = {
self: {
id: parseInt(user.uin),
id: user.uin,
uid: user.uid
},
time: parseInt(msg.msgTime),
Expand Down

0 comments on commit 8b5cd63

Please sign in to comment.