Skip to content

Commit 5b7ee33

Browse files
authored
Merge pull request #248 from Secreto31126/show-yourself
Show yourself
2 parents 0eca172 + 6d5e394 commit 5b7ee33

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/emitters.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Response } from "undici";
1+
import type { Response } from "undici";
22
import type {
33
ClientMessage,
44
ClientMessageRequest,
@@ -9,6 +9,7 @@ import type {
99
ServerError,
1010
PostData
1111
} from "./types";
12+
import type WhatsAppAPI from "./index";
1213

1314
/**
1415
* Callback for "sent" event
@@ -95,6 +96,10 @@ export type OnMessageArgs = {
9596
response: ClientMessage,
9697
context: boolean
9798
) => Promise<ServerMessageResponse | Response>;
99+
/**
100+
* The WhatsAppAPI instance that emitted the event
101+
*/
102+
Whatsapp: WhatsAppAPI;
98103
};
99104

100105
/**

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,8 @@ export default class WhatsAppAPI {
785785
from,
786786
response,
787787
context ? message.id : undefined
788-
)
788+
),
789+
Whatsapp: this
789790
};
790791

791792
this.offload(this.on?.message, args);

0 commit comments

Comments
 (0)