Skip to content

Commit bbe0282

Browse files
Manuelpotb
Manuel
authored andcommitted
chore: inject child logger in modules
1 parent 7f8fd03 commit bbe0282

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/core/createModule.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { constantCase } from 'change-case';
22
import type { ClientEvents, ClientOptions } from 'discord.js';
3+
import type { Logger } from 'pino';
34
import type { ZodTypeAny } from 'zod';
45
import { z } from 'zod';
56

@@ -11,6 +12,7 @@ type InferredZodShape<Shape extends Record<string, ZodTypeAny>> = {
1112

1213
interface Context<Env extends Record<string, ZodTypeAny>> {
1314
env: InferredZodShape<Env>;
15+
logger: Logger;
1416
}
1517

1618
type ModuleFunction<Env extends Record<string, ZodTypeAny>, ReturnType> = (
@@ -31,6 +33,7 @@ type BotModule<Env extends Record<string, ZodTypeAny>> = {
3133

3234
interface CreatedModuleInput {
3335
env: unknown;
36+
logger: Logger;
3437
}
3538

3639
type ModuleFactory = (input: CreatedModuleInput) => Promise<CreatedModule>;

0 commit comments

Comments
 (0)