zumito-framework 1.4.2 → 1.5.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.
@@ -197,13 +197,27 @@ export class InteractionHandler {
197
197
  if (!guildSettings && interaction.guildId) {
198
198
  guildSettings = await ServiceContainer.getService(GuildDataGetter).getGuildSettings(interaction.guildId);
199
199
  }
200
- commandInstance.modalSubmit({
201
- client: this.client,
202
- path,
203
- interaction,
204
- framework,
205
- guildSettings,
206
- });
200
+ const trans = this.translationManager.getShortHandMethod('command.' + commandInstance.name, guildSettings?.lang);
201
+ if (commandInstance.binds?.modalSubmit) {
202
+ commandInstance.binds?.modalSubmit({
203
+ path,
204
+ interaction,
205
+ client: this.client,
206
+ framework,
207
+ guildSettings,
208
+ trans,
209
+ });
210
+ }
211
+ else if ( // Deprecated
212
+ commandInstance.constructor.prototype.hasOwnProperty('modalSubmit')) {
213
+ commandInstance.modalSubmit({
214
+ client: this.client,
215
+ path,
216
+ interaction,
217
+ framework,
218
+ guildSettings,
219
+ });
220
+ }
207
221
  }
208
222
  this.eventManager.emitEvent('modalSubmit', 'framework', {
209
223
  client: this.client,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zumito-framework",
3
- "version": "1.4.2",
3
+ "version": "1.5.0",
4
4
  "description": "Discord.js bot framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",