This repository has been archived by the owner on Nov 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 397
使用情况问卷调查 #354
Comments
希望能有图文混排的功能 |
我遇到了一个webapi问题,在我尝试使用 var http = require('https');
/**
* 发送给get/post请求 向https链接
* @param {string} HOST
* @param {number} PORT
* @param {string} method GET/POST
* @param {object} bodydata
* @param {function} callBackFunction
* @param {string} path
* @param {string} cookie
*/
function nodePostGetRequest(HOST, PORT = 443, method, bodydata, callBackFunction, path, cookie) {
//把将要发送的body转换为json格式
var body = bodydata;
var bodyString = JSON.stringify(body);
//http 头部
var headers = {
'Content-Type': 'application/json',
'Content-Length': bodyString.length,
'Cookie': cookie
};
//用与发送的参数类型
var options = {
host: HOST, //ip
port: PORT, //port
path: path, //get方式使用的地址
method: method, //get方式或post方式
headers: headers
};
var req = http.request(options, function (res) {
res.setEncoding('utf-8');
var responseString = '';
res.on('data', function (data) {
responseString += data;
});
res.on('end', function () {
//这里接收的参数是字符串形式,需要格式化成json格式使用
var resultObject = JSON.parse(responseString);
console.log('-----resBody-----', resultObject);
callBackFunction(resultObject);
});
req.on('error', function (e) {
// TODO: handle error.
console.log('-----error-------', e);
});
});
req.write(bodyString);
req.end();
}
function getGTK(str) {
var hash = 5381;
for (var i = 0, len = str.length; i < len; ++i) {
hash += (hash << 5) + str.charAt(i).charCodeAt();
}
return hash & 0x7fffffff;
}
// 尝试请求api 却返回结果`没有g_tk或g_tk计算错误`
nodePostGetRequest("club.vip.qq.com", 443, "GET", "", function (data) {
}, "/api/vip/getQQLevelInfo?g_tk="+getGTK(bot.cookies["vip.qq.com"])+"&requestBody="+JSON.stringify({ iUin: 10005 }), bot.cookies["vip.qq.com"]); |
你好,请问是否支持群成员点赞功能? |
大佬更新一下QQ协议版本qwq....... 新注册的QQ只能登录1-2天,然后就会掉线,变成哪个协议都登录不上去了,扫码密码同IP都不行。但是老QQ号扫码都能上。然后部署了一个go-cqhttp(https://docs.go-cqhttp.org/),新QQ扫码也能够上去,希望大佬更新一下协议和版本! 这是新QQ号掉线后: |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
群内发送大段消息或图文时被风控的情况
关于稳定性
希望使用QQ频道的哪些功能
The text was updated successfully, but these errors were encountered: