Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

Commit

Permalink
slider
Browse files Browse the repository at this point in the history
  • Loading branch information
takayama-lily committed Dec 25, 2020
1 parent 30c42d1 commit 2903d73
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 14 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
```js
const {createClient} = require("oicq");
const uin = 123456789; // your account
const bot = createClient(uin, {
slider: true //打开滑动验证码 (新号不打开可能出现环境异常等问题)
});
const bot = createClient(uin);

//监听并输入滑动验证码ticket
bot.on("system.login.slider", ()=>{
Expand Down Expand Up @@ -56,4 +54,3 @@ bot.login("password"); // your password or password_md5
[API](./docs/api.md)
[事件](./docs/event.md)
[消息ID规则](./docs/msgid.md)
[常见问题](https://github.com/takayama-lily/onebot/issues/12)
2 changes: 1 addition & 1 deletion client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface ConfBot {
resend?: boolean, //被风控时是否尝试用分片发送,默认true (一种古老的消息,暂不支持分片重组)
data_dir?: string, //数据存储文件夹,需要可写权限,默认主目录下的data文件夹

slider?: boolean, //启用滑动验证码,默认false
slider?: boolean, //启用滑动验证码,默认true

//触发system.offline.network事件后的重连间隔秒数,默认5(秒),不建议设置低于3(秒)
//瞬间的断线重连不会触发此事件,通常你的机器真的没有网络或登陆无响应时才会触发
Expand Down
4 changes: 2 additions & 2 deletions client.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ class AndroidClient extends Client {
platform: 2,
log_level: "info",
kickoff: false,
ignore_self:true,
ignore_self: true,
resend: true,
reconn_interval: 5,
slider: false,
slider: true,
data_dir: path.join(process.mainModule.path, "data"),
...config
};
Expand Down
3 changes: 1 addition & 2 deletions docs/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ const uin = 123456789;
const bot = createClient(uin, {
log_level: "debug", //日志级别设置为debug
platform: 1, //登录设备选择为手机
slider: true, //打开滑动验证码
});

//监听并输入滑动验证码ticket
//监听并输入滑动验证码ticket(同一地点只需验证一次)
bot.on("system.login.slider", ()=>{
process.stdin.once("data", (input)=>{
bot.sliderLogin(input);
Expand Down
6 changes: 3 additions & 3 deletions lib/friendlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ async function initFL() {
async function initGL() {
this.sync_finished = false;
this.gl = new Map;
const GetTroopListReqV2 = jce.encodeStruct([
const GetTroopListReqV2Simplify = jce.encodeStruct([
this.uin, 0, null, [], 1, 8, 0, 1, 1
]);
const extra = {
req_id: this.seq_id + 1,
service: "mqq.IMService.FriendListServiceServantObj",
method: "GetTroopListReqV2",
method: "GetTroopListReqV2Simplify",
};
const body = jce.encodeWrapper({GetTroopListReqV2}, extra);
const body = jce.encodeWrapper({GetTroopListReqV2Simplify}, extra);
try {
const blob = await this.sendUNI("friendlist.GetTroopListReqV2", body);
const nested = jce.decodeWrapper(blob);
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oicq",
"version": "1.12.2",
"version": "1.12.3",
"upday": "2020/12/26",
"description": "QQ protocol!",
"main": "client.js",
Expand Down

0 comments on commit 2903d73

Please sign in to comment.