discordthing 0.2.1 → 0.2.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.
package/build/bot.d.ts CHANGED
@@ -11,6 +11,7 @@ export type BotOptions = {
11
11
  commands?: Command<string, SlashCommandBuilder>[];
12
12
  listeners?: Listener<any>[];
13
13
  logger?: ILogger;
14
+ verbose?: boolean;
14
15
  };
15
16
  export declare class Bot {
16
17
  readonly client: Client<boolean>;
package/build/bot.js CHANGED
@@ -33,9 +33,14 @@ export class Bot {
33
33
  ...this.plugins.flatMap((plugin) => plugin.listeners)
34
34
  ]
35
35
  });
36
- this.client.on(Events.Debug, (message) => {
37
- this.logger.debug(message);
38
- });
36
+ if (options.verbose) {
37
+ const clientLogger = "getSubLogger" in this.logger && this.logger.getSubLogger
38
+ ? this.logger.getSubLogger({ name: "client" })
39
+ : this.logger;
40
+ this.client.on(Events.Debug, (message) => {
41
+ clientLogger.debug(message);
42
+ });
43
+ }
39
44
  this.client.on(Events.ClientReady, this.onReady.bind(this));
40
45
  }
41
46
  /**
package/build/logger.d.ts CHANGED
@@ -5,4 +5,7 @@ export interface ILogger {
5
5
  warn(...args: unknown[]): any;
6
6
  error(...args: unknown[]): any;
7
7
  fatal(...args: unknown[]): any;
8
+ getSubLogger?: (settings: {
9
+ name?: string;
10
+ }) => ILogger;
8
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "discordthing",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "A lightweight framework for building discord bots built on-top of discord.js",
5
5
  "type": "module",
6
6
  "main": "./build/index.js",