@elara-services/packages 3.0.3 → 4.0.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.
package/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ # v4.0.0
2
+ __Breaking Change__
3
+ The following functions & methods for `SlashBuilder` was moved to `static`
4
+ > So you no longer need to do `new (require("@elara-services/packages").SlashBuilder)()`
5
+
6
+
1
7
  # v3.0.3
2
8
  Added 'types.context.user', 'types.context.message' and the typings for SlashBuilder
3
9
 
package/index.d.ts CHANGED
@@ -62,8 +62,10 @@ declare module "@elara-services/packages" {
62
62
  }
63
63
 
64
64
  export class SlashBuilder {
65
- public constructor();
66
- public types: {
65
+
66
+ public static TEXT_BASED_CHANNELS: number[];
67
+
68
+ public static types: {
67
69
  sub_command: number,
68
70
  sub_group: number,
69
71
  string: number,
@@ -80,14 +82,14 @@ declare module "@elara-services/packages" {
80
82
  }
81
83
  };
82
84
 
83
- public context: {
85
+ public static context: {
84
86
  user(name: string): Slash;
85
87
  message(name: string): Slash;
86
88
  };
87
89
 
88
- public choice(name: string, value: string|number): { name: string, value: string|number };
89
- public option(data: SlashOptions): Slash;
90
- public create(name: string, description: string, options: Slash): Slash;
90
+ public static choice(name: string, value: string|number): { name: string, value: string|number };
91
+ public static option(data: SlashOptions): Slash;
92
+ public static create(name: string, description: string, options: Slash): Slash;
91
93
  }
92
94
 
93
95
  export type Button = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elara-services/packages",
3
- "version": "3.0.3",
3
+ "version": "4.0.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "./index.d.ts",
@@ -1,9 +1,9 @@
1
- module.exports = class SlashBuilder {
2
- constructor() {
3
- this.TEXT_BASED_CHANNELS = [ 0, 5, 11, 12 ];
4
- };
1
+ module.exports = class SlashBuilder extends null {
2
+ static get TEXT_BASED_CHANNELS() {
3
+ return [ 0, 5, 11, 12 ]
4
+ }
5
5
 
6
- get types() {
6
+ static get types() {
7
7
  return {
8
8
  sub_command: 1,
9
9
  sub_group: 2,
@@ -22,22 +22,22 @@ module.exports = class SlashBuilder {
22
22
  };
23
23
  }
24
24
 
25
- get context() {
25
+ static get context() {
26
26
  return {
27
27
  user: (name) => this.create(name, "", { type: 2 }),
28
28
  message: (name) => this.create(name, "", { type: 3 })
29
29
  }
30
30
  };
31
31
 
32
- choice(name, value) {
32
+ static choice(name, value) {
33
33
  return { name, value };
34
34
  };
35
35
 
36
- option(data) {
36
+ static option(data) {
37
37
  return data;
38
38
  };
39
39
 
40
- create(name, description, options = { }) {
40
+ static create(name, description, options = { }) {
41
41
  let obj = { name, description };
42
42
  if (options?.options?.length) obj.options = options.options;
43
43
  if (options.type) obj.type = options.type;