alemonjs 2.1.48 → 2.1.49
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/app/event-processor-callHandler.js +3 -2
- package/lib/app/event-processor-cycleFiles.js +1 -1
- package/lib/app/event-utils.d.ts +14 -0
- package/lib/app/event-utils.js +86 -0
- package/lib/app/hook-event-context.d.ts +3 -0
- package/lib/app/hook-event-context.js +11 -0
- package/lib/app/hook-use/announce.d.ts +12 -0
- package/lib/app/hook-use/announce.js +49 -0
- package/lib/app/hook-use/channel.d.ts +24 -0
- package/lib/app/hook-use/channel.js +109 -0
- package/lib/app/hook-use/client.d.ts +2 -0
- package/lib/app/hook-use/client.js +49 -0
- package/lib/app/hook-use/common.d.ts +18 -0
- package/lib/app/hook-use/common.js +22 -0
- package/lib/app/hook-use/guild.d.ts +19 -0
- package/lib/app/hook-use/guild.js +102 -0
- package/lib/app/hook-use/history.d.ts +9 -0
- package/lib/app/hook-use/history.js +31 -0
- package/lib/app/hook-use/index.d.ts +15 -0
- package/lib/app/hook-use/index.js +15 -0
- package/lib/app/hook-use/me.d.ts +7 -0
- package/lib/app/hook-use/me.js +90 -0
- package/lib/app/hook-use/media.d.ts +23 -0
- package/lib/app/hook-use/media.js +62 -0
- package/lib/app/hook-use/member.d.ts +54 -0
- package/lib/app/hook-use/member.js +200 -0
- package/lib/app/hook-use/mention.d.ts +9 -0
- package/lib/app/hook-use/mention.js +88 -0
- package/lib/app/hook-use/message.d.ts +28 -0
- package/lib/app/hook-use/message.js +142 -0
- package/lib/app/hook-use/permission.d.ts +13 -0
- package/lib/app/hook-use/permission.js +49 -0
- package/lib/app/hook-use/reaction.d.ts +16 -0
- package/lib/app/hook-use/reaction.js +70 -0
- package/lib/app/hook-use/request.d.ts +14 -0
- package/lib/app/hook-use/request.js +53 -0
- package/lib/app/hook-use/role.d.ts +33 -0
- package/lib/app/hook-use/role.js +125 -0
- package/lib/app/hook-use/user.d.ts +6 -0
- package/lib/app/hook-use/user.js +39 -0
- package/lib/app/hook-use-api.d.ts +3 -3
- package/lib/app/hook-use-api.js +16 -13
- package/lib/app/hook-use-subscribe.d.ts +61 -20
- package/lib/app/hook-use-subscribe.js +21 -7
- package/lib/app/index.d.ts +3 -2
- package/lib/app/index.js +18 -3
- package/lib/app/message-api.d.ts +0 -6
- package/lib/app/message-api.js +1 -4
- package/lib/app/message-format.js +1 -1
- package/lib/cbp/connects/client.js +5 -4
- package/lib/client.js +3 -2
- package/lib/index.js +18 -3
- package/package.json +3 -3
- package/LICENSE +0 -21
package/lib/app/hook-use-api.js
CHANGED
|
@@ -4,6 +4,7 @@ import { createResult } from '../core/utils.js';
|
|
|
4
4
|
import { sendAction } from '../cbp/processor/actions.js';
|
|
5
5
|
import { sendAPI } from '../cbp/processor/api.js';
|
|
6
6
|
import { Format } from './message-format.js';
|
|
7
|
+
import { getCurrentEvent } from './hook-event-context.js';
|
|
7
8
|
|
|
8
9
|
const useMention = (event) => {
|
|
9
10
|
if (!event || typeof event !== 'object') {
|
|
@@ -94,7 +95,8 @@ const useMention = (event) => {
|
|
|
94
95
|
return [mention];
|
|
95
96
|
};
|
|
96
97
|
const useMessage = (event) => {
|
|
97
|
-
|
|
98
|
+
const currentEvent = (event ?? getCurrentEvent());
|
|
99
|
+
if (!currentEvent || typeof currentEvent !== 'object') {
|
|
98
100
|
logger.error({
|
|
99
101
|
code: ResultCode.FailParams,
|
|
100
102
|
message: 'Invalid event: event must be an object',
|
|
@@ -102,6 +104,7 @@ const useMessage = (event) => {
|
|
|
102
104
|
});
|
|
103
105
|
throw new Error('Invalid event: event must be an object');
|
|
104
106
|
}
|
|
107
|
+
const valueEvent = currentEvent;
|
|
105
108
|
const resolveFormat = (params) => {
|
|
106
109
|
if (params.format instanceof Format) {
|
|
107
110
|
return params.format.value;
|
|
@@ -115,7 +118,7 @@ const useMessage = (event) => {
|
|
|
115
118
|
const result = await sendAction({
|
|
116
119
|
action: 'message.send',
|
|
117
120
|
payload: {
|
|
118
|
-
event,
|
|
121
|
+
event: valueEvent,
|
|
119
122
|
params: {
|
|
120
123
|
format: val,
|
|
121
124
|
replyId
|
|
@@ -129,17 +132,17 @@ const useMessage = (event) => {
|
|
|
129
132
|
if (Array.isArray(params)) {
|
|
130
133
|
return sendRaw(params.length > 0 ? params : []);
|
|
131
134
|
}
|
|
132
|
-
return sendRaw(resolveFormat(params), params?.replyId ??
|
|
135
|
+
return sendRaw(resolveFormat(params), params?.replyId ?? valueEvent.MessageId);
|
|
133
136
|
},
|
|
134
137
|
async delete(params) {
|
|
135
|
-
const targetId = params?.messageId ||
|
|
138
|
+
const targetId = params?.messageId || valueEvent.MessageId;
|
|
136
139
|
if (!targetId) {
|
|
137
140
|
return createResult(ResultCode.FailParams, 'Missing MessageId', null);
|
|
138
141
|
}
|
|
139
142
|
try {
|
|
140
143
|
const results = await sendAction({
|
|
141
144
|
action: 'message.delete',
|
|
142
|
-
payload: { MessageId: targetId, ChannelId:
|
|
145
|
+
payload: { MessageId: targetId, ChannelId: valueEvent.ChannelId, event: valueEvent }
|
|
143
146
|
});
|
|
144
147
|
const result = results.find(item => item.code === ResultCode.Ok);
|
|
145
148
|
return result || createResult(ResultCode.Warn, 'Delete not supported or failed', null);
|
|
@@ -149,8 +152,8 @@ const useMessage = (event) => {
|
|
|
149
152
|
}
|
|
150
153
|
},
|
|
151
154
|
async edit(params) {
|
|
152
|
-
const targetId = params.messageId ||
|
|
153
|
-
const channelId =
|
|
155
|
+
const targetId = params.messageId || valueEvent.MessageId;
|
|
156
|
+
const channelId = valueEvent.ChannelId;
|
|
154
157
|
if (!targetId || !channelId) {
|
|
155
158
|
return createResult(ResultCode.FailParams, 'Missing MessageId or ChannelId', null);
|
|
156
159
|
}
|
|
@@ -158,7 +161,7 @@ const useMessage = (event) => {
|
|
|
158
161
|
const val = params.format instanceof Format ? params.format.value : params.format;
|
|
159
162
|
const results = await sendAction({
|
|
160
163
|
action: 'message.edit',
|
|
161
|
-
payload: { ChannelId: channelId, MessageId: targetId, params: { format: val }, event }
|
|
164
|
+
payload: { ChannelId: channelId, MessageId: targetId, params: { format: val }, event: valueEvent }
|
|
162
165
|
});
|
|
163
166
|
const result = results.find(item => item.code === ResultCode.Ok);
|
|
164
167
|
return result || createResult(ResultCode.Warn, 'Edit not supported or failed', null);
|
|
@@ -168,8 +171,8 @@ const useMessage = (event) => {
|
|
|
168
171
|
}
|
|
169
172
|
},
|
|
170
173
|
async pin(params) {
|
|
171
|
-
const targetId = params?.messageId ||
|
|
172
|
-
const channelId =
|
|
174
|
+
const targetId = params?.messageId || valueEvent.MessageId;
|
|
175
|
+
const channelId = valueEvent.ChannelId;
|
|
173
176
|
if (!targetId || !channelId) {
|
|
174
177
|
return createResult(ResultCode.FailParams, 'Missing MessageId or ChannelId', null);
|
|
175
178
|
}
|
|
@@ -186,8 +189,8 @@ const useMessage = (event) => {
|
|
|
186
189
|
}
|
|
187
190
|
},
|
|
188
191
|
async unpin(params) {
|
|
189
|
-
const targetId = params?.messageId ||
|
|
190
|
-
const channelId =
|
|
192
|
+
const targetId = params?.messageId || valueEvent.MessageId;
|
|
193
|
+
const channelId = valueEvent.ChannelId;
|
|
191
194
|
if (!targetId || !channelId) {
|
|
192
195
|
return createResult(ResultCode.FailParams, 'Missing MessageId or ChannelId', null);
|
|
193
196
|
}
|
|
@@ -204,7 +207,7 @@ const useMessage = (event) => {
|
|
|
204
207
|
}
|
|
205
208
|
},
|
|
206
209
|
async get(params) {
|
|
207
|
-
const targetId = params?.messageId ||
|
|
210
|
+
const targetId = params?.messageId || valueEvent.MessageId;
|
|
208
211
|
if (!targetId) {
|
|
209
212
|
return createResult(ResultCode.FailParams, 'Missing MessageId', null);
|
|
210
213
|
}
|
|
@@ -1,32 +1,73 @@
|
|
|
1
1
|
import { EventCycleEnum, Current, Events, EventKeys } from '../types';
|
|
2
|
-
export declare
|
|
3
|
-
|
|
2
|
+
export declare function useSubscribe<T extends EventKeys>(selects: T | T[]): readonly [
|
|
3
|
+
{
|
|
4
|
+
create: (callback: Current<T>, keys: (keyof Events[T])[]) => {
|
|
5
|
+
id: string;
|
|
6
|
+
selects: T[];
|
|
7
|
+
choose: EventCycleEnum;
|
|
8
|
+
};
|
|
9
|
+
mount: (callback: Current<T>, keys: (keyof Events[T])[]) => {
|
|
10
|
+
id: string;
|
|
11
|
+
selects: T[];
|
|
12
|
+
choose: EventCycleEnum;
|
|
13
|
+
};
|
|
14
|
+
unmount: (callback: Current<T>, keys: (keyof Events[T])[]) => {
|
|
15
|
+
id: string;
|
|
16
|
+
selects: T[];
|
|
17
|
+
choose: EventCycleEnum;
|
|
18
|
+
};
|
|
19
|
+
cancel: (value: {
|
|
20
|
+
id: string;
|
|
21
|
+
selects: T[];
|
|
22
|
+
choose: EventCycleEnum;
|
|
23
|
+
}) => void;
|
|
24
|
+
}
|
|
25
|
+
];
|
|
26
|
+
export declare function useSubscribe<T extends EventKeys>(event: Events[T] | undefined, selects: T | T[]): readonly [
|
|
27
|
+
{
|
|
28
|
+
create: (callback: Current<T>, keys: (keyof Events[T])[]) => {
|
|
29
|
+
id: string;
|
|
30
|
+
selects: T[];
|
|
31
|
+
choose: EventCycleEnum;
|
|
32
|
+
};
|
|
33
|
+
mount: (callback: Current<T>, keys: (keyof Events[T])[]) => {
|
|
34
|
+
id: string;
|
|
35
|
+
selects: T[];
|
|
36
|
+
choose: EventCycleEnum;
|
|
37
|
+
};
|
|
38
|
+
unmount: (callback: Current<T>, keys: (keyof Events[T])[]) => {
|
|
39
|
+
id: string;
|
|
40
|
+
selects: T[];
|
|
41
|
+
choose: EventCycleEnum;
|
|
42
|
+
};
|
|
43
|
+
cancel: (value: {
|
|
44
|
+
id: string;
|
|
45
|
+
selects: T[];
|
|
46
|
+
choose: EventCycleEnum;
|
|
47
|
+
}) => void;
|
|
48
|
+
}
|
|
49
|
+
];
|
|
50
|
+
export declare function useObserver<T extends EventKeys>(selects: T | T[]): readonly [
|
|
51
|
+
(callback: Current<T>, keys: (keyof Events[T])[]) => {
|
|
52
|
+
id: string;
|
|
4
53
|
selects: T[];
|
|
5
54
|
choose: EventCycleEnum;
|
|
55
|
+
},
|
|
56
|
+
(value: {
|
|
6
57
|
id: string;
|
|
7
|
-
};
|
|
8
|
-
mount: (callback: Current<T>, keys: (keyof Events[T])[]) => {
|
|
9
58
|
selects: T[];
|
|
10
59
|
choose: EventCycleEnum;
|
|
60
|
+
}) => void
|
|
61
|
+
];
|
|
62
|
+
export declare function useObserver<T extends EventKeys>(event: Events[T] | undefined, selects: T | T[]): readonly [
|
|
63
|
+
(callback: Current<T>, keys: (keyof Events[T])[]) => {
|
|
11
64
|
id: string;
|
|
12
|
-
};
|
|
13
|
-
unmount: (callback: Current<T>, keys: (keyof Events[T])[]) => {
|
|
14
65
|
selects: T[];
|
|
15
66
|
choose: EventCycleEnum;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
cancel: (value: {
|
|
67
|
+
},
|
|
68
|
+
(value: {
|
|
19
69
|
id: string;
|
|
20
70
|
selects: T[];
|
|
21
71
|
choose: EventCycleEnum;
|
|
22
|
-
}) => void
|
|
23
|
-
|
|
24
|
-
export declare const useObserver: <T extends EventKeys>(event: Events[T], selects: T | T[]) => readonly [(callback: Current<T>, keys: (keyof Events[T])[]) => {
|
|
25
|
-
selects: T[];
|
|
26
|
-
choose: EventCycleEnum;
|
|
27
|
-
id: string;
|
|
28
|
-
}, (value: {
|
|
29
|
-
id: string;
|
|
30
|
-
selects: T[];
|
|
31
|
-
choose: EventCycleEnum;
|
|
32
|
-
}) => void];
|
|
72
|
+
}) => void
|
|
73
|
+
];
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { ResultCode } from '../core/variable.js';
|
|
2
2
|
import { SubscribeList } from './store.js';
|
|
3
3
|
import { SubscribeStatus } from './config.js';
|
|
4
|
+
import { getCurrentEvent } from './hook-event-context.js';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
function useSubscribe(eventOrSelects, maybeSelects) {
|
|
7
|
+
const selects = (maybeSelects === undefined ? eventOrSelects : maybeSelects);
|
|
8
|
+
const event = (maybeSelects === undefined ? undefined : eventOrSelects);
|
|
9
|
+
const valueEvent = event ?? getCurrentEvent();
|
|
10
|
+
if (typeof valueEvent !== 'object' || valueEvent === null) {
|
|
7
11
|
logger.error({
|
|
8
12
|
code: ResultCode.FailParams,
|
|
9
13
|
message: 'event is not object',
|
|
@@ -34,8 +38,8 @@ const useSubscribe = (event, selects) => {
|
|
|
34
38
|
const subList = new SubscribeList(choose, select);
|
|
35
39
|
const values = {};
|
|
36
40
|
for (const key of keys) {
|
|
37
|
-
if (typeof key === 'string' && (typeof
|
|
38
|
-
values[key] =
|
|
41
|
+
if (typeof key === 'string' && (typeof valueEvent[key] === 'string' || typeof valueEvent[key] === 'number' || typeof valueEvent[key] === 'boolean')) {
|
|
42
|
+
values[key] = valueEvent[key];
|
|
39
43
|
}
|
|
40
44
|
else {
|
|
41
45
|
logger.warn({
|
|
@@ -89,10 +93,20 @@ const useSubscribe = (event, selects) => {
|
|
|
89
93
|
cancel
|
|
90
94
|
};
|
|
91
95
|
return [subscribe];
|
|
92
|
-
}
|
|
93
|
-
|
|
96
|
+
}
|
|
97
|
+
function useObserver(eventOrSelects, maybeSelects) {
|
|
98
|
+
const selects = (maybeSelects === undefined ? eventOrSelects : maybeSelects);
|
|
99
|
+
const event = (maybeSelects === undefined ? undefined : eventOrSelects);
|
|
100
|
+
if (selects === undefined) {
|
|
101
|
+
logger.error({
|
|
102
|
+
code: ResultCode.FailParams,
|
|
103
|
+
message: 'select is not string or array',
|
|
104
|
+
data: null
|
|
105
|
+
});
|
|
106
|
+
throw new Error('select is not string or array');
|
|
107
|
+
}
|
|
94
108
|
const [subscribe] = useSubscribe(event, selects);
|
|
95
109
|
return [subscribe.mount, subscribe.cancel];
|
|
96
|
-
}
|
|
110
|
+
}
|
|
97
111
|
|
|
98
112
|
export { useObserver, useSubscribe };
|
package/lib/app/index.d.ts
CHANGED
|
@@ -13,8 +13,9 @@ export * from './event-processor-cycle.js';
|
|
|
13
13
|
export * from './event-processor-event.js';
|
|
14
14
|
export * from './event-processor-middleware.js';
|
|
15
15
|
export * from './event-processor-subscribe.js';
|
|
16
|
-
export * from './hook-use
|
|
17
|
-
export * from './hook-
|
|
16
|
+
export * from './hook-use/index.js';
|
|
17
|
+
export * from './hook-event-context.js';
|
|
18
|
+
export * from './event-utils.js';
|
|
18
19
|
export * from './hook-use-subscribe.js';
|
|
19
20
|
export * from './message-api.js';
|
|
20
21
|
export * from './message-format.js';
|
package/lib/app/index.js
CHANGED
|
@@ -14,9 +14,24 @@ export { expendCycle } from './event-processor-cycle.js';
|
|
|
14
14
|
export { expendEvent } from './event-processor-event.js';
|
|
15
15
|
export { expendMiddleware } from './event-processor-middleware.js';
|
|
16
16
|
export { expendSubscribe, expendSubscribeCreate, expendSubscribeMount, expendSubscribeUnmount } from './event-processor-subscribe.js';
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
17
|
+
export { useAnnounce } from './hook-use/announce.js';
|
|
18
|
+
export { useChannel } from './hook-use/channel.js';
|
|
19
|
+
export { useClient } from './hook-use/client.js';
|
|
20
|
+
export { useGuild } from './hook-use/guild.js';
|
|
21
|
+
export { useHistory } from './hook-use/history.js';
|
|
22
|
+
export { useMedia } from './hook-use/media.js';
|
|
23
|
+
export { useMe } from './hook-use/me.js';
|
|
24
|
+
export { useMember } from './hook-use/member.js';
|
|
25
|
+
export { useMention } from './hook-use/mention.js';
|
|
26
|
+
export { useMessage, useSend, useSends } from './hook-use/message.js';
|
|
27
|
+
export { usePermission } from './hook-use/permission.js';
|
|
28
|
+
export { useReaction } from './hook-use/reaction.js';
|
|
29
|
+
export { useRequest } from './hook-use/request.js';
|
|
30
|
+
export { useRole } from './hook-use/role.js';
|
|
31
|
+
export { useUser } from './hook-use/user.js';
|
|
32
|
+
export { getCurrentEvent, withEventContext } from './hook-event-context.js';
|
|
33
|
+
export { createEventValue, createSelects, onSelects, onState, unChildren, unState, useState } from './event-utils.js';
|
|
19
34
|
export { useObserver, useSubscribe } from './hook-use-subscribe.js';
|
|
20
|
-
export { MessageDirect, createDataFormat,
|
|
35
|
+
export { MessageDirect, createDataFormat, format, getMessageIntent, sendToChannel, sendToUser } from './message-api.js';
|
|
21
36
|
export { Format, FormatButtonGroup, FormatMarkDown, createEvent } from './message-format.js';
|
|
22
37
|
export { Attachment, Audio, BT, Button, Image, ImageFile, ImageURL, Link, MD, Markdown, MarkdownOriginal, Mention, Text, Video } from './message-format-old.js';
|
package/lib/app/message-api.d.ts
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { DataEnums, OnDataFormatFunc } from '../types';
|
|
2
2
|
import { Result } from '../core';
|
|
3
3
|
import { Format } from './message-format';
|
|
4
|
-
type BaseMap = {
|
|
5
|
-
[key: string]: unknown;
|
|
6
|
-
};
|
|
7
|
-
export declare const createEventValue: <T extends keyof R, R extends BaseMap>(event: {
|
|
8
|
-
value: R[T];
|
|
9
|
-
}) => R[T];
|
|
10
4
|
export declare const format: OnDataFormatFunc;
|
|
11
5
|
export declare const createDataFormat: OnDataFormatFunc;
|
|
12
6
|
export declare class MessageDirect {
|
package/lib/app/message-api.js
CHANGED
|
@@ -5,9 +5,6 @@ import 'path';
|
|
|
5
5
|
import 'yaml';
|
|
6
6
|
import { createResult } from '../core/utils.js';
|
|
7
7
|
|
|
8
|
-
const createEventValue = (event) => {
|
|
9
|
-
return event.value;
|
|
10
|
-
};
|
|
11
8
|
const format = (...data) => {
|
|
12
9
|
if (!data || data.length === 0) {
|
|
13
10
|
logger.error({
|
|
@@ -111,4 +108,4 @@ const getMessageIntent = async () => {
|
|
|
111
108
|
return createResult(ResultCode.Ok, '获取成功', results[0]?.data ?? null);
|
|
112
109
|
};
|
|
113
110
|
|
|
114
|
-
export { MessageDirect, createDataFormat,
|
|
111
|
+
export { MessageDirect, createDataFormat, format, getMessageIntent, sendToChannel, sendToUser };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Text, Image, Mention, BT, MD, MarkdownOriginal, Attachment, Audio, Video, Link, ImageFile, ImageURL } from './message-format-old.js';
|
|
2
2
|
export { Button, Markdown } from './message-format-old.js';
|
|
3
3
|
|
|
4
4
|
class FormatButtonGroup {
|
|
@@ -13,12 +13,13 @@ import '../../app/event-middleware.js';
|
|
|
13
13
|
import { onProcessor } from '../../app/event-processor.js';
|
|
14
14
|
import '../../app/event-response.js';
|
|
15
15
|
import { createResult } from '../../core/utils.js';
|
|
16
|
-
import '../../app/hook-
|
|
17
|
-
import '../../app/
|
|
18
|
-
import '../../app/message-format-old.js';
|
|
16
|
+
import '../../app/hook-event-context.js';
|
|
17
|
+
import '../../app/event-utils.js';
|
|
19
18
|
import { apiResolves, apiTimeouts, actionResolves, actionTimeouts, FULL_RECEIVE_HEADER } from '../processor/config.js';
|
|
20
|
-
import { createWSConnector } from './base.js';
|
|
21
19
|
import { setDirectSend } from '../processor/transport.js';
|
|
20
|
+
import '../../app/message-format-old.js';
|
|
21
|
+
import '../../app/message-api.js';
|
|
22
|
+
import { createWSConnector } from './base.js';
|
|
22
23
|
import { createDirectServer } from '../../process/direct-channel.js';
|
|
23
24
|
|
|
24
25
|
const handleParsedMessage = (parsedMessage) => {
|
package/lib/client.js
CHANGED
|
@@ -26,9 +26,10 @@ import './app/event-group.js';
|
|
|
26
26
|
import './app/event-middleware.js';
|
|
27
27
|
import './app/event-processor.js';
|
|
28
28
|
import './app/event-response.js';
|
|
29
|
-
import './app/hook-
|
|
30
|
-
import './app/
|
|
29
|
+
import './app/hook-event-context.js';
|
|
30
|
+
import './app/event-utils.js';
|
|
31
31
|
import './app/message-format-old.js';
|
|
32
|
+
import './app/message-api.js';
|
|
32
33
|
import './process/platform.js';
|
|
33
34
|
import './process/module.js';
|
|
34
35
|
import { createServer } from './server/main.js';
|
package/lib/index.js
CHANGED
|
@@ -21,10 +21,25 @@ export { expendCycle } from './app/event-processor-cycle.js';
|
|
|
21
21
|
export { expendEvent } from './app/event-processor-event.js';
|
|
22
22
|
export { expendMiddleware } from './app/event-processor-middleware.js';
|
|
23
23
|
export { expendSubscribe, expendSubscribeCreate, expendSubscribeMount, expendSubscribeUnmount } from './app/event-processor-subscribe.js';
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
24
|
+
export { useAnnounce } from './app/hook-use/announce.js';
|
|
25
|
+
export { useChannel } from './app/hook-use/channel.js';
|
|
26
|
+
export { useClient } from './app/hook-use/client.js';
|
|
27
|
+
export { useGuild } from './app/hook-use/guild.js';
|
|
28
|
+
export { useHistory } from './app/hook-use/history.js';
|
|
29
|
+
export { useMedia } from './app/hook-use/media.js';
|
|
30
|
+
export { useMe } from './app/hook-use/me.js';
|
|
31
|
+
export { useMember } from './app/hook-use/member.js';
|
|
32
|
+
export { useMention } from './app/hook-use/mention.js';
|
|
33
|
+
export { useMessage, useSend, useSends } from './app/hook-use/message.js';
|
|
34
|
+
export { usePermission } from './app/hook-use/permission.js';
|
|
35
|
+
export { useReaction } from './app/hook-use/reaction.js';
|
|
36
|
+
export { useRequest } from './app/hook-use/request.js';
|
|
37
|
+
export { useRole } from './app/hook-use/role.js';
|
|
38
|
+
export { useUser } from './app/hook-use/user.js';
|
|
39
|
+
export { getCurrentEvent, withEventContext } from './app/hook-event-context.js';
|
|
40
|
+
export { createEventValue, createSelects, onSelects, onState, unChildren, unState, useState } from './app/event-utils.js';
|
|
26
41
|
export { useObserver, useSubscribe } from './app/hook-use-subscribe.js';
|
|
27
|
-
export { MessageDirect, createDataFormat,
|
|
42
|
+
export { MessageDirect, createDataFormat, format, getMessageIntent, sendToChannel, sendToUser } from './app/message-api.js';
|
|
28
43
|
export { Format, FormatButtonGroup, FormatMarkDown, createEvent } from './app/message-format.js';
|
|
29
44
|
export { start } from './main.js';
|
|
30
45
|
export { Attachment, Audio, BT, Button, Image, ImageFile, ImageURL, Link, MD, Markdown, MarkdownOriginal, Mention, Text, Video } from './app/message-format-old.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alemonjs",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.49",
|
|
4
4
|
"description": "bot script",
|
|
5
5
|
"author": "lemonade",
|
|
6
6
|
"license": "MIT",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"type": "git",
|
|
70
70
|
"url": "https://github.com/lemonade-lab/alemonjs.git"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
73
|
-
}
|
|
72
|
+
"gitHead": "c6aa5616afe091a37610dad22fbb2d2618d943b8"
|
|
73
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2013-present, Yuxi (Evan) You
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIdED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|