@alemonjs/discord 0.2.8 → 0.2.10
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 +865 -83
- package/dist/assets/index.js +8724 -8623
- package/lib/env.js +1 -0
- package/lib/index.d.ts +4 -3
- package/lib/index.js +120 -221
- package/lib/sdk/{platform/discord/sdk/api.d.ts → api.d.ts} +54 -2
- package/lib/sdk/{platform/discord/sdk/api.js → api.js} +20 -7
- package/lib/sdk/config.js +10 -0
- package/lib/sdk/intents.js +154 -0
- package/lib/sdk/message/INTERACTION_CREATE.d.ts +126 -0
- package/lib/sdk/message.d.ts +101 -0
- package/lib/sdk/types.d.ts +5 -0
- package/lib/sdk/types.js +25 -0
- package/lib/sdk/{platform/discord/sdk/wss.d.ts → wss.d.ts} +1 -1
- package/lib/sdk/{platform/discord/sdk/wss.js → wss.js} +14 -7
- package/lib/sdk/{platform/discord/sdk/wss.types.d.ts → wss.types.d.ts} +4 -0
- package/lib/send.js +204 -0
- package/package.json +4 -1
- package/lib/sdk/platform/discord/sdk/config.js +0 -29
- package/lib/sdk/platform/discord/sdk/intents.js +0 -36
- package/lib/sdk/platform/discord/sdk/message.d.ts +0 -37
- package/lib/sdk/platform/discord/sdk/types.d.ts +0 -4
- /package/lib/sdk/core/{utils/from.js → from.js} +0 -0
- /package/lib/sdk/{platform/discord/sdk/message → message}/CHANNEL_TOPIC_UPDATE.d.ts +0 -0
- /package/lib/sdk/{platform/discord/sdk/message → message}/CHANNEL_UPDATE.d.ts +0 -0
- /package/lib/sdk/{platform/discord/sdk/message → message}/GUILD_MEMBER_ADD.d.ts +0 -0
- /package/lib/sdk/{platform/discord/sdk/message → message}/GUILD_MEMBER_REMOVE.d.ts +0 -0
- /package/lib/sdk/{platform/discord/sdk/message → message}/GUILD_MEMBER_UPDATE.d.ts +0 -0
- /package/lib/sdk/{platform/discord/sdk/message → message}/MESSAGE_CREATE.d.ts +0 -0
- /package/lib/sdk/{platform/discord/sdk/message → message}/MESSAGE_DELETE.d.ts +0 -0
- /package/lib/sdk/{platform/discord/sdk/message → message}/MESSAGE_REACTION_ADD.d.ts +0 -0
- /package/lib/sdk/{platform/discord/sdk/message → message}/MESSAGE_UPDATE.d.ts +0 -0
- /package/lib/sdk/{platform/discord/sdk/message → message}/PRESENCE_UPDATE.d.ts +0 -0
- /package/lib/sdk/{platform/discord/sdk/message → message}/READY.d.ts +0 -0
- /package/lib/sdk/{platform/discord/sdk/message → message}/TYPING_START.d.ts +0 -0
- /package/lib/sdk/{platform/discord/sdk/message → message}/VOICE_CHANNEL_STATUS_UPDATE.d.ts +0 -0
- /package/lib/sdk/{platform/discord/sdk/message → message}/VOICE_STATE_UPDATE.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alemonjs/discord",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"description": "阿柠檬discord平台连接",
|
|
5
5
|
"author": "lemonade",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
"./package": "./package.json",
|
|
19
19
|
"./desktop": "./lib/desktop.js"
|
|
20
20
|
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/qrcode": "^1.5.5"
|
|
23
|
+
},
|
|
21
24
|
"alemonjs": {
|
|
22
25
|
"desktop": {
|
|
23
26
|
"platform": [
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { BaseConfig } from '../../../core/config.js';
|
|
2
|
-
|
|
3
|
-
const config = new BaseConfig({
|
|
4
|
-
token: '',
|
|
5
|
-
intent: [
|
|
6
|
-
'MESSAGE_CONTENT', // 内容是基础
|
|
7
|
-
//
|
|
8
|
-
'DIRECT_MESSAGES',
|
|
9
|
-
'DIRECT_MESSAGE_TYPING',
|
|
10
|
-
'DIRECT_MESSAGE_REACTIONS',
|
|
11
|
-
//
|
|
12
|
-
'GUILDS',
|
|
13
|
-
'GUILD_MESSAGE_TYPING',
|
|
14
|
-
'REACTIONS',
|
|
15
|
-
'GUILD_MESSAGES',
|
|
16
|
-
'MEMBERS',
|
|
17
|
-
//
|
|
18
|
-
'GUILD_MODERATION',
|
|
19
|
-
'GUILD_EMOJIS_AND_STICKERS',
|
|
20
|
-
'GUILD_INTEGRATIONS',
|
|
21
|
-
'GUILD_WEBHOOKS',
|
|
22
|
-
'GUILD_INVITES',
|
|
23
|
-
'GUILD_VOICE_STATES',
|
|
24
|
-
'GUILD_PRESENCES'
|
|
25
|
-
],
|
|
26
|
-
shard: [0, 1]
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
export { config };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
const DCIntentsMap = {
|
|
2
|
-
GUILDS: 1,
|
|
3
|
-
MEMBERS: 2,
|
|
4
|
-
GUILD_MODERATION: 4,
|
|
5
|
-
GUILD_EMOJIS_AND_STICKERS: 8,
|
|
6
|
-
GUILD_INTEGRATIONS: 16,
|
|
7
|
-
GUILD_WEBHOOKS: 32,
|
|
8
|
-
GUILD_INVITES: 64,
|
|
9
|
-
GUILD_VOICE_STATES: 128,
|
|
10
|
-
GUILD_PRESENCES: 256,
|
|
11
|
-
GUILD_MESSAGES: 512,
|
|
12
|
-
REACTIONS: 1024,
|
|
13
|
-
GUILD_MESSAGE_TYPING: 2048,
|
|
14
|
-
DIRECT_MESSAGES: 4096,
|
|
15
|
-
DIRECT_MESSAGE_REACTIONS: 8192,
|
|
16
|
-
DIRECT_MESSAGE_TYPING: 16384,
|
|
17
|
-
MESSAGE_CONTENT: 32768,
|
|
18
|
-
GUILD_SCHEDULED_EVENTS: 65536,
|
|
19
|
-
AUTO_MODERATION_CONFIGURATION: 1048576,
|
|
20
|
-
AUTO_MODERATION_EXECUTION: 2097152
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
* @param intents
|
|
25
|
-
* @returns
|
|
26
|
-
*/
|
|
27
|
-
function getIntents(intents) {
|
|
28
|
-
let result = 0;
|
|
29
|
-
for (const intent of intents) {
|
|
30
|
-
const i = DCIntentsMap[intent];
|
|
31
|
-
result |= i;
|
|
32
|
-
}
|
|
33
|
-
return result;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export { getIntents };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { CHANNEL_TOPIC_UPDATE_TYPE } from './message/CHANNEL_TOPIC_UPDATE.js';
|
|
2
|
-
import { CHANNEL_UPDATE_TYPE } from './message/CHANNEL_UPDATE.js';
|
|
3
|
-
import { GUILD_MEMBER_ADD_TYPE } from './message/GUILD_MEMBER_ADD.js';
|
|
4
|
-
import { GUILD_MEMBER_REMOVE_TYPE } from './message/GUILD_MEMBER_REMOVE.js';
|
|
5
|
-
import { GUILD_MEMBER_UPDATE_TYPE } from './message/GUILD_MEMBER_UPDATE.js';
|
|
6
|
-
import { MESSAGE_CREATE_TYPE } from './message/MESSAGE_CREATE.js';
|
|
7
|
-
import { MESSAGE_DELETE_TYPE } from './message/MESSAGE_DELETE.js';
|
|
8
|
-
import { MESSAGE_REACTION_ADD_TYPE } from './message/MESSAGE_REACTION_ADD.js';
|
|
9
|
-
import { MESSAGE_UPDATE_TYPE } from './message/MESSAGE_UPDATE.js';
|
|
10
|
-
import { PRESENCE_UPDATE_TYPE } from './message/PRESENCE_UPDATE.js';
|
|
11
|
-
import { READY_TYPE } from './message/READY.js';
|
|
12
|
-
import { TYPING_START_TYPE } from './message/TYPING_START.js';
|
|
13
|
-
import { VOICE_CHANNEL_STATUS_UPDATE_TYPE } from './message/VOICE_CHANNEL_STATUS_UPDATE.js';
|
|
14
|
-
import { VOICE_STATE_UPDATE_TYPE } from './message/VOICE_STATE_UPDATE.js';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* discord事件map
|
|
18
|
-
*/
|
|
19
|
-
type DCEventMap = {
|
|
20
|
-
CHANNEL_TOPIC_UPDATE: CHANNEL_TOPIC_UPDATE_TYPE;
|
|
21
|
-
CHANNEL_UPDATE: CHANNEL_UPDATE_TYPE;
|
|
22
|
-
GUILD_MEMBER_ADD: GUILD_MEMBER_ADD_TYPE;
|
|
23
|
-
GUILD_MEMBER_REMOVE: GUILD_MEMBER_REMOVE_TYPE;
|
|
24
|
-
GUILD_MEMBER_UPDATE: GUILD_MEMBER_UPDATE_TYPE;
|
|
25
|
-
MESSAGE_CREATE: MESSAGE_CREATE_TYPE;
|
|
26
|
-
MESSAGE_DELETE: MESSAGE_DELETE_TYPE;
|
|
27
|
-
MESSAGE_REACTION_ADD: MESSAGE_REACTION_ADD_TYPE;
|
|
28
|
-
MESSAGE_UPDATE: MESSAGE_UPDATE_TYPE;
|
|
29
|
-
PRESENCE_UPDATE: PRESENCE_UPDATE_TYPE;
|
|
30
|
-
READY: READY_TYPE;
|
|
31
|
-
TYPING_START: TYPING_START_TYPE;
|
|
32
|
-
VOICE_CHANNEL_STATUS_UPDATE: VOICE_CHANNEL_STATUS_UPDATE_TYPE;
|
|
33
|
-
VOICE_STATE_UPDATE: VOICE_STATE_UPDATE_TYPE;
|
|
34
|
-
ERROR: any;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export type { DCEventMap };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
declare const AvailableIntentsEventsEnum: readonly ["GUILDS", "MEMBERS", "GUILD_MODERATION", "GUILD_EMOJIS_AND_STICKERS", "GUILD_INTEGRATIONS", "GUILD_WEBHOOKS", "GUILD_INVITES", "GUILD_VOICE_STATES", "GUILD_PRESENCES", "GUILD_MESSAGES", "REACTIONS", "GUILD_MESSAGE_TYPING", "DIRECT_MESSAGES", "DIRECT_MESSAGE_REACTIONS", "DIRECT_MESSAGE_TYPING", "MESSAGE_CONTENT", "GUILD_SCHEDULED_EVENTS", "AUTO_MODERATION_CONFIGURATION", "AUTO_MODERATION_EXECUTION"];
|
|
2
|
-
type DCIntentsEnum = (typeof AvailableIntentsEventsEnum)[number];
|
|
3
|
-
|
|
4
|
-
export type { DCIntentsEnum };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|