mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix(master): linting warnings
This commit is contained in:
@@ -14,7 +14,7 @@ export const makeBusinessSocket = (config: SocketConfig) => {
|
||||
|
||||
const getCatalog = async({ jid, limit, cursor }: GetCatalogOptions) => {
|
||||
jid = jid || authState.creds.me?.id
|
||||
jid = jidNormalizedUser(jid!)
|
||||
jid = jidNormalizedUser(jid)
|
||||
|
||||
const queryParamNodes: BinaryNode[] = [
|
||||
{
|
||||
@@ -65,7 +65,7 @@ export const makeBusinessSocket = (config: SocketConfig) => {
|
||||
|
||||
const getCollections = async(jid?: string, limit = 51) => {
|
||||
jid = jid || authState.creds.me?.id
|
||||
jid = jidNormalizedUser(jid!)
|
||||
jid = jidNormalizedUser(jid)
|
||||
const result = await query({
|
||||
tag: 'iq',
|
||||
attrs: {
|
||||
|
||||
@@ -42,7 +42,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
|
||||
return key
|
||||
}
|
||||
|
||||
const fetchPrivacySettings = async(force: boolean = false) => {
|
||||
const fetchPrivacySettings = async(force = false) => {
|
||||
if(!privacySettings || force) {
|
||||
const { content } = await query({
|
||||
tag: 'iq',
|
||||
@@ -540,7 +540,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
|
||||
const sendPresenceUpdate = async(type: WAPresence, toJid?: string) => {
|
||||
const me = authState.creds.me!
|
||||
if(type === 'available' || type === 'unavailable') {
|
||||
if(!me!.name) {
|
||||
if(!me.name) {
|
||||
logger.warn('no name present, ignoring presence update request...')
|
||||
return
|
||||
}
|
||||
@@ -550,7 +550,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
|
||||
await sendNode({
|
||||
tag: 'presence',
|
||||
attrs: {
|
||||
name: me!.name,
|
||||
name: me.name,
|
||||
type
|
||||
}
|
||||
})
|
||||
@@ -558,7 +558,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
|
||||
await sendNode({
|
||||
tag: 'chatstate',
|
||||
attrs: {
|
||||
from: me!.id!,
|
||||
from: me.id,
|
||||
to: toJid!,
|
||||
},
|
||||
content: [
|
||||
@@ -840,7 +840,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
|
||||
|
||||
// update our pushname too
|
||||
if(msg.key.fromMe && msg.pushName && authState.creds.me?.name !== msg.pushName) {
|
||||
ev.emit('creds.update', { me: { ...authState.creds.me!, name: msg.pushName! } })
|
||||
ev.emit('creds.update', { me: { ...authState.creds.me!, name: msg.pushName } })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -165,8 +165,8 @@ export const makeGroupsSocket = (config: SocketConfig) => {
|
||||
}]
|
||||
)
|
||||
const node = getBinaryNodeChild(result, 'membership_requests_action')
|
||||
const nodeAction = getBinaryNodeChild(node!, action)
|
||||
const participantsAffected = getBinaryNodeChildren(nodeAction!, 'participant')
|
||||
const nodeAction = getBinaryNodeChild(node, action)
|
||||
const participantsAffected = getBinaryNodeChildren(nodeAction, 'participant')
|
||||
return participantsAffected.map(p => {
|
||||
return { status: p.attrs.error || '200', jid: p.attrs.jid }
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user