chz-telegram-bot 0.3.27 → 0.3.28
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.
|
@@ -77,16 +77,17 @@ export declare class CommandActionBuilderWithState<TActionState extends IActionS
|
|
|
77
77
|
/**
|
|
78
78
|
* Configures action to use property value providers instead of static value to allow changes in runtime
|
|
79
79
|
*/
|
|
80
|
-
withConfiguration(configuration:
|
|
81
|
-
cooldownProvider?: CommandActionPropertyProvider<CooldownInfo>;
|
|
82
|
-
isActiveProvider?: CommandActionPropertyProvider<boolean>;
|
|
83
|
-
chatsBlacklistProvider?: CommandActionPropertyProvider<number[]>;
|
|
84
|
-
chatsWhitelistProvider?: CommandActionPropertyProvider<number[]>;
|
|
85
|
-
usersWhitelistProvider?: CommandActionPropertyProvider<number[]>;
|
|
86
|
-
}): this;
|
|
80
|
+
withConfiguration(configuration: CommandActionProvidersConfiguration | (() => CommandActionProvidersConfiguration)): this;
|
|
87
81
|
/** Builds action */
|
|
88
82
|
build(): CommandAction<TActionState>;
|
|
89
83
|
}
|
|
84
|
+
export type CommandActionProvidersConfiguration = {
|
|
85
|
+
cooldownProvider?: CommandActionPropertyProvider<CooldownInfo>;
|
|
86
|
+
isActiveProvider?: CommandActionPropertyProvider<boolean>;
|
|
87
|
+
chatsBlacklistProvider?: CommandActionPropertyProvider<number[]>;
|
|
88
|
+
chatsWhitelistProvider?: CommandActionPropertyProvider<number[]>;
|
|
89
|
+
usersWhitelistProvider?: CommandActionPropertyProvider<number[]>;
|
|
90
|
+
};
|
|
90
91
|
/**
|
|
91
92
|
* Builder for `CommandAction` with state represented by default state (containing only last execution date).
|
|
92
93
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandActionBuilder.d.ts","sourceRoot":"","sources":["../../../helpers/builders/commandActionBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAA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AAC,EAAE,6BAA6B,CAAC,MAAM,EAAE,CAAC,CAAC;IACjE,sBAAsB,CAAC,EAAE,6BAA6B,CAAC,MAAM,EAAE,CAAC,CAAC;IACjE,sBAAsB,CAAC,EAAE,6BAA6B,CAAC,MAAM,EAAE,CAAC,CAAC;CACpE,CAAC;AAEF;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,6BAA6B,CAAC,eAAe,CAAC;IACpF;;OAEG;gBACS,IAAI,EAAE,MAAM;CAG3B"}
|
|
@@ -110,6 +110,9 @@ class CommandActionBuilderWithState {
|
|
|
110
110
|
* Configures action to use property value providers instead of static value to allow changes in runtime
|
|
111
111
|
*/
|
|
112
112
|
withConfiguration(configuration) {
|
|
113
|
+
if (typeof configuration == 'function') {
|
|
114
|
+
configuration = configuration();
|
|
115
|
+
}
|
|
113
116
|
if (configuration.cooldownProvider)
|
|
114
117
|
this.cooldownSettingsProvider = configuration.cooldownProvider;
|
|
115
118
|
if (configuration.chatsWhitelistProvider)
|
|
@@ -144,13 +144,15 @@ export class CommandActionBuilderWithState<TActionState extends IActionState> {
|
|
|
144
144
|
/**
|
|
145
145
|
* Configures action to use property value providers instead of static value to allow changes in runtime
|
|
146
146
|
*/
|
|
147
|
-
withConfiguration(
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
147
|
+
withConfiguration(
|
|
148
|
+
configuration:
|
|
149
|
+
| CommandActionProvidersConfiguration
|
|
150
|
+
| (() => CommandActionProvidersConfiguration)
|
|
151
|
+
) {
|
|
152
|
+
if (typeof configuration == 'function') {
|
|
153
|
+
configuration = configuration();
|
|
154
|
+
}
|
|
155
|
+
|
|
154
156
|
if (configuration.cooldownProvider)
|
|
155
157
|
this.cooldownSettingsProvider = configuration.cooldownProvider;
|
|
156
158
|
|
|
@@ -190,6 +192,14 @@ export class CommandActionBuilderWithState<TActionState extends IActionState> {
|
|
|
190
192
|
}
|
|
191
193
|
}
|
|
192
194
|
|
|
195
|
+
export type CommandActionProvidersConfiguration = {
|
|
196
|
+
cooldownProvider?: CommandActionPropertyProvider<CooldownInfo>;
|
|
197
|
+
isActiveProvider?: CommandActionPropertyProvider<boolean>;
|
|
198
|
+
chatsBlacklistProvider?: CommandActionPropertyProvider<number[]>;
|
|
199
|
+
chatsWhitelistProvider?: CommandActionPropertyProvider<number[]>;
|
|
200
|
+
usersWhitelistProvider?: CommandActionPropertyProvider<number[]>;
|
|
201
|
+
};
|
|
202
|
+
|
|
193
203
|
/**
|
|
194
204
|
* Builder for `CommandAction` with state represented by default state (containing only last execution date).
|
|
195
205
|
*/
|