mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Update getDevice (#569)
Co-authored-by: Bob <115008575+bobpetrov@users.noreply.github.com>
This commit is contained in:
@@ -738,7 +738,7 @@ export const extractMessageContent = (content: WAMessageContent | undefined | nu
|
||||
/**
|
||||
* Returns the device predicted by message ID
|
||||
*/
|
||||
export const getDevice = (id: string) => /^3A/.test(id) ? 'ios' : /^3E/.test(id) ? 'web' : /^.{21}/.test(id) ? 'android' : /^.{18}/.test(id) ? 'desktop' : 'unknown'
|
||||
export const getDevice = (id: string) => /^3A.{18}$/.test(id) ? 'ios' : /^3E.{20}$/.test(id) ? 'web' : /^(.{21}|.{32})$/.test(id) ? 'android' : /^.{18}$/.test(id) ? 'desktop' : 'unknown'
|
||||
|
||||
/** Upserts a receipt in the message */
|
||||
export const updateMessageWithReceipt = (msg: Pick<WAMessage, 'userReceipt'>, receipt: MessageUserReceipt) => {
|
||||
|
||||
Reference in New Issue
Block a user