@alemonjs/discord 0.2.10 → 2.1.0-alpha.0
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/dist/assets/index.css +1 -1248
- package/dist/assets/index.js +4 -10990
- package/dist/index.html +1 -1
- package/lib/index.d.ts +2 -8
- package/lib/index.js +113 -94
- package/lib/sdk/api.d.ts +965 -941
- package/lib/sdk/api.js +7 -3
- package/lib/sdk/message/CHANNEL_TOPIC_UPDATE.d.ts +5 -5
- package/lib/sdk/message/CHANNEL_UPDATE.d.ts +42 -42
- package/lib/sdk/message/GUILD_MEMBER_ADD.d.ts +23 -23
- package/lib/sdk/message/GUILD_MEMBER_REMOVE.d.ts +12 -12
- package/lib/sdk/message/GUILD_MEMBER_UPDATE.d.ts +27 -27
- package/lib/sdk/message/INTERACTION_CREATE.d.ts +113 -113
- package/lib/sdk/message/MESSAGE_CREATE.d.ts +53 -53
- package/lib/sdk/message/MESSAGE_DELETE.d.ts +5 -5
- package/lib/sdk/message/MESSAGE_REACTION_ADD.d.ts +36 -36
- package/lib/sdk/message/MESSAGE_UPDATE.d.ts +50 -50
- package/lib/sdk/message/PRESENCE_UPDATE.d.ts +62 -56
- package/lib/sdk/message/READY.d.ts +7 -7
- package/lib/sdk/message/TYPING_START.d.ts +29 -29
- package/lib/sdk/message/VOICE_CHANNEL_STATUS_UPDATE.d.ts +5 -5
- package/lib/sdk/message/VOICE_STATE_UPDATE.d.ts +36 -36
- package/lib/sdk/message.d.ts +95 -95
- package/lib/sdk/types.d.ts +4 -4
- package/lib/sdk/wss.d.ts +23 -23
- package/lib/sdk/wss.types.d.ts +21 -21
- package/lib/send.js +24 -96
- package/package.json +1 -1
package/lib/sdk/api.js
CHANGED
|
@@ -86,14 +86,18 @@ class DCAPI {
|
|
|
86
86
|
* @param img
|
|
87
87
|
* @returns
|
|
88
88
|
*/
|
|
89
|
-
async channelsMessagesImage(channel_id, img,
|
|
89
|
+
async channelsMessagesImage(channel_id, img, param) {
|
|
90
90
|
const from = await createPicFrom(img);
|
|
91
91
|
if (!from)
|
|
92
92
|
return;
|
|
93
93
|
const { picData, name } = from;
|
|
94
94
|
const formData = new FormData();
|
|
95
|
-
if (
|
|
96
|
-
|
|
95
|
+
if (param) {
|
|
96
|
+
for (const key in param) {
|
|
97
|
+
if (param[key]) {
|
|
98
|
+
formData.append(key, param[key]);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
97
101
|
}
|
|
98
102
|
formData.append('file', picData, name);
|
|
99
103
|
return this.request({
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* @param event
|
|
4
4
|
*/
|
|
5
5
|
type CHANNEL_TOPIC_UPDATE_TYPE = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
6
|
+
topic: null
|
|
7
|
+
id: string
|
|
8
|
+
guild_id: string
|
|
9
|
+
}
|
|
10
10
|
|
|
11
|
-
export type { CHANNEL_TOPIC_UPDATE_TYPE }
|
|
11
|
+
export type { CHANNEL_TOPIC_UPDATE_TYPE }
|
|
@@ -3,46 +3,46 @@
|
|
|
3
3
|
* @param event
|
|
4
4
|
*/
|
|
5
5
|
type CHANNEL_UPDATE_TYPE = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
6
|
+
version: number
|
|
7
|
+
user_limit: number
|
|
8
|
+
type: number
|
|
9
|
+
rtc_region: null
|
|
10
|
+
rate_limit_per_user: number
|
|
11
|
+
position: number
|
|
12
|
+
permission_overwrites: [
|
|
13
|
+
{
|
|
14
|
+
type: number
|
|
15
|
+
id: string
|
|
16
|
+
deny: string
|
|
17
|
+
allow: string
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
type: number
|
|
21
|
+
id: string
|
|
22
|
+
deny: string
|
|
23
|
+
allow: string
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
type: number
|
|
27
|
+
id: string
|
|
28
|
+
deny: string
|
|
29
|
+
allow: string
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
type: number
|
|
33
|
+
id: string
|
|
34
|
+
deny: string
|
|
35
|
+
allow: string
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
parent_id: null
|
|
39
|
+
nsfw: false
|
|
40
|
+
name: string
|
|
41
|
+
last_message_id: null
|
|
42
|
+
id: string
|
|
43
|
+
guild_id: string
|
|
44
|
+
flags: number
|
|
45
|
+
bitrate: number
|
|
46
|
+
}
|
|
47
47
|
|
|
48
|
-
export type { CHANNEL_UPDATE_TYPE }
|
|
48
|
+
export type { CHANNEL_UPDATE_TYPE }
|
|
@@ -2,27 +2,27 @@
|
|
|
2
2
|
* 频道 成员 增加
|
|
3
3
|
*/
|
|
4
4
|
type GUILD_MEMBER_ADD_TYPE = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
5
|
+
user: {
|
|
6
|
+
username: string
|
|
7
|
+
public_flags: number
|
|
8
|
+
id: string
|
|
9
|
+
global_name: string
|
|
10
|
+
discriminator: string
|
|
11
|
+
avatar_decoration_data: null
|
|
12
|
+
avatar: string
|
|
13
|
+
}
|
|
14
|
+
unusual_dm_activity_until: null
|
|
15
|
+
roles: any[]
|
|
16
|
+
premium_since: null
|
|
17
|
+
pending: boolean
|
|
18
|
+
nick: null
|
|
19
|
+
mute: boolean
|
|
20
|
+
joined_at: string
|
|
21
|
+
guild_id: string
|
|
22
|
+
flags: number
|
|
23
|
+
deaf: boolean
|
|
24
|
+
communication_disabled_until: null
|
|
25
|
+
avatar: null
|
|
26
|
+
}
|
|
27
27
|
|
|
28
|
-
export type { GUILD_MEMBER_ADD_TYPE }
|
|
28
|
+
export type { GUILD_MEMBER_ADD_TYPE }
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
* @param event
|
|
4
4
|
*/
|
|
5
5
|
type GUILD_MEMBER_REMOVE_TYPE = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
6
|
+
user: {
|
|
7
|
+
username: string
|
|
8
|
+
public_flags: number
|
|
9
|
+
id: string
|
|
10
|
+
global_name: string
|
|
11
|
+
discriminator: string
|
|
12
|
+
avatar_decoration_data: null
|
|
13
|
+
avatar: string
|
|
14
|
+
}
|
|
15
|
+
guild_id: string
|
|
16
|
+
}
|
|
17
17
|
|
|
18
|
-
export type { GUILD_MEMBER_REMOVE_TYPE }
|
|
18
|
+
export type { GUILD_MEMBER_REMOVE_TYPE }
|
|
@@ -3,31 +3,31 @@
|
|
|
3
3
|
* @param event
|
|
4
4
|
*/
|
|
5
5
|
type GUILD_MEMBER_UPDATE_TYPE = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
6
|
+
user: {
|
|
7
|
+
username: string
|
|
8
|
+
public_flags: number
|
|
9
|
+
id: string
|
|
10
|
+
global_name: string
|
|
11
|
+
display_name: string
|
|
12
|
+
discriminator: string
|
|
13
|
+
bot: boolean
|
|
14
|
+
avatar_decoration_data: {
|
|
15
|
+
sku_id: string
|
|
16
|
+
asset: string
|
|
17
|
+
}
|
|
18
|
+
avatar: string
|
|
19
|
+
}
|
|
20
|
+
roles: string[]
|
|
21
|
+
premium_since: null
|
|
22
|
+
pending: boolean
|
|
23
|
+
nick: null
|
|
24
|
+
mute: boolean
|
|
25
|
+
joined_at: string
|
|
26
|
+
guild_id: string
|
|
27
|
+
flags: number
|
|
28
|
+
deaf: boolean
|
|
29
|
+
communication_disabled_until: null
|
|
30
|
+
avatar: null
|
|
31
|
+
}
|
|
32
32
|
|
|
33
|
-
export type { GUILD_MEMBER_UPDATE_TYPE }
|
|
33
|
+
export type { GUILD_MEMBER_UPDATE_TYPE }
|
|
@@ -1,126 +1,126 @@
|
|
|
1
1
|
interface User {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
username: string
|
|
3
|
+
public_flags: number
|
|
4
|
+
primary_guild: null
|
|
5
|
+
id: string
|
|
6
|
+
global_name: string | null
|
|
7
|
+
discriminator: string
|
|
8
|
+
collectibles: null
|
|
9
|
+
clan: null
|
|
10
|
+
avatar_decoration_data: null
|
|
11
|
+
avatar: string
|
|
12
12
|
}
|
|
13
13
|
type Message = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
14
|
+
type: number
|
|
15
|
+
tts: boolean
|
|
16
|
+
timestamp: string
|
|
17
|
+
pinned: boolean
|
|
18
|
+
mentions: unknown[]
|
|
19
|
+
mention_roles: unknown[]
|
|
20
|
+
mention_everyone: boolean
|
|
21
|
+
id: string
|
|
22
|
+
flags: number
|
|
23
|
+
embeds: unknown[]
|
|
24
|
+
edited_timestamp: string | null
|
|
25
|
+
content: string
|
|
26
|
+
components: unknown[]
|
|
27
|
+
channel_id: string
|
|
28
|
+
author: User
|
|
29
|
+
attachments: unknown[]
|
|
30
|
+
}
|
|
31
31
|
type Member = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
32
|
+
user: User
|
|
33
|
+
unusual_dm_activity_until: string | null
|
|
34
|
+
roles: string[]
|
|
35
|
+
premium_since: string | null
|
|
36
|
+
permissions: string
|
|
37
|
+
pending: boolean
|
|
38
|
+
nick: string | null
|
|
39
|
+
mute: boolean
|
|
40
|
+
joined_at: string
|
|
41
|
+
flags: number
|
|
42
|
+
deaf: boolean
|
|
43
|
+
communication_disabled_until: string | null
|
|
44
|
+
banner: string | null
|
|
45
|
+
avatar: string | null
|
|
46
|
+
}
|
|
47
47
|
type DiscordGuild = {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
48
|
+
locale: string
|
|
49
|
+
id: string
|
|
50
|
+
features: string[]
|
|
51
|
+
}
|
|
52
52
|
type PublicChannel = {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
53
|
+
type: number
|
|
54
|
+
topic: string | null
|
|
55
|
+
theme_color: number | null
|
|
56
|
+
rate_limit_per_user: number
|
|
57
|
+
position: number
|
|
58
|
+
permissions: string
|
|
59
|
+
parent_id: string
|
|
60
|
+
nsfw: boolean
|
|
61
|
+
name: string
|
|
62
|
+
last_message_id: string
|
|
63
|
+
id: string
|
|
64
|
+
icon_emoji: {
|
|
65
|
+
name: string
|
|
66
|
+
id: string | null
|
|
67
|
+
}
|
|
68
|
+
guild_id: string
|
|
69
|
+
flags: number
|
|
70
|
+
}
|
|
71
71
|
interface Channel {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
type: number
|
|
73
|
+
recipients: any[]
|
|
74
|
+
recipient_flags: number
|
|
75
|
+
last_message_id: string
|
|
76
|
+
id: string
|
|
77
|
+
flags: number
|
|
78
78
|
}
|
|
79
79
|
interface Data {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
id: number
|
|
81
|
+
custom_id: string
|
|
82
|
+
component_type: number
|
|
83
83
|
}
|
|
84
84
|
type Public = {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
85
|
+
version: number
|
|
86
|
+
type: number
|
|
87
|
+
token: string
|
|
88
|
+
member: Member
|
|
89
|
+
message: Message
|
|
90
|
+
locale: string
|
|
91
|
+
id: string
|
|
92
|
+
guild_locale: string
|
|
93
|
+
guild_id: string
|
|
94
|
+
guild: DiscordGuild
|
|
95
|
+
entitlement_sku_ids: any[]
|
|
96
|
+
entitlements: any[]
|
|
97
|
+
data: Data
|
|
98
|
+
context: number
|
|
99
|
+
channel_id: string
|
|
100
|
+
channel: PublicChannel
|
|
101
|
+
authorizing_integration_owners: Record<string, string>
|
|
102
|
+
attachment_size_limit: number
|
|
103
|
+
application_id: string
|
|
104
|
+
app_permissions: string
|
|
105
|
+
}
|
|
106
106
|
type Private = {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
type INTERACTION_CREATE_TYPE = Public | Private
|
|
107
|
+
version: number
|
|
108
|
+
type: number
|
|
109
|
+
token: string
|
|
110
|
+
user: User
|
|
111
|
+
message: Message
|
|
112
|
+
locale: string
|
|
113
|
+
id: string
|
|
114
|
+
entitlements: any[]
|
|
115
|
+
data: Data
|
|
116
|
+
context: number
|
|
117
|
+
channel_id: string
|
|
118
|
+
channel: Channel
|
|
119
|
+
authorizing_integration_owners: Record<string, string>
|
|
120
|
+
attachment_size_limit: number
|
|
121
|
+
application_id: string
|
|
122
|
+
app_permissions: string
|
|
123
|
+
}
|
|
124
|
+
type INTERACTION_CREATE_TYPE = Public | Private
|
|
125
125
|
|
|
126
|
-
export type { INTERACTION_CREATE_TYPE }
|
|
126
|
+
export type { INTERACTION_CREATE_TYPE }
|
|
@@ -3,57 +3,57 @@
|
|
|
3
3
|
* @param event
|
|
4
4
|
*/
|
|
5
5
|
type MESSAGE_CREATE_TYPE = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
}
|
|
6
|
+
type: number
|
|
7
|
+
tts: boolean
|
|
8
|
+
timestamp: string
|
|
9
|
+
referenced_message: null
|
|
10
|
+
pinned: boolean
|
|
11
|
+
nonce: string
|
|
12
|
+
mentions: {
|
|
13
|
+
username: string
|
|
14
|
+
public_flags: number
|
|
15
|
+
member: any
|
|
16
|
+
id: string
|
|
17
|
+
global_name: null
|
|
18
|
+
discriminator: string
|
|
19
|
+
bot: boolean
|
|
20
|
+
avatar_decoration_data: null
|
|
21
|
+
avatar: string
|
|
22
|
+
}[]
|
|
23
|
+
mention_roles: any[]
|
|
24
|
+
mention_everyone: boolean
|
|
25
|
+
member: {
|
|
26
|
+
roles: any[]
|
|
27
|
+
premium_since: null
|
|
28
|
+
pending: boolean
|
|
29
|
+
nick: null
|
|
30
|
+
mute: boolean
|
|
31
|
+
joined_at: string
|
|
32
|
+
flags: number
|
|
33
|
+
deaf: boolean
|
|
34
|
+
communication_disabled_until: null
|
|
35
|
+
avatar: null
|
|
36
|
+
}
|
|
37
|
+
id: string
|
|
38
|
+
flags: number
|
|
39
|
+
embeds: any[]
|
|
40
|
+
edited_timestamp: null
|
|
41
|
+
content: string
|
|
42
|
+
components: any[]
|
|
43
|
+
channel_id: string
|
|
44
|
+
author: {
|
|
45
|
+
username: string
|
|
46
|
+
public_flags: number
|
|
47
|
+
premium_type: number
|
|
48
|
+
id: string
|
|
49
|
+
global_name: string
|
|
50
|
+
discriminator: string
|
|
51
|
+
avatar_decoration_data: null
|
|
52
|
+
avatar: string
|
|
53
|
+
bot?: boolean
|
|
54
|
+
}
|
|
55
|
+
attachments: any[]
|
|
56
|
+
guild_id: string
|
|
57
|
+
}
|
|
58
58
|
|
|
59
|
-
export type { MESSAGE_CREATE_TYPE }
|
|
59
|
+
export type { MESSAGE_CREATE_TYPE }
|