Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

二维码签到,只解析,不签到 #45

Open
DangerFickle opened this issue Oct 25, 2022 · 5 comments
Open

二维码签到,只解析,不签到 #45

DangerFickle opened this issue Oct 25, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@DangerFickle
Copy link

image

@clansty
Copy link
Owner

clansty commented Oct 25, 2022

这看起来是另一种二维码签到,需要研究

@clansty clansty added the bug Something isn't working label Oct 25, 2022
@SummonHIM
Copy link
Contributor

照着这么改就ok了

diff --git a/handlers/attachGroupMessageHandler.ts b/handlers/attachGroupMessageHandler.ts
index a525bce..afd926e 100644
--- a/handlers/attachGroupMessageHandler.ts
+++ b/handlers/attachGroupMessageHandler.ts
@@ -29,7 +29,7 @@ export default (bot: Client) => bot.on('message.group', async data => {
             const dec = await decodeQrCode(buf)
             let message = '二维码解码:\n' + dec + '\n'
             //解析签到参数
-            const REGEX_ENC = /SIGNIN:.*aid=(\d+)&.*&enc=([\dA-F]+)/
+            const REGEX_ENC = /e\?.*id=(\d+)&.*&enc=([\dA-F]+)/
             if (REGEX_ENC.test(dec)) {
                 const exec = REGEX_ENC.exec(dec)
                 message += `aid: ${exec[1]}\nenc: ${exec[2]}\n正在执行签到...`
@@ -48,7 +48,7 @@ export default (bot: Client) => bot.on('message.group', async data => {
             else
                 data.reply(message)
         } catch (e) {
-            // data.reply(`二维码解码失败:${e}`)
+            data.reply(`二维码解码失败:${e}`)
         }
     }
     else {

@clansty
Copy link
Owner

clansty commented Dec 6, 2022 via email

@DangerFickle
Copy link
Author

单独改一下正则就完了
image

@SummonHIM
Copy link
Contributor

单独改一下正则就完了 image

确实,下面那玩意我是拿来看错误的

起码出错了我知道咋回事罢了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants