zumito-framework 1.1.3 → 1.1.6

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.
@@ -20,10 +20,10 @@ class InteractionCreate extends FrameworkEvent_1.FrameworkEvent {
20
20
  if (![CommandType_1.CommandType.any, CommandType_1.CommandType.separated, CommandType_1.CommandType.slash].includes(commandInstance.type))
21
21
  return;
22
22
  if (commandInstance.type === CommandType_1.CommandType.separated || commandInstance.type === CommandType_1.CommandType.slash) {
23
- await commandInstance.executeSlashCommand({ client, interaction, args });
23
+ await commandInstance.executeSlashCommand({ client, interaction, args, framework });
24
24
  }
25
25
  else {
26
- await commandInstance.execute({ client, interaction, args });
26
+ await commandInstance.execute({ client, interaction, args, framework });
27
27
  }
28
28
  }
29
29
  else if (interaction.isButton()) {
@@ -73,6 +73,7 @@ class InteractionCreate extends FrameworkEvent_1.FrameworkEvent {
73
73
  message,
74
74
  args: parsedArgs,
75
75
  client: framework.client,
76
+ framework: framework,
76
77
  });
77
78
  if (!message.channel.isDMBased && !message.deletable && (false)) { // false = settings.deleteCommands
78
79
  try {
@@ -1,4 +1,5 @@
1
1
  import { Client, Interaction, Message } from "discord.js";
2
+ import { ZumitoFramework } from "../ZumitoFramework";
2
3
  /**
3
4
  * @class CommandParameters
4
5
  * @classdesc Parameters passed to a command execution.
@@ -12,4 +13,5 @@ export interface CommandParameters {
12
13
  interaction?: Interaction;
13
14
  args: Map<String, any>;
14
15
  client: Client;
16
+ framework: ZumitoFramework;
15
17
  }
@@ -16,8 +16,8 @@ export declare abstract class Command {
16
16
  args: CommandArgDefinition[];
17
17
  type: string;
18
18
  constructor();
19
- abstract execute({ message, interaction, args, client }: CommandParameters): void;
20
- executePrefixCommand({ message, interaction, args, client }: CommandParameters): void;
21
- executeSlashCommand({ message, interaction, args, client }: CommandParameters): void;
19
+ abstract execute({ message, interaction, args, client, framework }: CommandParameters): void;
20
+ executePrefixCommand({ message, interaction, args, client, framework }: CommandParameters): void;
21
+ executeSlashCommand({ message, interaction, args, client, framework }: CommandParameters): void;
22
22
  selectMenu({ path, interaction, client, framework }: SelectMenuParameters): void;
23
23
  }
@@ -19,11 +19,11 @@ class Command {
19
19
  type = CommandType_1.CommandType.prefix;
20
20
  constructor() {
21
21
  }
22
- executePrefixCommand({ message, interaction, args, client }) {
23
- this.execute({ message, interaction, args, client });
22
+ executePrefixCommand({ message, interaction, args, client, framework }) {
23
+ this.execute({ message, interaction, args, client, framework });
24
24
  }
25
- executeSlashCommand({ message, interaction, args, client }) {
26
- this.execute({ message, interaction, args, client });
25
+ executeSlashCommand({ message, interaction, args, client, framework }) {
26
+ this.execute({ message, interaction, args, client, framework });
27
27
  }
28
28
  selectMenu({ path, interaction, client, framework }) { }
29
29
  }
@@ -1,9 +1,9 @@
1
1
  export declare class Translation {
2
- text: Map<String, String>;
2
+ text: Map<string, string>;
3
3
  constructor();
4
4
  get(language: string): String;
5
5
  set(language: string, text: string): void;
6
6
  has(language: string): boolean;
7
- getAll(): Map<String, String>;
8
- setAll(text: Map<String, String>): void;
7
+ getAll(): Map<string, string>;
8
+ setAll(text: Map<string, string>): void;
9
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zumito-framework",
3
- "version": "1.1.3",
3
+ "version": "1.1.6",
4
4
  "description": "Discord.js bot framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -4,7 +4,7 @@ export class Test extends Command {
4
4
 
5
5
  name: 'test';
6
6
 
7
- execute({ message, interaction, args, client }: CommandParameters): void {
7
+ execute({ message, interaction, args, client, framework }: CommandParameters): void {
8
8
  message.channel.send({
9
9
  content: "Test command executed",
10
10
  });