feat: autoAttention API增加对重复关注的处理

This commit is contained in:
andywang425 2023-09-02 17:50:28 +08:00 committed by shanmite
parent 16c113fd87
commit 201770573e

View File

@ -259,11 +259,11 @@ const bili_client = {
* @property {number} sender_uid
* @property {number} talker_id
* @property {number} msg_seqno
*
*
* @typedef SessionInfo
* @property {number} has_more
* @property {SessionData[]} data
*
*
* @param {number} session_type 1 已关注 2 未关注 3 应援团
* @param {string} [ts_16]
* @returns {Promise<SessionInfo>}
@ -397,7 +397,7 @@ const bili_client = {
}
},
/**
* @param {string} short_id
* @param {string} short_id
* @returns {Promise<string>}
*/
async shortDynamicIdToDyid(short_id) {
@ -737,6 +737,8 @@ const bili_client = {
return [false, 4, '账号异常']
case 22009:
return [false, 5, '关注已达上限']
case 22014:
return [false, 6, '已经关注用户,无法重复关注']
default:
return [true, 1, `未知错误\n${responseText}`]
}
@ -748,12 +750,13 @@ const bili_client = {
* @param {Number} uid
* 被关注者的UID
* @returns {Promise<number>}
* - 成功 0
* - 未知错误 1
* - 您已被对方拉入黑名单 2
* - 黑名单用户无法关注 3
* - 账号异常 4
* - 关注已达上限 5
* - 成功 0
* - 未知错误 1
* - 您已被对方拉入黑名单 2
* - 黑名单用户无法关注 3
* - 账号异常 4
* - 关注已达上限 5
* - 已经关注用户 6
*/
autoAttention(uid) {
return this._autoAttention.run(uid)
@ -763,8 +766,8 @@ const bili_client = {
* @param {number} uid
* @param {number} tagid 关注分区的ID
* @returns {Promise<number>}
* - 成功 0
* - 失败 1
* - 成功 0
* - 失败 1
*/
async movePartition(uid, tagid) {
const responseText = await post({
@ -816,7 +819,7 @@ const bili_client = {
* 动态自动点赞
* @param {string} dyid
* @returns {Promise<number>}
* - 成功 0
* - 成功 0
* - 未知错误 1
* - 点赞异常 2
* - 点赞频繁 3
@ -865,11 +868,11 @@ const bili_client = {
* @param {string} [msg]
* 动态的ID
* @returns {Promise<number>}
* - 成功 0
* - 未知错误 1
* - 该动态不能转发分享 2
* - 请求数据发生错误请刷新或稍后重试 3
* - 操作太频繁了请稍后重试 4
* - 成功 0
* - 未知错误 1
* - 该动态不能转发分享 2
* - 请求数据发生错误请刷新或稍后重试 3
* - 操作太频繁了请稍后重试 4
*/
async autoRelay(uid, dyid, msg = '转发动态', ctrl = '[]') {
const len = msg.length;
@ -912,7 +915,7 @@ const bili_client = {
/**
* 预约抽奖
* @param {string} reserve_id
* @returns
* @returns
*/
async reserve_lottery(reserve_id) {
const
@ -1238,9 +1241,9 @@ const bili_client = {
}
},
/**
* 检查分区
* 不存在指定分区时创建
* 获取到tagid添加为对象的属性
* 检查分区
* 不存在指定分区时创建
* 获取到tagid添加为对象的属性
* @param {string} [name]
* @returns {Promise<number>}
*/
@ -1332,4 +1335,4 @@ const bili_client = {
};
module.exports = bili_client
module.exports = bili_client