mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
chore: lint files
This commit is contained in:
@@ -136,7 +136,7 @@ export const delayCancellable = (ms: number) => {
|
||||
return { delay, cancel }
|
||||
}
|
||||
|
||||
export async function promiseTimeout<T>(ms: number | undefined, promise: (resolve: (v?: T)=>void, reject: (error) => void) => void) {
|
||||
export async function promiseTimeout<T>(ms: number | undefined, promise: (resolve: (v?: T) => void, reject: (error) => void) => void) {
|
||||
if(!ms) {
|
||||
return new Promise (promise)
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ const extractVideoThumb = async(
|
||||
path: string,
|
||||
destPath: string,
|
||||
time: string,
|
||||
size: { width: number; height: number },
|
||||
size: { width: number, height: number },
|
||||
) => new Promise((resolve, reject) => {
|
||||
const cmd = `ffmpeg -ss ${time} -i ${path} -y -vf scale=${size.width}:-1 -vframes 1 -f image2 ${destPath}`
|
||||
exec(cmd, (err) => {
|
||||
@@ -243,7 +243,7 @@ export async function generateThumbnail(
|
||||
}
|
||||
) {
|
||||
let thumbnail: string | undefined
|
||||
let originalImageDimensions: { width: number; height: number } | undefined
|
||||
let originalImageDimensions: { width: number, height: number } | undefined
|
||||
if(mediaType === 'image') {
|
||||
const { buffer, original } = await extractImageThumb(file)
|
||||
thumbnail = buffer.toString('base64')
|
||||
|
||||
@@ -627,7 +627,7 @@ export const normalizeMessageContent = (content: WAMessageContent | null | undef
|
||||
|| message?.editedMessage
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract the true message content from a message
|
||||
@@ -833,9 +833,9 @@ export const assertMediaContent = (content: proto.IMessage | null | undefined) =
|
||||
*/
|
||||
export const getPollUpdateMessage = async(
|
||||
msg: WAProto.IWebMessageInfo,
|
||||
pollCreationData: { encKey: Uint8Array; sender: string; options: string[]; },
|
||||
pollCreationData: { encKey: Uint8Array, sender: string, options: string[] },
|
||||
withSelectedOptions: boolean = false,
|
||||
): Promise<{ hash: string[] } | { hash: string[]; selectedOptions: string[] }> => {
|
||||
): Promise<{ hash: string[] } | { hash: string[], selectedOptions: string[] }> => {
|
||||
if(!msg.message?.pollUpdateMessage || !pollCreationData?.encKey) {
|
||||
throw new Boom('Missing pollUpdateMessage, or encKey', { statusCode: 400 })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user