@@ -355,7 +355,7 @@ export class Client {
355
355
this . _sessionInfo = sessionInfo ;
356
356
this . _sessionInfo . INSTANCE_ID = uuidv4 ( ) ;
357
357
this . _listeners = { } ;
358
- if ( this . _createConfig . stickerServerEndpoint !== false ) this . _createConfig . stickerServerEndpoint = true ;
358
+ // if(this._createConfig.stickerServerEndpoint!== false) this._createConfig.stickerServerEndpoint = true;
359
359
this . _setOnClose ( ) ;
360
360
}
361
361
@@ -3982,7 +3982,7 @@ public async getStatus(contactId: ContactId) : Promise<{
3982
3982
}
3983
3983
3984
3984
private async stickerServerRequest ( func : string , a : any = { } , fallback = false ) {
3985
- if ( ! this . _createConfig . stickerServerEndpoint ) return false ;
3985
+ const stickerUrl = this . _createConfig . stickerServerEndpoint || ( fallback ? pkg . stickerUrl : "https://sticker-api.openwa.dev" )
3986
3986
if ( func === 'convertMp4BufferToWebpDataUrl' ) fallback = true ;
3987
3987
const sessionInfo = this . getSessionInfo ( )
3988
3988
sessionInfo . WA_AUTOMATE_VERSION = sessionInfo . WA_AUTOMATE_VERSION . split ( ' ' ) [ 0 ]
@@ -4008,7 +4008,9 @@ public async getStatus(contactId: ContactId) : Promise<{
4008
4008
}
4009
4009
}
4010
4010
try {
4011
- const { data} = await axios . post ( `${ ( this . _createConfig ?. stickerServerEndpoint || ( fallback ? pkg . stickerUrl : 'https://sticker-api.openwa.dev' ) ) . replace ( / \/ $ / , '' ) } /${ func } ` , {
4011
+ const url = `${ stickerUrl . replace ( / \/ $ / , '' ) } /${ func } `
4012
+ log . info ( `Requesting sticker from ${ url } ` )
4013
+ const { data} = await axios . post ( url , {
4012
4014
...a ,
4013
4015
sessionInfo,
4014
4016
config : this . getConfig ( )
@@ -4038,13 +4040,15 @@ public async getStatus(contactId: ContactId) : Promise<{
4038
4040
console . error ( "Not an image. Please use convertMp4BufferToWebpDataUrl to process video stickers" ) ;
4039
4041
return false
4040
4042
}
4041
- if ( this . _createConfig . stickerServerEndpoint ) {
4043
+ // if(this._createConfig.stickerServerEndpoint) {
4042
4044
return await this . stickerServerRequest ( 'prepareWebp' , {
4043
4045
image,
4044
4046
stickerMetadata
4045
4047
} )
4046
- }
4047
-
4048
+ // } else {
4049
+ // log.error("config.stickerServerEndpoint is missing")
4050
+ // return false
4051
+ // }
4048
4052
}
4049
4053
4050
4054
/**
0 commit comments