Attachments

class fbchat.Attachment(*, id=None)[source]

Represents a Facebook attachment.

id

The attachment ID

class fbchat.ShareAttachment(*, id=None, author=None, url=None, original_url=None, title=None, description=None, source=None, image=None, original_image_url=None, attachments=NOTHING)[source]

Represents a shared item (e.g. URL) attachment.

author

ID of the author of the shared post

url

Target URL

original_url

Original URL if Facebook redirects the URL

title

Title of the attachment

description

Description of the attachment

source

Name of the source

image

The attached image

original_image_url

URL of the original image if Facebook uses safe_image

attachments

List of additional attachments

class fbchat.Sticker(*, id=None, pack=None, is_animated=False, medium_sprite_image=None, large_sprite_image=None, frames_per_row=None, frames_per_col=None, frame_count=None, frame_rate=None, image=None, label=None)[source]

Represents a Facebook sticker that has been sent to a thread as an attachment.

pack

The sticker-pack’s ID

is_animated

Whether the sticker is animated

medium_sprite_image

URL to a medium spritemap

large_sprite_image

URL to a large spritemap

frames_per_row

The amount of frames present in the spritemap pr. row

frames_per_col

The amount of frames present in the spritemap pr. column

frame_count

The total amount of frames in the spritemap

frame_rate

The frame rate the spritemap is intended to be played in

image

The sticker’s image

label

The sticker’s label/name

class fbchat.LocationAttachment(*, id=None, latitude=None, longitude=None, image=None, url=None, address=None)[source]

Represents a user location.

Latitude and longitude OR address is provided by Facebook.

latitude

Latitude of the location

longitude

Longitude of the location

image

Image showing the map of the location

url

URL to Bing maps with the location

class fbchat.LiveLocationAttachment(*, id=None, latitude=None, longitude=None, image=None, url=None, address=None, name=None, expires_at=None, is_expired=None)[source]

Represents a live user location.

name

Name of the location

expires_at

When live location expires

is_expired

True if live location is expired

class fbchat.FileAttachment(*, id=None, url=None, size=None, name=None, is_malicious=None)[source]

Represents a file that has been sent as a Facebook attachment.

url

URL where you can download the file

size

Size of the file in bytes

name

Name of the file

is_malicious

Whether Facebook determines that this file may be harmful

class fbchat.AudioAttachment(*, id=None, filename=None, url=None, duration=None, audio_type=None)[source]

Represents an audio file that has been sent as a Facebook attachment.

filename

Name of the file

url

URL of the audio file

duration

Duration of the audio clip

audio_type

Audio type

class fbchat.ImageAttachment(*, id=None, original_extension=None, width=None, height=None, is_animated=None, previews=NOTHING)[source]

Represents an image that has been sent as a Facebook attachment.

To retrieve the full image URL, use: Client.fetch_image_url, and pass it the id of the image attachment.

original_extension

The extension of the original image (e.g. png)

width

Width of original image

height

Height of original image

is_animated

Whether the image is animated

previews

A set, containing variously sized / various types of previews of the image

class fbchat.VideoAttachment(*, id=None, size=None, width=None, height=None, duration=None, preview_url=None, previews=NOTHING)[source]

Represents a video that has been sent as a Facebook attachment.

size

Size of the original video in bytes

width

Width of original video

height

Height of original video

duration

Length of video

preview_url

URL to very compressed preview video

previews

A set, containing variously sized previews of the video

class fbchat.ImageAttachment(*, id=None, original_extension=None, width=None, height=None, is_animated=None, previews=NOTHING)[source]

Represents an image that has been sent as a Facebook attachment.

To retrieve the full image URL, use: Client.fetch_image_url, and pass it the id of the image attachment.

original_extension

The extension of the original image (e.g. png)

width

Width of original image

height

Height of original image

is_animated

Whether the image is animated

previews

A set, containing variously sized / various types of previews of the image