Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jonalan7 committed Apr 6, 2023
1 parent f25bc41 commit 1ee567c
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"singleQuote": true,
"endOfLine": "auto",
"endOfLine": "crlf",
"useTabs": false,
"trailingComma": "none"
}
10 changes: 6 additions & 4 deletions src/api/layers/sender.layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ import { Message, SendFileResult, SendStickerResult } from '../model';
import { ChatState } from '../model/enum';
import { ListenerLayer } from './listener.layer';
import { Scope, checkValuesSender } from '../helpers/layers-interface';


let obj: Scope;

export class SenderLayer extends ListenerLayer {
Expand Down Expand Up @@ -111,7 +109,11 @@ export class SenderLayer extends ListenerLayer {
* @param to chat id: [email protected]
* @param content text message
*/
public async sendText(to: string, content: string, extra?: any): Promise<Object> {
public async sendText(
to: string,
content: string,
extra?: any
): Promise<Object> {
if (!extra) extra = {};
return new Promise(async (resolve, reject) => {
const typeFunction = 'sendText';
Expand Down Expand Up @@ -1031,7 +1033,7 @@ export class SenderLayer extends ListenerLayer {
public async setChatState(chatId: string, chatState: ChatState) {
return await this.page.evaluate(
({ chatState, chatId }) => {
return WAPI.sendChatstate(chatState, chatId);
return WAPI.sendChatstate(chatState, chatId);
},
{ chatState, chatId }
);
Expand Down
4 changes: 1 addition & 3 deletions src/controllers/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ export const getInterfaceStatus = async (
polling: 100
}
)
.then(async (element) => {

})
.then(async (element) => {})
.catch((e) => e);
};

Expand Down
6 changes: 5 additions & 1 deletion src/lib/wapi/functions/check-send-exist.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,11 @@ export function sendCheckType(chatId = undefined) {
);
}

if (Store.WidFactory && Store.WidFactory.isWidlike && !Store.WidFactory.isWidlike(chatId)) {
if (
Store.WidFactory &&
Store.WidFactory.isWidlike &&
!Store.WidFactory.isWidlike(chatId)
) {
return WAPI.scope(
chatId,
true,
Expand Down
27 changes: 15 additions & 12 deletions src/lib/wapi/functions/send-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,21 @@ export async function sendMessage(to, content, extra = {}) {
return WAPI.scope(to, true, 404, 'Error to newId');
}

const message = Object.assign({
id: newMsgId,
ack: 0,
body: content,
from: fromwWid,
to: chat.id,
local: !0,
self: 'out',
t: parseInt(new Date().getTime() / 1000),
isNewMsg: !0,
type: 'chat'
}, extra);
const message = Object.assign(
{
id: newMsgId,
ack: 0,
body: content,
from: fromwWid,
to: chat.id,
local: !0,
self: 'out',
t: parseInt(new Date().getTime() / 1000),
isNewMsg: !0,
type: 'chat'
},
extra
);

try {
var result = (
Expand Down
2 changes: 1 addition & 1 deletion src/lib/wapi/wapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ var loadParasite = async function () {
injectParasite();
return;
}
} catch (e) { }
} catch (e) {}
await sleep(1000);
}
};
Expand Down

0 comments on commit 1ee567c

Please sign in to comment.