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

Commit

Permalink
add demo
Browse files Browse the repository at this point in the history
  • Loading branch information
takayama-lily committed Nov 6, 2021
1 parent 6f9912b commit 7126e46
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions demo/get-friend-online-status.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"use strict"
try {
var { createClient, core } = require("../lib")
} catch {
var { createClient, core } = require("oicq")
}
const jce = core.jce

const client = createClient(147258369)
client.login()

client.on("system.online", async function () {
const FSOLREQ = jce.encodeStruct([
this.uin, 0, 0, null, 1, 31, 0
])
const body = jce.encodeWrapper({ FSOLREQ }, "mqq.IMService.FriendListServiceServantObj", "GetSimpleOnlineFriendInfoReq")
const payload = await this.sendUni("friendlist.GetSimpleOnlineFriendInfoReq", body)
const rsp = jce.decodeWrapper(payload)[1]
console.log("我的好友在线状态:", rsp)
})

0 comments on commit 7126e46

Please sign in to comment.