@futdevpro/nts-dynamo 1.11.16 → 1.11.18
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/build/_modules/discord-assistant/_collections/dias.util.d.ts +10 -1
- package/build/_modules/discord-assistant/_collections/dias.util.d.ts.map +1 -1
- package/build/_modules/discord-assistant/_collections/dias.util.js +45 -0
- package/build/_modules/discord-assistant/_collections/dias.util.js.map +1 -1
- package/build/_modules/discord-assistant/_services/dias-chunk.data-service.d.ts +1 -1
- package/build/_modules/discord-assistant/_services/dias-chunk.data-service.d.ts.map +1 -1
- package/build/_modules/discord-assistant/_services/dias-chunk.data-service.js +31 -13
- package/build/_modules/discord-assistant/_services/dias-chunk.data-service.js.map +1 -1
- package/build/_modules/discord-assistant/_services/dias-io.control-service.d.ts +2 -1
- package/build/_modules/discord-assistant/_services/dias-io.control-service.d.ts.map +1 -1
- package/build/_modules/discord-assistant/_services/dias-io.control-service.js +6 -2
- package/build/_modules/discord-assistant/_services/dias-io.control-service.js.map +1 -1
- package/build/_modules/discord-assistant/_services/dias-main.control-service.d.ts +0 -1
- package/build/_modules/discord-assistant/_services/dias-main.control-service.d.ts.map +1 -1
- package/build/_modules/discord-assistant/_services/dias-main.control-service.js +0 -15
- package/build/_modules/discord-assistant/_services/dias-main.control-service.js.map +1 -1
- package/build/_modules/discord-assistant/index.d.ts +1 -0
- package/build/_modules/discord-assistant/index.d.ts.map +1 -1
- package/build/_modules/discord-assistant/index.js +1 -0
- package/build/_modules/discord-assistant/index.js.map +1 -1
- package/build/_modules/discord-bot/_collections/dibo-global-settings.conts.d.ts +1 -1
- package/build/_modules/discord-bot/_collections/dibo-global-settings.conts.d.ts.map +1 -1
- package/build/_modules/discord-bot/_models/dibo-global-settings.interface.d.ts +88 -0
- package/build/_modules/discord-bot/_models/dibo-global-settings.interface.d.ts.map +1 -0
- package/build/_modules/discord-bot/_models/dibo-global-settings.interface.js +3 -0
- package/build/_modules/discord-bot/_models/dibo-global-settings.interface.js.map +1 -0
- package/build/_modules/discord-bot/_services/dibo-commands.control-service.d.ts +2 -2
- package/build/_modules/discord-bot/_services/dibo-commands.control-service.d.ts.map +1 -1
- package/build/_modules/discord-bot/_services/dibo-commands.control-service.js +4 -4
- package/build/_modules/discord-bot/_services/dibo-commands.control-service.js.map +1 -1
- package/build/_modules/discord-bot/_services/dibo-io.control-service.d.ts +6 -5
- package/build/_modules/discord-bot/_services/dibo-io.control-service.d.ts.map +1 -1
- package/build/_modules/discord-bot/_services/dibo-io.control-service.js +24 -15
- package/build/_modules/discord-bot/_services/dibo-io.control-service.js.map +1 -1
- package/build/_modules/discord-bot/_services/dibo-main.control-service.d.ts.map +1 -1
- package/build/_modules/discord-bot/_services/dibo-main.control-service.js +2 -1
- package/build/_modules/discord-bot/_services/dibo-main.control-service.js.map +1 -1
- package/build/_modules/discord-bot/_services/dibo-routines.control-service.d.ts +0 -1
- package/build/_modules/discord-bot/_services/dibo-routines.control-service.d.ts.map +1 -1
- package/build/_modules/discord-bot/_services/dibo-routines.control-service.js +0 -3
- package/build/_modules/discord-bot/_services/dibo-routines.control-service.js.map +1 -1
- package/build/_modules/discord-bot/index.d.ts +1 -1
- package/build/_modules/discord-bot/index.d.ts.map +1 -1
- package/build/_modules/discord-bot/index.js +1 -1
- package/build/_modules/discord-bot/index.js.map +1 -1
- package/build/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts +284 -58
- package/build/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts.map +1 -1
- package/build/_modules/open-ai/_services/oai-llm-chat.service-base.js +91 -104
- package/build/_modules/open-ai/_services/oai-llm-chat.service-base.js.map +1 -1
- package/build/_modules/open-ai/_services/oai-llm.service-base.d.ts +246 -53
- package/build/_modules/open-ai/_services/oai-llm.service-base.d.ts.map +1 -1
- package/build/_modules/open-ai/_services/oai-llm.service-base.js +86 -96
- package/build/_modules/open-ai/_services/oai-llm.service-base.js.map +1 -1
- package/package.json +1 -1
- package/src/_modules/discord-assistant/_collections/dias.util.ts +79 -1
- package/src/_modules/discord-assistant/_services/dias-chunk.data-service.ts +26 -25
- package/src/_modules/discord-assistant/_services/dias-io.control-service.ts +8 -7
- package/src/_modules/discord-assistant/_services/dias-main.control-service.ts +2 -2
- package/src/_modules/discord-assistant/index.ts +1 -0
- package/src/_modules/discord-bot/_collections/dibo-global-settings.conts.ts +1 -1
- package/src/_modules/discord-bot/_services/dibo-commands.control-service.ts +3 -3
- package/src/_modules/discord-bot/_services/dibo-io.control-service.ts +36 -20
- package/src/_modules/discord-bot/_services/dibo-main.control-service.ts +2 -1
- package/src/_modules/discord-bot/_services/dibo-routines.control-service.ts +2 -2
- package/src/_modules/discord-bot/index.ts +1 -1
- package/src/_modules/open-ai/_services/oai-llm-chat.service-base.ts +233 -249
- package/src/_modules/open-ai/_services/oai-llm.service-base.ts +189 -147
- /package/src/_modules/discord-bot/_models/{global-bot-log-settings.interface.ts → dibo-global-settings.interface.ts} +0 -0
|
@@ -2,7 +2,7 @@ import { Client, GatewayIntentBits, Guild, Collection, GuildMember, Message, Tex
|
|
|
2
2
|
import * as dotenv from 'dotenv'
|
|
3
3
|
import { DyFM_Error, DyFM_Log, hour, week } from '@futdevpro/fsm-dynamo'
|
|
4
4
|
import { DyNTS_DiBo_Routines_ControlService } from './dibo-routines.control-service'
|
|
5
|
-
import {
|
|
5
|
+
import { DyNTS_DiBo_Commands_ControlService } from './dibo-commands.control-service'
|
|
6
6
|
import { DyNTS_SingletonService } from '../../../_services/base/singleton.service'
|
|
7
7
|
import { DyNTS_DiBo_Main_ControlService } from './dibo-main.control-service'
|
|
8
8
|
import { DyNTS_global_settings } from '../../../_collections/global-settings.const'
|
|
@@ -16,7 +16,8 @@ export abstract class DyNTS_DiBo_IO_ControlService extends DyNTS_SingletonServic
|
|
|
16
16
|
return DyNTS_DiBo_IO_ControlService.getSingletonInstance();
|
|
17
17
|
} */
|
|
18
18
|
|
|
19
|
-
protected
|
|
19
|
+
protected abstract getMainDiscordBotControlService(): DyNTS_DiBo_Main_ControlService;
|
|
20
|
+
protected abstract mainDiscordBot_CS: DyNTS_DiBo_Main_ControlService;
|
|
20
21
|
|
|
21
22
|
get discordServer(): Guild {
|
|
22
23
|
return this.mainDiscordBot_CS.discordServer;
|
|
@@ -28,26 +29,40 @@ export abstract class DyNTS_DiBo_IO_ControlService extends DyNTS_SingletonServic
|
|
|
28
29
|
return this.mainDiscordBot_CS.botDisplayName;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
protected abstract getCommandsControlService():
|
|
32
|
-
protected
|
|
32
|
+
protected abstract getCommandsControlService(): DyNTS_DiBo_Commands_ControlService;
|
|
33
|
+
protected commands_CS: DyNTS_DiBo_Commands_ControlService;
|
|
33
34
|
|
|
34
|
-
protected constructor() {
|
|
35
|
+
/* protected constructor() {
|
|
35
36
|
super();
|
|
37
|
+
} */
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
async start(issuer: string): Promise<void> {
|
|
40
|
+
try {
|
|
41
|
+
this.mainDiscordBot_CS = this.getMainDiscordBotControlService();
|
|
42
|
+
this.commands_CS = this.getCommandsControlService();
|
|
43
|
+
|
|
44
|
+
if (!this.discordServer) {
|
|
45
|
+
throw new DyFM_Error({
|
|
46
|
+
...this.getDefaultErrorSettings(
|
|
47
|
+
'constructor',
|
|
48
|
+
new Error(
|
|
49
|
+
'Discord server not yet initialized, ' +
|
|
50
|
+
'should only be called after DyNTS_DiBo_Main_ControlService.start'
|
|
51
|
+
),
|
|
52
|
+
'system-init'
|
|
53
|
+
),
|
|
54
|
+
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-DiBo-IO-C000`,
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
} catch (error) {
|
|
38
58
|
throw new DyFM_Error({
|
|
39
|
-
...this.getDefaultErrorSettings(
|
|
40
|
-
|
|
41
|
-
new Error(
|
|
42
|
-
'Discord server not yet initialized, ' +
|
|
43
|
-
'should only be called after DyNTS_DiBo_Main_ControlService.start'
|
|
44
|
-
),
|
|
45
|
-
'system-init'
|
|
46
|
-
),
|
|
47
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-DiBo-IO-C000`,
|
|
59
|
+
...this.getDefaultErrorSettings('start', error, issuer),
|
|
60
|
+
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-DiBo-IO-S000`,
|
|
48
61
|
})
|
|
49
62
|
}
|
|
50
|
-
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* async */
|
|
51
66
|
|
|
52
67
|
async handleNewMessage(message: Message, issuer: string): Promise<void> {
|
|
53
68
|
try {
|
|
@@ -111,10 +126,6 @@ export abstract class DyNTS_DiBo_IO_ControlService extends DyNTS_SingletonServic
|
|
|
111
126
|
const isAllowedChannel = DyNTS_DiBo_global_settings.channelSettings.allowedChannels.includes(
|
|
112
127
|
channelName
|
|
113
128
|
) || (isDMChannel && DyNTS_DiBo_global_settings.channelSettings.dmIsAllowed);
|
|
114
|
-
const isAllowedUser = DyNTS_DiBo_global_settings.allowedUsers === 'all' ||
|
|
115
|
-
DyNTS_DiBo_global_settings.allowedUsers.includes(message.author.id) ||
|
|
116
|
-
DyNTS_DiBo_global_settings.allowedUsers.includes(message.author.username) ||
|
|
117
|
-
DyNTS_DiBo_global_settings.allowedUsers.includes(message.author.displayName);
|
|
118
129
|
|
|
119
130
|
if (!isAllowedChannel) {
|
|
120
131
|
if (DyNTS_DiBo_global_settings.debugLevel >= 2) {
|
|
@@ -167,6 +178,11 @@ export abstract class DyNTS_DiBo_IO_ControlService extends DyNTS_SingletonServic
|
|
|
167
178
|
return false;
|
|
168
179
|
}
|
|
169
180
|
|
|
181
|
+
const isAllowedUser = DyNTS_DiBo_global_settings.allowedUsers === 'all' ||
|
|
182
|
+
DyNTS_DiBo_global_settings.allowedUsers.includes(message.author.id) ||
|
|
183
|
+
DyNTS_DiBo_global_settings.allowedUsers.includes(message.author.username) ||
|
|
184
|
+
DyNTS_DiBo_global_settings.allowedUsers.includes(message.author.displayName);
|
|
185
|
+
|
|
170
186
|
if (!isAllowedUser) {
|
|
171
187
|
if (DyNTS_DiBo_global_settings.debugLevel >= 2) {
|
|
172
188
|
DyFM_Log.warn('🚫❌ not allowed user. END', message.author.username, message.author.displayName)
|
|
@@ -83,7 +83,7 @@ export abstract class DyNTS_DiBo_Main_ControlService extends DyNTS_SingletonServ
|
|
|
83
83
|
protected constructor() {
|
|
84
84
|
super();
|
|
85
85
|
|
|
86
|
-
DyNTS_global_settings.bot_settings
|
|
86
|
+
DyNTS_global_settings.bot_settings ??= DyNTS_DiBo_global_settings;
|
|
87
87
|
|
|
88
88
|
if (this.client) {
|
|
89
89
|
throw new DyFM_Error({
|
|
@@ -239,6 +239,7 @@ export abstract class DyNTS_DiBo_Main_ControlService extends DyNTS_SingletonServ
|
|
|
239
239
|
this.routines_CS = this.getRoutinesControlService();
|
|
240
240
|
|
|
241
241
|
await this.routines_CS.start(issuer);
|
|
242
|
+
await this.botIO_CS.start(issuer);
|
|
242
243
|
|
|
243
244
|
} catch (error) {
|
|
244
245
|
throw new DyFM_Error({
|
|
@@ -9,9 +9,9 @@ import { DyNTS_global_settings } from '../../../_collections/global-settings.con
|
|
|
9
9
|
|
|
10
10
|
export abstract class DyNTS_DiBo_Routines_ControlService extends DyNTS_SingletonService {
|
|
11
11
|
|
|
12
|
-
static getInstance(): DyNTS_DiBo_Routines_ControlService {
|
|
12
|
+
/* static getInstance(): DyNTS_DiBo_Routines_ControlService {
|
|
13
13
|
return DyNTS_DiBo_Routines_ControlService.getSingletonInstance();
|
|
14
|
-
}
|
|
14
|
+
} */
|
|
15
15
|
|
|
16
16
|
protected abstract getMainDiscordBotControlService(): DyNTS_DiBo_Main_ControlService;
|
|
17
17
|
|
|
@@ -27,7 +27,7 @@ export * from './_collections/dibo-operations.util';
|
|
|
27
27
|
export * from './_models/dibo-command.interface';
|
|
28
28
|
export * from './_models/dibo-last-mention-date.inteface';
|
|
29
29
|
export * from './_models/dibo-last-message-date.interface';
|
|
30
|
-
export * from './_models/global-
|
|
30
|
+
export * from './_models/dibo-global-settings.interface';
|
|
31
31
|
|
|
32
32
|
// SERVICES
|
|
33
33
|
export * from './_services/dibo-commands.control-service';
|