@discordanalytics/eris 2.8.0 → 2.8.2

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +53 -0
  2. package/package.json +6 -4
@@ -0,0 +1,53 @@
1
+ import { AnalyticsBase, AnalyticsOptions } from '@discordanalytics/core';
2
+ /**
3
+ * @class DiscordAnalytics
4
+ * @description The Eris class for the DiscordAnalytics library.
5
+ * @param {AnalyticsOptions} options - Configuration options.
6
+ * @property {any} options.client The Eris client to track events for.
7
+ * @property {string} options.api_key The API token for DiscordAnalytics.
8
+ * @property {boolean} options.debug Enable or not the debug mode /!\ MUST BE USED ONLY FOR DEVELOPMENT PURPOSES /!\
9
+ * @example
10
+ * const { default: DiscordAnalytics } = require('discord-analytics/eris');
11
+ * const Eris = require('eris');
12
+ * const client = new Client('YOUR_BOT_TOKEN', {
13
+ * intents: ['guilds']
14
+ * })
15
+ * client.on('ready', () => {
16
+ * const analytics = new DiscordAnalytics({
17
+ * client: client,
18
+ * api_key: 'YOUR_API_TOKEN'
19
+ * });
20
+ * analytics.init();
21
+ * analytics.trackEvents();
22
+ * });
23
+ * client.connect()
24
+ *
25
+ * @link https://discordanalytics.xyz/docs/main/get-started/installation/eris - Check docs for more informations about advanced usages
26
+ */
27
+ export default class DiscordAnalytics extends AnalyticsBase {
28
+ private readonly _client;
29
+ private _isReady;
30
+ constructor(options: Omit<AnalyticsOptions, 'sharded'>);
31
+ /**
32
+ * Initialize DiscordAnalytics on your bot
33
+ * /!\ Advanced users only
34
+ * /!\ Required to use DiscordAnalytics
35
+ * /!\ Must be used when the client is ready (recommended to use in ready event to prevent problems)
36
+ */
37
+ init(): Promise<void>;
38
+ /**
39
+ * Track interactions
40
+ * /!\ Advanced users only
41
+ * /!\ You need to initialize the class first
42
+ * @param interaction BaseInteraction class and its extensions only
43
+ * @param interactionNameResolver A function that will resolve the name of the interaction
44
+ */
45
+ trackInteractions(interaction: any, interactionNameResolver?: (interaction: any) => string): Promise<void>;
46
+ /**
47
+ * Let DiscordAnalytics declare the events necessary for its operation.
48
+ * /!\ Not recommended for big bots
49
+ * /!\ Not compatible with other functions
50
+ * @param interactionNameResolver A function that will resolve the name of the interaction
51
+ */
52
+ trackEvents(interactionNameResolver?: (interaction: any) => string): void;
53
+ }
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@discordanalytics/eris",
3
- "version": "2.8.0",
3
+ "version": "2.8.2",
4
4
  "description": "Eris package for working with Discord Analytics",
5
+ "files": [
6
+ "dist"
7
+ ],
5
8
  "main": "dist/index.js",
9
+ "types": "dist/index.d.ts",
6
10
  "author": "Discord Analytics",
7
11
  "homepage": "https://discordanalytics.xyz",
8
12
  "readme": "README.md",
@@ -14,9 +18,7 @@
14
18
  "url": "https://github.com/DiscordAnalytics/node-package/issues"
15
19
  },
16
20
  "dependencies": {
17
- "@types/node-fetch": "^2.6.13",
18
- "node-fetch": "^2.7.0",
19
- "@discordanalytics/core": "2.8.0"
21
+ "@discordanalytics/core": "2.8.2"
20
22
  },
21
23
  "devDependencies": {
22
24
  "eris": "^0.18.0",