Parameters
required
Attachment object
Returns
string
File extension (without dot) or empty stringDocumentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
getAttachmentExtension(attachment: Attachment): string
import { getAttachmentExtension } from '@photon-ai/imessage-kit/helpers'
const ext = getAttachmentExtension(attachment)
if (ext === 'jpg' || ext === 'png') {
console.log('Image file')
}
string
File extension (without dot) or empty stringWas this page helpful?