onebots 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +84 -63
- package/lib/bin.d.ts +2 -2
- package/lib/bin.js +11 -5
- package/lib/config.sample.yaml +31 -0
- package/lib/db.d.ts +19 -19
- package/lib/db.js +91 -91
- package/lib/index.d.ts +5 -5
- package/lib/index.js +21 -21
- package/lib/onebot.d.ts +44 -44
- package/lib/onebot.js +133 -86
- package/lib/server/app.d.ts +52 -52
- package/lib/server/app.js +235 -232
- package/lib/server/router.d.ts +9 -9
- package/lib/server/router.js +32 -32
- package/lib/service/V11/action/common.d.ts +65 -65
- package/lib/service/V11/action/common.js +142 -142
- package/lib/service/V11/action/friend.d.ts +38 -38
- package/lib/service/V11/action/friend.js +44 -44
- package/lib/service/V11/action/group.d.ts +104 -104
- package/lib/service/V11/action/group.js +138 -138
- package/lib/service/V11/action/index.d.ts +9 -9
- package/lib/service/V11/action/index.js +10 -10
- package/lib/service/V11/config.d.ts +10 -10
- package/lib/service/V11/config.js +2 -2
- package/lib/service/V11/index.d.ts +95 -95
- package/lib/service/V11/index.js +499 -499
- package/lib/service/V12/action/common.d.ts +37 -33
- package/lib/service/V12/action/common.js +114 -108
- package/lib/service/V12/action/friend.d.ts +13 -13
- package/lib/service/V12/action/friend.js +15 -15
- package/lib/service/V12/action/group.d.ts +104 -104
- package/lib/service/V12/action/group.js +138 -138
- package/lib/service/V12/action/guild.d.ts +2 -2
- package/lib/service/V12/action/guild.js +6 -6
- package/lib/service/V12/action/index.d.ts +10 -10
- package/lib/service/V12/action/index.js +11 -11
- package/lib/service/V12/config.d.ts +17 -17
- package/lib/service/V12/config.js +2 -2
- package/lib/service/V12/index.d.ts +121 -102
- package/lib/service/V12/index.js +533 -538
- package/lib/types.d.ts +3 -3
- package/lib/types.js +2 -2
- package/lib/utils.d.ts +14 -14
- package/lib/utils.js +150 -150
- package/package.json +58 -58
|
@@ -1,33 +1,37 @@
|
|
|
1
|
-
import { V12 } from '../../../service/V12';
|
|
2
|
-
import { OnlineStatus } from "oicq";
|
|
3
|
-
import { Action } from "./";
|
|
4
|
-
export declare class CommonAction {
|
|
5
|
-
sendMsg(): void;
|
|
6
|
-
/**
|
|
7
|
-
* 撤回消息
|
|
8
|
-
* @param message_id {string} 消息id
|
|
9
|
-
*/
|
|
10
|
-
deleteMsg(this: V12, message_id: string): Promise<boolean>;
|
|
11
|
-
getSelfInfo(this: V12): {
|
|
12
|
-
user_id: number;
|
|
13
|
-
nickname: string;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
good: boolean;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
import { V12 } from '../../../service/V12';
|
|
2
|
+
import { OnlineStatus } from "oicq";
|
|
3
|
+
import { Action } from "./";
|
|
4
|
+
export declare class CommonAction {
|
|
5
|
+
sendMsg(): void;
|
|
6
|
+
/**
|
|
7
|
+
* 撤回消息
|
|
8
|
+
* @param message_id {string} 消息id
|
|
9
|
+
*/
|
|
10
|
+
deleteMsg(this: V12, message_id: string): Promise<boolean>;
|
|
11
|
+
getSelfInfo(this: V12): {
|
|
12
|
+
user_id: number;
|
|
13
|
+
nickname: string;
|
|
14
|
+
user_displayname: string;
|
|
15
|
+
};
|
|
16
|
+
getStatus(this: V12): {
|
|
17
|
+
good: boolean;
|
|
18
|
+
bots: {
|
|
19
|
+
self: any;
|
|
20
|
+
online: OnlineStatus;
|
|
21
|
+
}[];
|
|
22
|
+
};
|
|
23
|
+
getLatestEvents(this: V12, limit?: number, timout?: number): Promise<V12.Payload<keyof Action>[]>;
|
|
24
|
+
getVersion(this: V12): {
|
|
25
|
+
impl: string;
|
|
26
|
+
platform: string;
|
|
27
|
+
version: string;
|
|
28
|
+
onebot_version: string;
|
|
29
|
+
};
|
|
30
|
+
callLogin(this: V12, func: string, ...args: any[]): Promise<unknown>;
|
|
31
|
+
submitSlider(this: V12, ticket: string): Promise<any>;
|
|
32
|
+
submitSmsCode(this: V12, code: string): Promise<any>;
|
|
33
|
+
sendSmsCode(this: V12): Promise<any>;
|
|
34
|
+
login(this: V12, password?: string): any;
|
|
35
|
+
logout(this: V12, keepalive?: boolean): Promise<unknown>;
|
|
36
|
+
getSupportedActions(this: V12): string[];
|
|
37
|
+
}
|
|
@@ -1,108 +1,114 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CommonAction = void 0;
|
|
4
|
-
const oicq_1 = require("oicq");
|
|
5
|
-
const onebot_1 = require("../../../onebot");
|
|
6
|
-
const utils_1 = require("../../../utils");
|
|
7
|
-
class CommonAction {
|
|
8
|
-
sendMsg() { }
|
|
9
|
-
/**
|
|
10
|
-
* 撤回消息
|
|
11
|
-
* @param message_id {string} 消息id
|
|
12
|
-
*/
|
|
13
|
-
deleteMsg(message_id) {
|
|
14
|
-
return this.client.deleteMsg(message_id);
|
|
15
|
-
}
|
|
16
|
-
getSelfInfo() {
|
|
17
|
-
return {
|
|
18
|
-
user_id: this.client.uin,
|
|
19
|
-
nickname: this.client.nickname
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
good: this.oneBot.status === onebot_1.OneBotStatus.Good
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommonAction = void 0;
|
|
4
|
+
const oicq_1 = require("oicq");
|
|
5
|
+
const onebot_1 = require("../../../onebot");
|
|
6
|
+
const utils_1 = require("../../../utils");
|
|
7
|
+
class CommonAction {
|
|
8
|
+
sendMsg() { }
|
|
9
|
+
/**
|
|
10
|
+
* 撤回消息
|
|
11
|
+
* @param message_id {string} 消息id
|
|
12
|
+
*/
|
|
13
|
+
deleteMsg(message_id) {
|
|
14
|
+
return this.client.deleteMsg(message_id);
|
|
15
|
+
}
|
|
16
|
+
getSelfInfo() {
|
|
17
|
+
return {
|
|
18
|
+
user_id: this.client.uin,
|
|
19
|
+
nickname: this.client.nickname,
|
|
20
|
+
user_displayname: ''
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
getStatus() {
|
|
24
|
+
return {
|
|
25
|
+
good: this.oneBot.status === onebot_1.OneBotStatus.Good,
|
|
26
|
+
bots: [
|
|
27
|
+
{
|
|
28
|
+
self: this.action.getSelfInfo.apply(this),
|
|
29
|
+
online: this.client.status = oicq_1.OnlineStatus.Online,
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
getLatestEvents(limit = 0, timout = 0) {
|
|
35
|
+
return new Promise(resolve => {
|
|
36
|
+
if (!this.history.length && timout !== 0) {
|
|
37
|
+
return setTimeout(() => resolve(this.action.getLatestEvents.apply(this, [limit, timout])), timout * 1000);
|
|
38
|
+
}
|
|
39
|
+
return resolve(this.history.reverse().filter((_, i) => limit === 0 ? true : i < limit));
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
getVersion() {
|
|
43
|
+
return {
|
|
44
|
+
impl: 'onebots',
|
|
45
|
+
platform: 'qq',
|
|
46
|
+
version: '0.0.15',
|
|
47
|
+
onebot_version: '12'
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
callLogin(func, ...args) {
|
|
51
|
+
return new Promise(async (resolve) => {
|
|
52
|
+
const receiveResult = (event) => {
|
|
53
|
+
this.client.off('system.login.qrcode', receiveResult);
|
|
54
|
+
this.client.off('system.login.device', receiveResult);
|
|
55
|
+
this.client.off('system.login.slider', receiveResult);
|
|
56
|
+
this.client.off('system.login.error', receiveResult);
|
|
57
|
+
resolve(event);
|
|
58
|
+
};
|
|
59
|
+
this.client.on('system.login.qrcode', receiveResult);
|
|
60
|
+
this.client.on('system.login.device', receiveResult);
|
|
61
|
+
this.client.on('system.login.slider', receiveResult);
|
|
62
|
+
this.client.on('system.login.error', receiveResult);
|
|
63
|
+
this.client.once('system.online', receiveResult);
|
|
64
|
+
try {
|
|
65
|
+
await this.client[func](...args);
|
|
66
|
+
}
|
|
67
|
+
catch (reason) {
|
|
68
|
+
receiveResult(reason);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
async submitSlider(ticket) {
|
|
73
|
+
return this.action.callLogin.apply(this, ['submitSlider', ticket]);
|
|
74
|
+
}
|
|
75
|
+
async submitSmsCode(code) {
|
|
76
|
+
return this.action.callLogin.apply(this, ['submitSmsCode', code]);
|
|
77
|
+
}
|
|
78
|
+
sendSmsCode() {
|
|
79
|
+
return new Promise(resolve => {
|
|
80
|
+
const receiveResult = (e) => {
|
|
81
|
+
const callback = (data) => {
|
|
82
|
+
this.client.off('internal.verbose', receiveResult);
|
|
83
|
+
this.client.off('system.login.error', receiveResult);
|
|
84
|
+
resolve(data);
|
|
85
|
+
};
|
|
86
|
+
if ((typeof e === 'string' && e.includes('已发送')) || typeof e !== 'string') {
|
|
87
|
+
callback(e);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
this.client.on('internal.verbose', receiveResult);
|
|
91
|
+
this.client.on('system.login.error', receiveResult);
|
|
92
|
+
this.client.sendSmsCode();
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
login(password) {
|
|
96
|
+
return this.action.callLogin.apply(this, ['login', password]);
|
|
97
|
+
}
|
|
98
|
+
logout(keepalive) {
|
|
99
|
+
return new Promise(async (resolve) => {
|
|
100
|
+
const receiveResult = (e) => {
|
|
101
|
+
this.client.off('system.offline', receiveResult);
|
|
102
|
+
resolve(e);
|
|
103
|
+
};
|
|
104
|
+
this.client.on('system.offline', receiveResult);
|
|
105
|
+
await this.client.logout(keepalive);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
getSupportedActions() {
|
|
109
|
+
return [...new Set((0, utils_1.getProperties)(this.action))].filter(key => {
|
|
110
|
+
return key !== 'constructor';
|
|
111
|
+
}).map(utils_1.toLine);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
exports.CommonAction = CommonAction;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { V12 } from "../index";
|
|
2
|
-
import { Sendable } from "oicq";
|
|
3
|
-
export declare class FriendAction {
|
|
4
|
-
getUserInfo(this: V12, user_id: number): Promise<{
|
|
5
|
-
user_id: number;
|
|
6
|
-
nickname: string;
|
|
7
|
-
sex: import("oicq").Gender;
|
|
8
|
-
age: number;
|
|
9
|
-
area: string;
|
|
10
|
-
}>;
|
|
11
|
-
getFriendList(this: V12): Map<number, import("oicq").FriendInfo>;
|
|
12
|
-
sendPrivateMsg(this: V12, user_id: number, message: Sendable): Promise<import("oicq").MessageRet>;
|
|
13
|
-
}
|
|
1
|
+
import { V12 } from "../index";
|
|
2
|
+
import { Sendable } from "oicq";
|
|
3
|
+
export declare class FriendAction {
|
|
4
|
+
getUserInfo(this: V12, user_id: number): Promise<{
|
|
5
|
+
user_id: number;
|
|
6
|
+
nickname: string;
|
|
7
|
+
sex: import("oicq").Gender;
|
|
8
|
+
age: number;
|
|
9
|
+
area: string;
|
|
10
|
+
}>;
|
|
11
|
+
getFriendList(this: V12): Map<number, import("oicq").FriendInfo>;
|
|
12
|
+
sendPrivateMsg(this: V12, user_id: number, message: Sendable): Promise<import("oicq").MessageRet>;
|
|
13
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FriendAction = void 0;
|
|
4
|
-
class FriendAction {
|
|
5
|
-
getUserInfo(user_id) {
|
|
6
|
-
return this.client.getStrangerInfo(user_id);
|
|
7
|
-
}
|
|
8
|
-
getFriendList() {
|
|
9
|
-
return this.client.getFriendList();
|
|
10
|
-
}
|
|
11
|
-
sendPrivateMsg(user_id, message) {
|
|
12
|
-
return this.client.sendPrivateMsg(user_id, message);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.FriendAction = FriendAction;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FriendAction = void 0;
|
|
4
|
+
class FriendAction {
|
|
5
|
+
getUserInfo(user_id) {
|
|
6
|
+
return this.client.getStrangerInfo(user_id);
|
|
7
|
+
}
|
|
8
|
+
getFriendList() {
|
|
9
|
+
return this.client.getFriendList();
|
|
10
|
+
}
|
|
11
|
+
sendPrivateMsg(user_id, message) {
|
|
12
|
+
return this.client.sendPrivateMsg(user_id, message);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.FriendAction = FriendAction;
|
|
@@ -1,104 +1,104 @@
|
|
|
1
|
-
import { V12 } from "../index";
|
|
2
|
-
import { Sendable } from "oicq";
|
|
3
|
-
export declare class GroupAction {
|
|
4
|
-
/**
|
|
5
|
-
* 发送群聊消息
|
|
6
|
-
* @param group_id {number} 群id
|
|
7
|
-
* @param message {import('oicq').Sendable} 消息
|
|
8
|
-
*/
|
|
9
|
-
sendGroupMsg(this: V12, group_id: number, message: Sendable): Promise<import("oicq").MessageRet>;
|
|
10
|
-
/**
|
|
11
|
-
* 群组踢人
|
|
12
|
-
* @param group_id {number} 群id
|
|
13
|
-
* @param user_id {number} 成员id
|
|
14
|
-
* @param reject_add_request {boolean} 是否禁止此人加群请求
|
|
15
|
-
*/
|
|
16
|
-
setGroupKick(this: V12, group_id: number, user_id: number, reject_add_request?: boolean): Promise<boolean>;
|
|
17
|
-
/**
|
|
18
|
-
* 群禁言指定人
|
|
19
|
-
* @param group_id {number} 群id
|
|
20
|
-
* @param user_id {number} 成员id
|
|
21
|
-
* @param duration {number} 禁言时长(单位:秒)
|
|
22
|
-
*/
|
|
23
|
-
setGroupBan(this: V12, group_id: number, user_id: number, duration?: number): Promise<void>;
|
|
24
|
-
/**
|
|
25
|
-
* 群禁言匿名者
|
|
26
|
-
* @param group_id {number} 群id
|
|
27
|
-
* @param flag {string} 匿名者flag
|
|
28
|
-
* @param duration {number} 禁言时长(单位:秒)
|
|
29
|
-
*/
|
|
30
|
-
setGroupAnonymousBan(this: V12, group_id: number, flag: string, duration?: number): Promise<void>;
|
|
31
|
-
/**
|
|
32
|
-
* 群全体禁言
|
|
33
|
-
* @param group_id {number} 群id
|
|
34
|
-
* @param enable {boolean} 是否禁言
|
|
35
|
-
*/
|
|
36
|
-
setGroupWholeBan(this: V12, group_id: number, enable?: boolean): Promise<boolean>;
|
|
37
|
-
/**
|
|
38
|
-
* 群匿名聊天
|
|
39
|
-
* @param group_id {number} 群id
|
|
40
|
-
* @param enable {boolean} 是否开启
|
|
41
|
-
*/
|
|
42
|
-
setGroupAnonymous(this: V12, group_id: number, enable?: boolean): Promise<boolean>;
|
|
43
|
-
/**
|
|
44
|
-
* 设置群管
|
|
45
|
-
* @param group_id {number} 群id
|
|
46
|
-
* @param user_id {number} 成员id
|
|
47
|
-
* @param enable {boolean} true 设为管理,false 取消管理
|
|
48
|
-
*/
|
|
49
|
-
setGroupAdmin(this: V12, group_id: number, user_id: number, enable?: boolean): Promise<boolean>;
|
|
50
|
-
/**
|
|
51
|
-
* 设置群成员名片(成员备注)
|
|
52
|
-
* @param group_id {number} 群id
|
|
53
|
-
* @param user_id {number} 成员id
|
|
54
|
-
* @param card {string} 名片信息,不传或传空串则为 删除名片
|
|
55
|
-
*/
|
|
56
|
-
setGroupCard(this: V12, group_id: number, user_id: number, card?: string): Promise<boolean>;
|
|
57
|
-
/**
|
|
58
|
-
* 设置群名
|
|
59
|
-
* @param group_id {number} 群id
|
|
60
|
-
* @param name {string} 新群名
|
|
61
|
-
*/
|
|
62
|
-
setGroupName(this: V12, group_id: number, name: string): Promise<boolean>;
|
|
63
|
-
/**
|
|
64
|
-
* 退出指定群聊
|
|
65
|
-
* @param group_id {number} 群id
|
|
66
|
-
*/
|
|
67
|
-
leaveGroup(this: V12, group_id: number): Promise<boolean>;
|
|
68
|
-
/**
|
|
69
|
-
* 设置群成员头衔
|
|
70
|
-
* @param group_id {number} 群id
|
|
71
|
-
* @param user_id {number} 成员id
|
|
72
|
-
* @param special_title {string} 头衔
|
|
73
|
-
* @param duration {number} 持有时长 不传则永久
|
|
74
|
-
*/
|
|
75
|
-
setGroupSpecialTitle(this: V12, group_id: number, user_id: number, special_title: string, duration?: number): Promise<boolean>;
|
|
76
|
-
/**
|
|
77
|
-
* 处理加群请求
|
|
78
|
-
* @param flag {string} 加群flag
|
|
79
|
-
* @param approve {boolean} 是否同意(默认:true)
|
|
80
|
-
* @param reason {string} 拒绝理由,approve为false时有效(默认为空)
|
|
81
|
-
* @param block {boolean} 拒绝时是否加入黑名单,(默认:false)
|
|
82
|
-
*/
|
|
83
|
-
setGroupAddRequest(this: V12, flag: string, approve?: boolean, reason?: string, block?: boolean): Promise<boolean>;
|
|
84
|
-
/**
|
|
85
|
-
* 获取群列表
|
|
86
|
-
*/
|
|
87
|
-
getGroupList(this: V12): Promise<Map<number, import("oicq").GroupInfo>>;
|
|
88
|
-
/**
|
|
89
|
-
* 获取指定群信息
|
|
90
|
-
* @param group_id
|
|
91
|
-
*/
|
|
92
|
-
getGroupInfo(this: V12, group_id: number): Promise<import("oicq").GroupInfo>;
|
|
93
|
-
/**
|
|
94
|
-
* 获取群成员列表
|
|
95
|
-
* @param group_id
|
|
96
|
-
*/
|
|
97
|
-
getGroupMemberList(this: V12, group_id: number): Promise<Map<number, import("oicq").MemberInfo>>;
|
|
98
|
-
/**
|
|
99
|
-
* 获取指定群成员信息
|
|
100
|
-
* @param group_id
|
|
101
|
-
* @param user_id
|
|
102
|
-
*/
|
|
103
|
-
getGroupMemberInfo(this: V12, group_id: number, user_id: number): Promise<import("oicq").MemberInfo>;
|
|
104
|
-
}
|
|
1
|
+
import { V12 } from "../index";
|
|
2
|
+
import { Sendable } from "oicq";
|
|
3
|
+
export declare class GroupAction {
|
|
4
|
+
/**
|
|
5
|
+
* 发送群聊消息
|
|
6
|
+
* @param group_id {number} 群id
|
|
7
|
+
* @param message {import('oicq').Sendable} 消息
|
|
8
|
+
*/
|
|
9
|
+
sendGroupMsg(this: V12, group_id: number, message: Sendable): Promise<import("oicq").MessageRet>;
|
|
10
|
+
/**
|
|
11
|
+
* 群组踢人
|
|
12
|
+
* @param group_id {number} 群id
|
|
13
|
+
* @param user_id {number} 成员id
|
|
14
|
+
* @param reject_add_request {boolean} 是否禁止此人加群请求
|
|
15
|
+
*/
|
|
16
|
+
setGroupKick(this: V12, group_id: number, user_id: number, reject_add_request?: boolean): Promise<boolean>;
|
|
17
|
+
/**
|
|
18
|
+
* 群禁言指定人
|
|
19
|
+
* @param group_id {number} 群id
|
|
20
|
+
* @param user_id {number} 成员id
|
|
21
|
+
* @param duration {number} 禁言时长(单位:秒)
|
|
22
|
+
*/
|
|
23
|
+
setGroupBan(this: V12, group_id: number, user_id: number, duration?: number): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* 群禁言匿名者
|
|
26
|
+
* @param group_id {number} 群id
|
|
27
|
+
* @param flag {string} 匿名者flag
|
|
28
|
+
* @param duration {number} 禁言时长(单位:秒)
|
|
29
|
+
*/
|
|
30
|
+
setGroupAnonymousBan(this: V12, group_id: number, flag: string, duration?: number): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* 群全体禁言
|
|
33
|
+
* @param group_id {number} 群id
|
|
34
|
+
* @param enable {boolean} 是否禁言
|
|
35
|
+
*/
|
|
36
|
+
setGroupWholeBan(this: V12, group_id: number, enable?: boolean): Promise<boolean>;
|
|
37
|
+
/**
|
|
38
|
+
* 群匿名聊天
|
|
39
|
+
* @param group_id {number} 群id
|
|
40
|
+
* @param enable {boolean} 是否开启
|
|
41
|
+
*/
|
|
42
|
+
setGroupAnonymous(this: V12, group_id: number, enable?: boolean): Promise<boolean>;
|
|
43
|
+
/**
|
|
44
|
+
* 设置群管
|
|
45
|
+
* @param group_id {number} 群id
|
|
46
|
+
* @param user_id {number} 成员id
|
|
47
|
+
* @param enable {boolean} true 设为管理,false 取消管理
|
|
48
|
+
*/
|
|
49
|
+
setGroupAdmin(this: V12, group_id: number, user_id: number, enable?: boolean): Promise<boolean>;
|
|
50
|
+
/**
|
|
51
|
+
* 设置群成员名片(成员备注)
|
|
52
|
+
* @param group_id {number} 群id
|
|
53
|
+
* @param user_id {number} 成员id
|
|
54
|
+
* @param card {string} 名片信息,不传或传空串则为 删除名片
|
|
55
|
+
*/
|
|
56
|
+
setGroupCard(this: V12, group_id: number, user_id: number, card?: string): Promise<boolean>;
|
|
57
|
+
/**
|
|
58
|
+
* 设置群名
|
|
59
|
+
* @param group_id {number} 群id
|
|
60
|
+
* @param name {string} 新群名
|
|
61
|
+
*/
|
|
62
|
+
setGroupName(this: V12, group_id: number, name: string): Promise<boolean>;
|
|
63
|
+
/**
|
|
64
|
+
* 退出指定群聊
|
|
65
|
+
* @param group_id {number} 群id
|
|
66
|
+
*/
|
|
67
|
+
leaveGroup(this: V12, group_id: number): Promise<boolean>;
|
|
68
|
+
/**
|
|
69
|
+
* 设置群成员头衔
|
|
70
|
+
* @param group_id {number} 群id
|
|
71
|
+
* @param user_id {number} 成员id
|
|
72
|
+
* @param special_title {string} 头衔
|
|
73
|
+
* @param duration {number} 持有时长 不传则永久
|
|
74
|
+
*/
|
|
75
|
+
setGroupSpecialTitle(this: V12, group_id: number, user_id: number, special_title: string, duration?: number): Promise<boolean>;
|
|
76
|
+
/**
|
|
77
|
+
* 处理加群请求
|
|
78
|
+
* @param flag {string} 加群flag
|
|
79
|
+
* @param approve {boolean} 是否同意(默认:true)
|
|
80
|
+
* @param reason {string} 拒绝理由,approve为false时有效(默认为空)
|
|
81
|
+
* @param block {boolean} 拒绝时是否加入黑名单,(默认:false)
|
|
82
|
+
*/
|
|
83
|
+
setGroupAddRequest(this: V12, flag: string, approve?: boolean, reason?: string, block?: boolean): Promise<boolean>;
|
|
84
|
+
/**
|
|
85
|
+
* 获取群列表
|
|
86
|
+
*/
|
|
87
|
+
getGroupList(this: V12): Promise<Map<number, import("oicq").GroupInfo>>;
|
|
88
|
+
/**
|
|
89
|
+
* 获取指定群信息
|
|
90
|
+
* @param group_id
|
|
91
|
+
*/
|
|
92
|
+
getGroupInfo(this: V12, group_id: number): Promise<import("oicq").GroupInfo>;
|
|
93
|
+
/**
|
|
94
|
+
* 获取群成员列表
|
|
95
|
+
* @param group_id
|
|
96
|
+
*/
|
|
97
|
+
getGroupMemberList(this: V12, group_id: number): Promise<Map<number, import("oicq").MemberInfo>>;
|
|
98
|
+
/**
|
|
99
|
+
* 获取指定群成员信息
|
|
100
|
+
* @param group_id
|
|
101
|
+
* @param user_id
|
|
102
|
+
*/
|
|
103
|
+
getGroupMemberInfo(this: V12, group_id: number, user_id: number): Promise<import("oicq").MemberInfo>;
|
|
104
|
+
}
|