alemonjs 1.1.6 → 1.1.7
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/lib/core/dealmsg.js +4 -2
- package/lib/discord/alemon/controller.js +2 -1
- package/lib/discord/alemon/conversation.js +74 -4
- package/lib/discord/alemon/message/CHANNEL_TOPIC_UPDATE.js +9 -0
- package/lib/discord/alemon/message/CHANNEL_UPDATE.js +9 -0
- package/lib/discord/alemon/message/GUILD_MEMBER_ADD.js +9 -0
- package/lib/discord/alemon/message/GUILD_MEMBER_REMOVE.js +9 -0
- package/lib/discord/alemon/message/GUILD_MEMBER_UPDATE.js +9 -0
- package/lib/discord/alemon/message/{MESSAGES.js → MESSAGE_CREATE.js} +4 -3
- package/lib/discord/alemon/message/MESSAGE_DELETE.js +8 -0
- package/lib/discord/alemon/message/MESSAGE_REACTION_ADD.js +8 -0
- package/lib/discord/alemon/message/MESSAGE_UPDATE.js +8 -0
- package/lib/discord/alemon/message/PRESENCE_UPDATE.js +9 -0
- package/lib/discord/alemon/message/TYPING_START.js +8 -0
- package/lib/discord/alemon/message/VOICE_CHANNEL_STATUS_UPDATE.js +9 -0
- package/lib/discord/alemon/message/VOICE_STATE_UPDATE.js +8 -0
- package/lib/discord/alemon/reply.js +1 -1
- package/lib/koa/file.js +6 -3
- package/lib/kook/alemon/conversation.js +2 -1
- package/lib/kook/alemon/message/DIRECT_MESSAGE.js +2 -0
- package/lib/kook/alemon/message/GUILD_MESSAGE_REACTIONS.js +2 -0
- package/lib/kook/alemon/message/PUBLIC_GUILD_MESSAGES.js +2 -0
- package/package.json +1 -1
- package/types/discord/alemon/controller.d.ts +2 -2
- package/types/discord/alemon/conversation.d.ts +5 -0
- package/types/discord/alemon/message/CHANNEL_TOPIC_UPDATE.d.ts +11 -0
- package/types/discord/alemon/message/CHANNEL_UPDATE.d.ts +48 -0
- package/types/discord/alemon/message/GUILD_MEMBER_ADD.d.ts +29 -0
- package/types/discord/alemon/message/GUILD_MEMBER_REMOVE.d.ts +18 -0
- package/types/discord/alemon/message/GUILD_MEMBER_UPDATE.d.ts +33 -0
- package/types/discord/alemon/message/{MESSAGES.d.ts → MESSAGE_CREATE.d.ts} +1 -1
- package/types/discord/alemon/message/MESSAGE_DELETE.d.ts +11 -0
- package/types/discord/alemon/message/MESSAGE_REACTION_ADD.d.ts +42 -0
- package/types/discord/alemon/message/MESSAGE_UPDATE.d.ts +56 -0
- package/types/discord/alemon/message/PRESENCE_UPDATE.d.ts +63 -0
- package/types/discord/alemon/message/TYPING_START.d.ts +35 -0
- package/types/discord/alemon/message/VOICE_CHANNEL_STATUS_UPDATE.d.ts +11 -0
- package/types/discord/alemon/message/VOICE_STATE_UPDATE.d.ts +42 -0
- package/types/discord/alemon/reply.d.ts +1 -1
package/lib/core/dealmsg.js
CHANGED
|
@@ -298,8 +298,8 @@ export async function loadInit() {
|
|
|
298
298
|
* @returns 是否处理完成
|
|
299
299
|
*/
|
|
300
300
|
export async function InstructionMatching(e) {
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
if (process.env?.ALEMONJS_EVENT == 'dev')
|
|
302
|
+
console.log(e);
|
|
303
303
|
/**
|
|
304
304
|
* 对话机
|
|
305
305
|
*/
|
|
@@ -410,6 +410,8 @@ export async function InstructionMatching(e) {
|
|
|
410
410
|
* @returns 是否处理完成
|
|
411
411
|
*/
|
|
412
412
|
export async function typeMessage(e) {
|
|
413
|
+
if (process.env?.ALEMONJS_EVENT == 'dev')
|
|
414
|
+
console.log(e);
|
|
413
415
|
if (!CommandNotMessage[e.event])
|
|
414
416
|
return true;
|
|
415
417
|
const APPCACHE = {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { replyController } from './reply.js';
|
|
1
2
|
export const Controller = {
|
|
2
3
|
Member: ({ guild_id, user_id, channel_id }) => {
|
|
3
4
|
return {
|
|
@@ -36,7 +37,7 @@ export const Controller = {
|
|
|
36
37
|
Message: ({ guild_id, channel_id, msg_id, open_id, user_id }) => {
|
|
37
38
|
return {
|
|
38
39
|
reply: async (content) => {
|
|
39
|
-
return
|
|
40
|
+
return await replyController(content, channel_id);
|
|
40
41
|
},
|
|
41
42
|
quote: async (content) => {
|
|
42
43
|
return false;
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
import { ClientDISOCRD } from '../sdk/index.js';
|
|
2
2
|
import { setBotMsgByDISOCRD } from './bot.js';
|
|
3
|
-
import {
|
|
3
|
+
import { MESSAGE_CREATE } from './message/MESSAGE_CREATE.js';
|
|
4
|
+
import { PRESENCE_UPDATE } from './message/PRESENCE_UPDATE.js';
|
|
5
|
+
import { MESSAGE_UPDATE } from './message/MESSAGE_UPDATE.js';
|
|
6
|
+
import { TYPING_START } from './message/TYPING_START.js';
|
|
7
|
+
import { MESSAGE_REACTION_ADD } from './message/MESSAGE_REACTION_ADD.js';
|
|
8
|
+
import { VOICE_STATE_UPDATE } from './message/VOICE_STATE_UPDATE.js';
|
|
9
|
+
import { GUILD_MEMBER_UPDATE } from './message/GUILD_MEMBER_UPDATE.js';
|
|
10
|
+
import { GUILD_MEMBER_ADD } from './message/GUILD_MEMBER_ADD.js';
|
|
11
|
+
import { CHANNEL_TOPIC_UPDATE } from './message/CHANNEL_TOPIC_UPDATE.js';
|
|
12
|
+
import { VOICE_CHANNEL_STATUS_UPDATE } from './message/VOICE_CHANNEL_STATUS_UPDATE.js';
|
|
13
|
+
import { MESSAGE_DELETE } from './message/MESSAGE_DELETE.js';
|
|
14
|
+
import { CHANNEL_UPDATE } from './message/CHANNEL_UPDATE.js';
|
|
15
|
+
import { GUILD_MEMBER_REMOVE } from './message/GUILD_MEMBER_REMOVE.js';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @param t
|
|
19
|
+
* @param d
|
|
20
|
+
*/
|
|
4
21
|
export function conversation(t, d) {
|
|
5
|
-
console.log(t);
|
|
6
22
|
if (t == 'READY') {
|
|
23
|
+
// 上线
|
|
7
24
|
setBotMsgByDISOCRD({
|
|
8
25
|
id: d.user.id,
|
|
9
26
|
name: d.user.username,
|
|
@@ -11,12 +28,65 @@ export function conversation(t, d) {
|
|
|
11
28
|
});
|
|
12
29
|
}
|
|
13
30
|
else if (t == 'GUILD_CREATE') {
|
|
31
|
+
// 频道信息创建
|
|
14
32
|
// console.log(d)
|
|
15
33
|
}
|
|
16
34
|
else if (t == 'MESSAGE_CREATE') {
|
|
17
|
-
|
|
35
|
+
// 消息创建
|
|
36
|
+
MESSAGE_CREATE(d);
|
|
37
|
+
}
|
|
38
|
+
else if (t == 'PRESENCE_UPDATE') {
|
|
39
|
+
// 成员状态更新
|
|
40
|
+
PRESENCE_UPDATE(d);
|
|
41
|
+
}
|
|
42
|
+
else if (t == 'MESSAGE_UPDATE') {
|
|
43
|
+
// 子频道信息更新
|
|
44
|
+
MESSAGE_UPDATE(d);
|
|
45
|
+
}
|
|
46
|
+
else if (t == 'TYPING_START') {
|
|
47
|
+
//
|
|
48
|
+
TYPING_START(d);
|
|
49
|
+
}
|
|
50
|
+
else if (t == 'MESSAGE_REACTION_ADD') {
|
|
51
|
+
//
|
|
52
|
+
MESSAGE_REACTION_ADD(d);
|
|
53
|
+
}
|
|
54
|
+
else if (t == 'VOICE_STATE_UPDATE') {
|
|
55
|
+
//
|
|
56
|
+
VOICE_STATE_UPDATE(d);
|
|
57
|
+
}
|
|
58
|
+
else if (t == 'GUILD_MEMBER_UPDATE') {
|
|
59
|
+
//
|
|
60
|
+
GUILD_MEMBER_UPDATE(d);
|
|
61
|
+
}
|
|
62
|
+
else if (t == 'GUILD_MEMBER_ADD') {
|
|
63
|
+
//
|
|
64
|
+
GUILD_MEMBER_ADD(d);
|
|
65
|
+
}
|
|
66
|
+
else if (t == 'CHANNEL_TOPIC_UPDATE') {
|
|
67
|
+
//
|
|
68
|
+
CHANNEL_TOPIC_UPDATE(d);
|
|
69
|
+
}
|
|
70
|
+
else if (t == 'VOICE_CHANNEL_STATUS_UPDATE') {
|
|
71
|
+
//
|
|
72
|
+
VOICE_CHANNEL_STATUS_UPDATE(d);
|
|
73
|
+
}
|
|
74
|
+
else if (t == 'MESSAGE_DELETE') {
|
|
75
|
+
//
|
|
76
|
+
MESSAGE_DELETE(d);
|
|
77
|
+
}
|
|
78
|
+
else if (t == 'CHANNEL_UPDATE') {
|
|
79
|
+
//
|
|
80
|
+
CHANNEL_UPDATE(d);
|
|
81
|
+
}
|
|
82
|
+
else if (t == 'GUILD_MEMBER_REMOVE') {
|
|
83
|
+
//
|
|
84
|
+
GUILD_MEMBER_REMOVE(d);
|
|
18
85
|
}
|
|
19
86
|
else {
|
|
20
|
-
|
|
87
|
+
if (process.env?.ALEMONJS_EVENT == 'dev') {
|
|
88
|
+
console.log(t);
|
|
89
|
+
console.log('数据', d);
|
|
90
|
+
}
|
|
21
91
|
}
|
|
22
92
|
}
|
|
@@ -10,10 +10,11 @@ import { ClientDISOCRD } from '../../sdk/index.js';
|
|
|
10
10
|
* 基础消息
|
|
11
11
|
* @param event
|
|
12
12
|
*/
|
|
13
|
-
export async function
|
|
13
|
+
export async function MESSAGE_CREATE(event) {
|
|
14
14
|
if (event.author?.bot)
|
|
15
15
|
return;
|
|
16
|
-
|
|
16
|
+
if (process.env?.ALEMONJS_EVENT == 'dev')
|
|
17
|
+
console.log('MESSAGES_TYPE', event);
|
|
17
18
|
const Message = ClientController({
|
|
18
19
|
guild_id: event.guild_id,
|
|
19
20
|
channel_id: event.channel_id,
|
|
@@ -104,7 +105,7 @@ export async function MESSAGES(event) {
|
|
|
104
105
|
return false;
|
|
105
106
|
}
|
|
106
107
|
const channel_id = select?.channel_id ?? event.channel_id;
|
|
107
|
-
return await replyController(msg, channel_id,
|
|
108
|
+
return await replyController(msg, channel_id, {
|
|
108
109
|
quote: select?.quote,
|
|
109
110
|
withdraw
|
|
110
111
|
});
|
|
@@ -8,7 +8,7 @@ import { everyoneError } from '../../log/index.js';
|
|
|
8
8
|
* @param room_id
|
|
9
9
|
* @returns
|
|
10
10
|
*/
|
|
11
|
-
export async function replyController(msg, channel_id,
|
|
11
|
+
export async function replyController(msg, channel_id, select) {
|
|
12
12
|
if (Buffer.isBuffer(msg)) {
|
|
13
13
|
try {
|
|
14
14
|
return await Client.channelsMessagesImage(channel_id, msg);
|
package/lib/koa/file.js
CHANGED
|
@@ -57,9 +57,12 @@ export async function getFileUrl(file, name) {
|
|
|
57
57
|
const md5Hash = createHash('md5').update(file).digest('hex');
|
|
58
58
|
const filename = `${md5Hash}.${extension}`;
|
|
59
59
|
const filePath = join(process.cwd(), fileDir, filename);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
if (!existsSync(filePath)) {
|
|
61
|
+
// 保存文件到文件系统
|
|
62
|
+
// 仅有该文件不存在的时候才写入
|
|
63
|
+
console.info('server create', filePath);
|
|
64
|
+
writeFileSync(filePath, file);
|
|
65
|
+
}
|
|
63
66
|
const url = `${http}://${ip}:${port}${fileRouter}/${filename}`;
|
|
64
67
|
console.info('setLocalFile url', url);
|
|
65
68
|
return url;
|
|
@@ -61,7 +61,8 @@ const ConversationMap = {
|
|
|
61
61
|
[255]: {
|
|
62
62
|
public: async (event) => {
|
|
63
63
|
// overheadData | memberData
|
|
64
|
-
|
|
64
|
+
if (process.env?.ALEMONJS_EVENT == 'dev')
|
|
65
|
+
console.info(event.extra.body);
|
|
65
66
|
if (event.extra.type == 'added_reaction' ||
|
|
66
67
|
event.extra.type == 'deleted_reaction') {
|
|
67
68
|
//StatementData
|
|
@@ -11,6 +11,8 @@ import { ClientDirectController, ClientControllerOnMember, directController } fr
|
|
|
11
11
|
export const DIRECT_MESSAGE = async (event) => {
|
|
12
12
|
if (event.extra?.author?.bot)
|
|
13
13
|
return false;
|
|
14
|
+
if (process.env?.ALEMONJS_EVENT == 'dev')
|
|
15
|
+
console.info(event);
|
|
14
16
|
const open_id = event.extra.code;
|
|
15
17
|
const cfg = getBotConfigByKey('kook');
|
|
16
18
|
const masterID = cfg.masterID;
|
|
@@ -14,6 +14,8 @@ import { directController } from '../direct.js';
|
|
|
14
14
|
*/
|
|
15
15
|
export const GUILD_MESSAGE_REACTIONS = async (event) => {
|
|
16
16
|
const body = event.extra.body;
|
|
17
|
+
if (process.env?.ALEMONJS_EVENT == 'dev')
|
|
18
|
+
console.info(event);
|
|
17
19
|
const cfg = getBotConfigByKey('kook');
|
|
18
20
|
const masterID = cfg.masterID;
|
|
19
21
|
const Message = ClientController({
|
|
@@ -15,6 +15,8 @@ import { directController } from '../direct.js';
|
|
|
15
15
|
export const PUBLIC_GUILD_MESSAGES_KOOK = async (event) => {
|
|
16
16
|
if (event.extra?.author?.bot)
|
|
17
17
|
return false;
|
|
18
|
+
if (process.env?.ALEMONJS_EVENT == 'dev')
|
|
19
|
+
console.info(event);
|
|
18
20
|
let at = false;
|
|
19
21
|
const at_users = [];
|
|
20
22
|
let msg = event.content;
|
package/package.json
CHANGED
|
@@ -39,7 +39,7 @@ export declare const Controller: {
|
|
|
39
39
|
open_id: any;
|
|
40
40
|
user_id: any;
|
|
41
41
|
}) => {
|
|
42
|
-
reply: (content: Buffer | string | number | (Buffer | number | string)[]) => Promise<
|
|
42
|
+
reply: (content: Buffer | string | number | (Buffer | number | string)[]) => Promise<any>;
|
|
43
43
|
quote: (content: Buffer | string | number | (Buffer | number | string)[]) => Promise<boolean>;
|
|
44
44
|
/**
|
|
45
45
|
* 更新信息
|
|
@@ -83,7 +83,7 @@ export declare const ClientController: (data: {
|
|
|
83
83
|
msg_id: string;
|
|
84
84
|
user_id: string;
|
|
85
85
|
}) => (select?: ControllerOption) => {
|
|
86
|
-
reply: (content: Buffer | string | number | (Buffer | number | string)[]) => Promise<
|
|
86
|
+
reply: (content: Buffer | string | number | (Buffer | number | string)[]) => Promise<any>;
|
|
87
87
|
quote: (content: Buffer | string | number | (Buffer | number | string)[]) => Promise<boolean>;
|
|
88
88
|
/**
|
|
89
89
|
* 更新信息
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
interface CHANNEL_UPDATE_TYPE {
|
|
2
|
+
version: number;
|
|
3
|
+
user_limit: number;
|
|
4
|
+
type: number;
|
|
5
|
+
rtc_region: null;
|
|
6
|
+
rate_limit_per_user: number;
|
|
7
|
+
position: number;
|
|
8
|
+
permission_overwrites: [
|
|
9
|
+
{
|
|
10
|
+
type: number;
|
|
11
|
+
id: string;
|
|
12
|
+
deny: string;
|
|
13
|
+
allow: string;
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
type: number;
|
|
17
|
+
id: string;
|
|
18
|
+
deny: string;
|
|
19
|
+
allow: string;
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
type: number;
|
|
23
|
+
id: string;
|
|
24
|
+
deny: string;
|
|
25
|
+
allow: string;
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
type: number;
|
|
29
|
+
id: string;
|
|
30
|
+
deny: string;
|
|
31
|
+
allow: string;
|
|
32
|
+
}
|
|
33
|
+
];
|
|
34
|
+
parent_id: null;
|
|
35
|
+
nsfw: false;
|
|
36
|
+
name: string;
|
|
37
|
+
last_message_id: null;
|
|
38
|
+
id: string;
|
|
39
|
+
guild_id: string;
|
|
40
|
+
flags: number;
|
|
41
|
+
bitrate: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 基础消息
|
|
45
|
+
* @param event
|
|
46
|
+
*/
|
|
47
|
+
export declare function CHANNEL_UPDATE(event: CHANNEL_UPDATE_TYPE): Promise<void>;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
interface GUILD_MEMBER_ADD_TYPE {
|
|
2
|
+
user: {
|
|
3
|
+
username: string;
|
|
4
|
+
public_flags: number;
|
|
5
|
+
id: string;
|
|
6
|
+
global_name: string;
|
|
7
|
+
discriminator: string;
|
|
8
|
+
avatar_decoration_data: null;
|
|
9
|
+
avatar: string;
|
|
10
|
+
};
|
|
11
|
+
unusual_dm_activity_until: null;
|
|
12
|
+
roles: any[];
|
|
13
|
+
premium_since: null;
|
|
14
|
+
pending: boolean;
|
|
15
|
+
nick: null;
|
|
16
|
+
mute: boolean;
|
|
17
|
+
joined_at: string;
|
|
18
|
+
guild_id: string;
|
|
19
|
+
flags: number;
|
|
20
|
+
deaf: boolean;
|
|
21
|
+
communication_disabled_until: null;
|
|
22
|
+
avatar: null;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 基础消息
|
|
26
|
+
* @param event
|
|
27
|
+
*/
|
|
28
|
+
export declare function GUILD_MEMBER_ADD(event: GUILD_MEMBER_ADD_TYPE): Promise<void>;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface GUILD_MEMBER_REMOVE_TYPE {
|
|
2
|
+
user: {
|
|
3
|
+
username: string;
|
|
4
|
+
public_flags: number;
|
|
5
|
+
id: string;
|
|
6
|
+
global_name: string;
|
|
7
|
+
discriminator: string;
|
|
8
|
+
avatar_decoration_data: null;
|
|
9
|
+
avatar: string;
|
|
10
|
+
};
|
|
11
|
+
guild_id: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 基础消息
|
|
15
|
+
* @param event
|
|
16
|
+
*/
|
|
17
|
+
export declare function GUILD_MEMBER_REMOVE(event: GUILD_MEMBER_REMOVE_TYPE): Promise<void>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
interface GUILD_MEMBER_UPDATE_TYPE {
|
|
2
|
+
user: {
|
|
3
|
+
username: string;
|
|
4
|
+
public_flags: number;
|
|
5
|
+
id: string;
|
|
6
|
+
global_name: string;
|
|
7
|
+
display_name: string;
|
|
8
|
+
discriminator: string;
|
|
9
|
+
bot: boolean;
|
|
10
|
+
avatar_decoration_data: {
|
|
11
|
+
sku_id: string;
|
|
12
|
+
asset: string;
|
|
13
|
+
};
|
|
14
|
+
avatar: string;
|
|
15
|
+
};
|
|
16
|
+
roles: string[];
|
|
17
|
+
premium_since: null;
|
|
18
|
+
pending: boolean;
|
|
19
|
+
nick: null;
|
|
20
|
+
mute: boolean;
|
|
21
|
+
joined_at: string;
|
|
22
|
+
guild_id: string;
|
|
23
|
+
flags: number;
|
|
24
|
+
deaf: boolean;
|
|
25
|
+
communication_disabled_until: null;
|
|
26
|
+
avatar: null;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 基础消息
|
|
30
|
+
* @param event
|
|
31
|
+
*/
|
|
32
|
+
export declare function GUILD_MEMBER_UPDATE(event: GUILD_MEMBER_UPDATE_TYPE): Promise<void>;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
interface MESSAGE_REACTION_ADD_TYPE {
|
|
2
|
+
user_id: string;
|
|
3
|
+
type: number;
|
|
4
|
+
message_id: string;
|
|
5
|
+
message_author_id: string;
|
|
6
|
+
member: {
|
|
7
|
+
user: {
|
|
8
|
+
username: string;
|
|
9
|
+
public_flags: number;
|
|
10
|
+
id: string;
|
|
11
|
+
global_name: string;
|
|
12
|
+
display_name: string;
|
|
13
|
+
discriminator: string;
|
|
14
|
+
bot: boolean;
|
|
15
|
+
avatar_decoration_data: null;
|
|
16
|
+
avatar: string;
|
|
17
|
+
};
|
|
18
|
+
roles: string[];
|
|
19
|
+
premium_since: null;
|
|
20
|
+
pending: boolean;
|
|
21
|
+
nick: null;
|
|
22
|
+
mute: boolean;
|
|
23
|
+
joined_at: string;
|
|
24
|
+
flags: number;
|
|
25
|
+
deaf: boolean;
|
|
26
|
+
communication_disabled_until: null;
|
|
27
|
+
avatar: null;
|
|
28
|
+
};
|
|
29
|
+
emoji: {
|
|
30
|
+
name: string;
|
|
31
|
+
id: string;
|
|
32
|
+
};
|
|
33
|
+
channel_id: string;
|
|
34
|
+
burst: boolean;
|
|
35
|
+
guild_id: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 基础消息
|
|
39
|
+
* @param event
|
|
40
|
+
*/
|
|
41
|
+
export declare function MESSAGE_REACTION_ADD(event: MESSAGE_REACTION_ADD_TYPE): Promise<void>;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
interface MESSAGE_UPDATE_TYPE {
|
|
2
|
+
type: number;
|
|
3
|
+
tts: boolean;
|
|
4
|
+
timestamp: string;
|
|
5
|
+
pinned: boolean;
|
|
6
|
+
mentions: any[];
|
|
7
|
+
mention_roles: string[];
|
|
8
|
+
mention_everyone: boolean;
|
|
9
|
+
member: {
|
|
10
|
+
roles: string[];
|
|
11
|
+
premium_since: null;
|
|
12
|
+
pending: boolean;
|
|
13
|
+
nick: null;
|
|
14
|
+
mute: boolean;
|
|
15
|
+
joined_at: string;
|
|
16
|
+
flags: number;
|
|
17
|
+
deaf: boolean;
|
|
18
|
+
communication_disabled_until: null;
|
|
19
|
+
avatar: null;
|
|
20
|
+
};
|
|
21
|
+
id: string;
|
|
22
|
+
flags: number;
|
|
23
|
+
embeds: {
|
|
24
|
+
type: string;
|
|
25
|
+
title: string;
|
|
26
|
+
image: any;
|
|
27
|
+
description: '';
|
|
28
|
+
color: number;
|
|
29
|
+
}[];
|
|
30
|
+
edited_timestamp: string;
|
|
31
|
+
content: string;
|
|
32
|
+
components: {
|
|
33
|
+
type: number;
|
|
34
|
+
components: any;
|
|
35
|
+
}[];
|
|
36
|
+
channel_id: string;
|
|
37
|
+
author: {
|
|
38
|
+
username: string;
|
|
39
|
+
public_flags: number;
|
|
40
|
+
premium_type: number;
|
|
41
|
+
id: string;
|
|
42
|
+
global_name: null;
|
|
43
|
+
discriminator: string;
|
|
44
|
+
bot: true;
|
|
45
|
+
avatar_decoration_data: null;
|
|
46
|
+
avatar: string;
|
|
47
|
+
};
|
|
48
|
+
attachments: any[];
|
|
49
|
+
guild_id: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 基础消息
|
|
53
|
+
* @param event
|
|
54
|
+
*/
|
|
55
|
+
export declare function MESSAGE_UPDATE(event: MESSAGE_UPDATE_TYPE): Promise<void>;
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
interface MESSAGE_CREATE_TYPE {
|
|
2
|
+
user: {
|
|
3
|
+
id: number;
|
|
4
|
+
} | {
|
|
5
|
+
username: string;
|
|
6
|
+
public_flags: number;
|
|
7
|
+
id: string;
|
|
8
|
+
global_name: string;
|
|
9
|
+
discriminator: string;
|
|
10
|
+
avatar_decoration_data: {
|
|
11
|
+
sku_id: string;
|
|
12
|
+
asset: string;
|
|
13
|
+
};
|
|
14
|
+
avatar: string;
|
|
15
|
+
};
|
|
16
|
+
status: string;
|
|
17
|
+
guild_id: string;
|
|
18
|
+
client_status: {
|
|
19
|
+
desktop: string;
|
|
20
|
+
};
|
|
21
|
+
broadcast: null;
|
|
22
|
+
activities: {
|
|
23
|
+
type: number;
|
|
24
|
+
timestamps: any;
|
|
25
|
+
state: string;
|
|
26
|
+
name: string;
|
|
27
|
+
id: string;
|
|
28
|
+
details: string;
|
|
29
|
+
created_at: number;
|
|
30
|
+
assets: any;
|
|
31
|
+
application_id: string;
|
|
32
|
+
}[] | {
|
|
33
|
+
type: number;
|
|
34
|
+
state: string;
|
|
35
|
+
name: string;
|
|
36
|
+
id: string;
|
|
37
|
+
emoji: any;
|
|
38
|
+
created_at: number;
|
|
39
|
+
}[] | {
|
|
40
|
+
type: number;
|
|
41
|
+
name: string;
|
|
42
|
+
id: string;
|
|
43
|
+
created_at: number;
|
|
44
|
+
}[] | {
|
|
45
|
+
type: number;
|
|
46
|
+
timestamps: any;
|
|
47
|
+
state: string;
|
|
48
|
+
session_id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
id: string;
|
|
51
|
+
details: string;
|
|
52
|
+
created_at: number;
|
|
53
|
+
buttons: any[];
|
|
54
|
+
assets: any;
|
|
55
|
+
application_id: string;
|
|
56
|
+
}[];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 基础消息
|
|
60
|
+
* @param event
|
|
61
|
+
*/
|
|
62
|
+
export declare function PRESENCE_UPDATE(event: MESSAGE_CREATE_TYPE): Promise<void>;
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
interface TYPING_START_TYPE {
|
|
2
|
+
user_id: string;
|
|
3
|
+
timestamp: number;
|
|
4
|
+
member: {
|
|
5
|
+
user: {
|
|
6
|
+
username: string;
|
|
7
|
+
public_flags: number;
|
|
8
|
+
id: string;
|
|
9
|
+
global_name: string;
|
|
10
|
+
display_name: string;
|
|
11
|
+
discriminator: string;
|
|
12
|
+
bot: boolean;
|
|
13
|
+
avatar_decoration_data: null;
|
|
14
|
+
avatar: string;
|
|
15
|
+
};
|
|
16
|
+
roles: string[];
|
|
17
|
+
premium_since: string;
|
|
18
|
+
pending: boolean;
|
|
19
|
+
nick: string;
|
|
20
|
+
mute: boolean;
|
|
21
|
+
joined_at: string;
|
|
22
|
+
flags: number;
|
|
23
|
+
deaf: boolean;
|
|
24
|
+
communication_disabled_until: null;
|
|
25
|
+
avatar: null;
|
|
26
|
+
};
|
|
27
|
+
channel_id: string;
|
|
28
|
+
guild_id: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 基础消息
|
|
32
|
+
* @param event
|
|
33
|
+
*/
|
|
34
|
+
export declare function TYPING_START(event: TYPING_START_TYPE): Promise<void>;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface VOICE_CHANNEL_STATUS_UPDATE_TYPE {
|
|
2
|
+
status: null;
|
|
3
|
+
id: string;
|
|
4
|
+
guild_id: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 基础消息
|
|
8
|
+
* @param event
|
|
9
|
+
*/
|
|
10
|
+
export declare function VOICE_CHANNEL_STATUS_UPDATE(event: VOICE_CHANNEL_STATUS_UPDATE_TYPE): Promise<void>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
interface VOICE_STATE_UPDATE_TYPE {
|
|
2
|
+
member: {
|
|
3
|
+
user: {
|
|
4
|
+
username: string;
|
|
5
|
+
public_flags: number;
|
|
6
|
+
id: string;
|
|
7
|
+
global_name: string;
|
|
8
|
+
display_name: string;
|
|
9
|
+
discriminator: string;
|
|
10
|
+
bot: boolean;
|
|
11
|
+
avatar_decoration_data: any;
|
|
12
|
+
avatar: string;
|
|
13
|
+
};
|
|
14
|
+
roles: string[];
|
|
15
|
+
premium_since: null;
|
|
16
|
+
pending: boolean;
|
|
17
|
+
nick: null;
|
|
18
|
+
mute: boolean;
|
|
19
|
+
joined_at: string;
|
|
20
|
+
flags: number;
|
|
21
|
+
deaf: boolean;
|
|
22
|
+
communication_disabled_until: null;
|
|
23
|
+
avatar: string;
|
|
24
|
+
};
|
|
25
|
+
user_id: string;
|
|
26
|
+
suppress: boolean;
|
|
27
|
+
session_id: string;
|
|
28
|
+
self_video: boolean;
|
|
29
|
+
self_mute: true;
|
|
30
|
+
self_deaf: boolean;
|
|
31
|
+
request_to_speak_timestamp: null;
|
|
32
|
+
mute: boolean;
|
|
33
|
+
guild_id: string;
|
|
34
|
+
deaf: boolean;
|
|
35
|
+
channel_id: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 基础消息
|
|
39
|
+
* @param event
|
|
40
|
+
*/
|
|
41
|
+
export declare function VOICE_STATE_UPDATE(event: VOICE_STATE_UPDATE_TYPE): Promise<void>;
|
|
42
|
+
export {};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @param room_id
|
|
7
7
|
* @returns
|
|
8
8
|
*/
|
|
9
|
-
export declare function replyController(msg: Buffer | string | number | (Buffer | number | string)[], channel_id: string,
|
|
9
|
+
export declare function replyController(msg: Buffer | string | number | (Buffer | number | string)[], channel_id: string, select?: {
|
|
10
10
|
quote?: string;
|
|
11
11
|
withdraw?: number;
|
|
12
12
|
}): Promise<any>;
|