gamerbot-module 2.0.0 → 2.1.1

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.
@@ -7,6 +7,7 @@ export declare class GuildData {
7
7
  noXpChannels: Array<string>;
8
8
  frames: Array<frameData>;
9
9
  extraObjects: Map<string, object>;
10
+ hashedEmails: Array<string>;
10
11
  jsonData: any;
11
12
  constructor(jsonData: any);
12
13
  /**
@@ -10,6 +10,7 @@ export class GuildData {
10
10
  this.topics = jsonData.topics;
11
11
  this.noXpChannels = jsonData.noXpChannels;
12
12
  this.frames = jsonData.frames;
13
+ this.hashedEmails = jsonData.hashedEmails;
13
14
  this.extraObjects = new Map(Object.entries(jsonData.extraObjects));
14
15
  }
15
16
  /**
@@ -0,0 +1,6 @@
1
+ export declare class MinecraftData {
2
+ uuid: string;
3
+ name: string;
4
+ discordId: string;
5
+ constructor(jsonData: any);
6
+ }
@@ -0,0 +1,8 @@
1
+ export class MinecraftData {
2
+ // eslint-disable-next-line
3
+ constructor(jsonData) {
4
+ this.uuid = jsonData.uuid;
5
+ this.name = jsonData.name;
6
+ this.discordId = jsonData.discordId;
7
+ }
8
+ }
@@ -1,5 +1,6 @@
1
1
  import { ConfigData } from "./ConfigData.js";
2
2
  import { GuildData } from "./GuildData.js";
3
+ import { MinecraftData } from "./MinecraftData.js";
3
4
  import { UserData } from "./UserData.js";
4
5
  export declare class Models {
5
6
  cachedUsersFrames: Map<string, UserFrameData>;
@@ -39,6 +40,10 @@ export declare class Models {
39
40
  * Gets frame image
40
41
  */
41
42
  getFrame(frameId: string): Promise<Buffer<ArrayBuffer>>;
43
+ /**
44
+ * Get all Minecraft users linked to Discord accounts
45
+ */
46
+ getAllMinecraftUsers(): Promise<MinecraftData[]>;
42
47
  private fetchData;
43
48
  }
44
49
  interface FrameConfigElement {
@@ -110,6 +110,13 @@ export class Models {
110
110
  const data = (await this.fetchData(GamerBotAPI.API_URL + "/public_api/frame/" + frameId, "GET", null, false));
111
111
  return Buffer.from(await data.arrayBuffer());
112
112
  }
113
+ /**
114
+ * Get all Minecraft users linked to Discord accounts
115
+ */
116
+ async getAllMinecraftUsers() {
117
+ const data = await this.fetchData(GamerBotAPI.API_URL + "/api/user/minecraft/data/", "GET");
118
+ return data;
119
+ }
113
120
  fetchData(url, method = "GET",
114
121
  // eslint-disable-next-line
115
122
  jsonData = null, convertToJson = true) {
package/dist/index.d.ts CHANGED
@@ -4,3 +4,4 @@ export { GuildData } from "./classes/GuildData.js";
4
4
  export { ConfigData } from "./classes/ConfigData.js";
5
5
  export { Models } from "./classes/models.js";
6
6
  export { Level } from "./classes/ConfigData.js";
7
+ export { MinecraftData } from "./classes/MinecraftData.js";
package/dist/index.js CHANGED
@@ -3,3 +3,4 @@ export { UserData } from "./classes/UserData.js";
3
3
  export { GuildData } from "./classes/GuildData.js";
4
4
  export { ConfigData } from "./classes/ConfigData.js";
5
5
  export { Models } from "./classes/models.js";
6
+ export { MinecraftData } from "./classes/MinecraftData.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gamerbot-module",
3
- "version": "2.0.0",
3
+ "version": "2.1.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",