File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
- import { Response } from "undici" ;
1
+ import type { Response } from "undici" ;
2
2
import type {
3
3
ClientMessage ,
4
4
ClientMessageRequest ,
@@ -9,6 +9,7 @@ import type {
9
9
ServerError ,
10
10
PostData
11
11
} from "./types" ;
12
+ import type WhatsAppAPI from "./index" ;
12
13
13
14
/**
14
15
* Callback for "sent" event
@@ -95,6 +96,10 @@ export type OnMessageArgs = {
95
96
response : ClientMessage ,
96
97
context : boolean
97
98
) => Promise < ServerMessageResponse | Response > ;
99
+ /**
100
+ * The WhatsAppAPI instance that emitted the event
101
+ */
102
+ Whatsapp : WhatsAppAPI ;
98
103
} ;
99
104
100
105
/**
Original file line number Diff line number Diff line change @@ -785,7 +785,8 @@ export default class WhatsAppAPI {
785
785
from ,
786
786
response ,
787
787
context ? message . id : undefined
788
- )
788
+ ) ,
789
+ Whatsapp : this
789
790
} ;
790
791
791
792
this . offload ( this . on ?. message , args ) ;
You can’t perform that action at this time.
0 commit comments