linebot.models package¶
linebot.models.actions module¶
linebot.models.actions module.
- class linebot.models.actions.PostbackAction(label=None, data=None, display_text=None, text=None, input_option=None, fill_in_text=None, **kwargs)[source]¶
Bases:
Action
PostbackAction.
https://developers.line.me/en/docs/messaging-api/reference/#postback-action
When a control associated with this action is tapped, a postback event is returned via webhook with the specified string in the data property.
- __init__(label=None, data=None, display_text=None, text=None, input_option=None, fill_in_text=None, **kwargs)[source]¶
__init__ method.
- Parameters
label (str) – Label for the action.
data (str) – String returned via webhook in the postback.data property of the postback event.
display_text (str) – Text displayed in the chat as a message sent by the user when the action is performed.
text (str) – Deprecated. Text displayed in the chat as a message sent by the user when the action is performed. Returned from the server through a webhook.
kwargs –
- class linebot.models.actions.MessageAction(label=None, text=None, **kwargs)[source]¶
Bases:
Action
MessageAction.
https://developers.line.me/en/docs/messaging-api/reference/#message-action
When a control associated with this action is tapped, the string in the text property is sent as a message from the user.
- class linebot.models.actions.URIAction(label=None, uri=None, alt_uri=None, **kwargs)[source]¶
Bases:
Action
URIAction.
https://developers.line.me/en/docs/messaging-api/reference/#uri-action
When a control associated with this action is tapped, the URI specified in the uri property is opened.
- __init__(label=None, uri=None, alt_uri=None, **kwargs)[source]¶
__init__ method.
- Parameters
label (str) – Label for the action Max: 20 characters
uri (str) – URI opened when the action is performed.
alt_uri (T <=
linebot.models.actions.AltUri
) – URI opened when the desktop app.kwargs –
- class linebot.models.actions.AltUri(desktop=None, **kwargs)[source]¶
Bases:
Base
AltUri.
https://github.com/line/line-bot-sdk-python/issues/155
URI opened when the desktop app.
- class linebot.models.actions.DatetimePickerAction(label=None, data=None, mode=None, initial=None, max=None, min=None, **kwargs)[source]¶
Bases:
Action
DatetimePickerAction.
https://developers.line.me/en/docs/messaging-api/reference/#datetime-picker-action
When a control associated with this action is tapped, a postback event is returned via webhook with the date and time selected by the user from the date and time selection dialog. The datetime picker action does not support time zones.
- __init__(label=None, data=None, mode=None, initial=None, max=None, min=None, **kwargs)[source]¶
__init__ method.
- Parameters
label (str) – Label for the action
data (str) – String returned via webhook in the postback.data property of the postback event
mode (str) – Action mode date: Pick date time: Pick time datetime: Pick date and time
initial (str) – Initial value of date or time
max (str) – Largest date or time value that can be selected. Must be greater than the min value.
min (str) – Smallest date or time value that can be selected. Must be less than the max value.
kwargs –
- class linebot.models.actions.CameraAction(label=None, **kwargs)[source]¶
Bases:
Action
CameraAction.
https://developers.line.me/en/reference/messaging-api/#camera-action
This action can be configured only with quick reply buttons. When a button associated with this action is tapped, the camera screen in the LINE app is opened.
- class linebot.models.actions.CameraRollAction(label=None, **kwargs)[source]¶
Bases:
Action
CameraRollAction.
https://developers.line.me/en/reference/messaging-api/#camera-roll-action
This action can be configured only with quick reply buttons. When a button associated with this action is tapped, the camera roll screen in the LINE app is opened.
- class linebot.models.actions.LocationAction(label=None, **kwargs)[source]¶
Bases:
Action
LocationRollAction.
https://developers.line.me/en/reference/messaging-api/#location-action
This action can be configured only with quick reply buttons. When a button associated with this action is tapped, the location screen in the LINE app is opened.
- class linebot.models.actions.RichMenuSwitchAction(label=None, rich_menu_alias_id=None, data=None, **kwargs)[source]¶
Bases:
Action
RichMenuSwitchAction.
https://developers.line.biz/en/reference/messaging-api/#richmenu-switch-action
This action can be configured only with rich menus. It can’t be used for Flex Messages or quick replies. When you tap a rich menu associated with this action, you can switch between rich menus, and a postback event including the rich menu alias ID selected
by the user is returned via a webhook.
- __init__(label=None, rich_menu_alias_id=None, data=None, **kwargs)[source]¶
__init__ method.
- Parameters
label (str) – Label for the action
rich_menu_alias_id (str) – Rich menu alias ID to switch to.
data (str) – String returned by the postback.data property of the postback event via a webhook
kwargs –
linebot.models.base module¶
linebot.models.base module.
- class linebot.models.base.Base(**kwargs)[source]¶
Bases:
object
Base class of model.
Suitable for JSON base data.
- classmethod new_from_json_dict(data, use_raw_message=False)[source]¶
Create a new instance from a dict.
- Parameters
data – JSON dict
use_raw_message (bool) – Using original Message key as attribute
- static get_or_new_from_json_dict(data, cls)[source]¶
Get cls object w/ deserialization from json if needed.
If data is instance of cls, return data. Else if data is instance of dict, create instance from dict. Else, return None.
- Parameters
data –
cls –
- Return type
object
- static get_or_new_from_json_dict_with_types(data, cls_map, type_key='type', use_raw_message=False)[source]¶
Get cls object w/ deserialization from json by using type key hint if needed.
If data is instance of one of cls, return data. Else if data is instance of dict, create instance from dict. Else, return None.
- Parameters
data –
cls_map –
type_key –
use_raw_message (bool) – Using original Message key as attribute
- Return type
object
linebot.models.error module¶
linebot.models.error module.
- class linebot.models.error.Error(message=None, details=None, **kwargs)[source]¶
Bases:
Base
Error response of LINE messaging API.
https://developers.line.biz/en/reference/messaging-api/#error-response
- __init__(message=None, details=None, **kwargs)[source]¶
__init__ method.
- Parameters
message (str) – Summary of the error
details (list[T <=
linebot.models.error.ErrorDetail
]) – ErrorDetail instance listkwargs –
linebot.models.events module¶
linebot.models.events module.
- class linebot.models.events.Event(*args, **kwargs)[source]¶
Bases:
Base
Abstract Base Class of Webhook Event.
https://developers.line.biz/en/reference/messaging-api/#webhook-event-objects
- __init__(mode=None, timestamp=None, source=None, webhook_event_id=None, delivery_context=None, **kwargs)[source]¶
__init__ method.
- Parameters
mode (str) – Channel state
timestamp (long) – Time of the event in milliseconds
source (T <=
linebot.models.sources.Source
) – Source objectkwargs –
- class linebot.models.events.MessageEvent(*args, **kwargs)[source]¶
Bases:
Event
Webhook MessageEvent.
https://developers.line.biz/en/reference/messaging-api/#message-event
Event object which contains the sent message. The message field contains a message object which corresponds with the message type. You can reply to message events.
- __init__(mode=None, timestamp=None, source=None, reply_token=None, message=None, use_raw_message=False, **kwargs)[source]¶
__init__ method.
- Parameters
mode (str) – Channel state
timestamp (long) – Time of the event in milliseconds
source (T <=
linebot.models.sources.Source
) – Source objectreply_token (str) – Reply token
message (T <=
linebot.models.messages.Message
) – Message objectuse_raw_message (bool) – Using original Message key as attribute
kwargs –
- class linebot.models.events.FollowEvent(*args, **kwargs)[source]¶
Bases:
Event
Webhook FollowEvent.
https://developers.line.biz/en/reference/messaging-api/#follow-event
Event object for when your account is added as a friend (or unblocked). You can reply to follow events.
- __init__(mode=None, timestamp=None, source=None, reply_token=None, **kwargs)[source]¶
__init__ method.
- Parameters
mode (str) – Channel state
timestamp (long) – Time of the event in milliseconds
source (T <=
linebot.models.sources.Source
) – Source objectreply_token (str) – Reply token
kwargs –
- class linebot.models.events.UnfollowEvent(*args, **kwargs)[source]¶
Bases:
Event
Webhook UnfollowEvent.
https://developers.line.biz/en/reference/messaging-api/#unfollow-event
Event object for when your account is blocked.
- __init__(mode=None, timestamp=None, source=None, **kwargs)[source]¶
__init__ method.
- Parameters
mode (str) – Channel state
timestamp (long) – Time of the event in milliseconds
source (T <=
linebot.models.sources.Source
) – Source objectkwargs –
- class linebot.models.events.JoinEvent(*args, **kwargs)[source]¶
Bases:
Event
Webhook JoinEvent.
https://developers.line.biz/en/reference/messaging-api/#join-event
Event object for when your account joins a group or talk room. You can reply to join events.
- __init__(mode=None, timestamp=None, source=None, reply_token=None, **kwargs)[source]¶
__init__ method.
- Parameters
mode (str) – Channel state
timestamp (long) – Time of the event in milliseconds
source (T <=
linebot.models.sources.Source
) – Source objectreply_token (str) – Reply token
kwargs –
- class linebot.models.events.LeaveEvent(*args, **kwargs)[source]¶
Bases:
Event
Webhook LeaveEvent.
https://developers.line.biz/en/reference/messaging-api/#leave-event
Event object for when your account leaves a group.
- __init__(mode=None, timestamp=None, source=None, **kwargs)[source]¶
__init__ method.
- Parameters
mode (str) – Channel state
timestamp (long) – Time of the event in milliseconds
source (T <=
linebot.models.sources.Source
) – Source objectkwargs –
- class linebot.models.events.PostbackEvent(*args, **kwargs)[source]¶
Bases:
Event
Webhook PostbackEvent.
https://developers.line.biz/en/reference/messaging-api/#postback-event
Event object for when a user performs an action on a template message which initiates a postback. You can reply to postback events.
- __init__(mode=None, timestamp=None, source=None, reply_token=None, postback=None, **kwargs)[source]¶
__init__ method.
- Parameters
mode (str) – Channel state
timestamp (long) – Time of the event in milliseconds
source (T <=
linebot.models.sources.Source
) – Source objectreply_token (str) – Reply token
postback (
linebot.models.events.Postback
) – Postback objectkwargs –
- class linebot.models.events.BeaconEvent(*args, **kwargs)[source]¶
Bases:
Event
Webhook BeaconEvent.
https://developers.line.biz/en/reference/messaging-api/#beacon-event
Event object for when a user detects a LINE Beacon. You can reply to beacon events.
- __init__(mode=None, timestamp=None, source=None, reply_token=None, beacon=None, **kwargs)[source]¶
__init__ method.
- Parameters
mode (str) – Channel state
timestamp (long) – Time of the event in milliseconds
source (T <=
linebot.models.sources.Source
) – Source objectreply_token (str) – Reply token
beacon (
linebot.models.events.Beacon
) – Beacon objectkwargs –
- class linebot.models.events.MemberJoinedEvent(*args, **kwargs)[source]¶
Bases:
Event
Webhook MemberJoinedEvent.
https://developers.line.biz/en/reference/messaging-api/#member-joined-event
Event object for when a user joins a group or room that the bot is in.
- __init__(mode=None, timestamp=None, source=None, reply_token=None, joined=None, **kwargs)[source]¶
__init__ method.
- Parameters
mode (str) – Channel state
timestamp (long) – Time of the event in milliseconds
source (T <=
linebot.models.sources.Source
) – Source objectreply_token (str) – Reply token
joined (
linebot.models.events.Joined
) – Joined objectkwargs –
- class linebot.models.events.MemberLeftEvent(*args, **kwargs)[source]¶
Bases:
Event
Webhook MemberLeftEvent.
https://developers.line.biz/en/reference/messaging-api/#member-left-event
Event object for when a user leaves a group or room that the bot is in.
- __init__(mode=None, timestamp=None, source=None, left=None, **kwargs)[source]¶
__init__ method.
- Parameters
mode (str) – Channel state
timestamp (long) – Time of the event in milliseconds
source (T <=
linebot.models.sources.Source
) – Source objectleft (
linebot.models.events.Left
) – Left objectkwargs –
- class linebot.models.events.AccountLinkEvent(*args, **kwargs)[source]¶
Bases:
Event
Webhook AccountLinkEvent.
https://developers.line.me/en/docs/messaging-api/reference/#account-link-event
Event object for when a user has linked his/her LINE account with a provider’s service account. You can reply to account link events. If the link token has expired or has already been used, no webhook event will be sent and the user will be shown an error.
- __init__(mode=None, timestamp=None, source=None, reply_token=None, link=None, **kwargs)[source]¶
__init__ method.
- Parameters
mode (str) – Channel state
timestamp (long) – Time of the event in milliseconds
source (T <=
linebot.models.sources.Source
) – Source objectreply_token (str) – Reply token
link (
linebot.models.events.Link
) – Link objectkwargs –
- class linebot.models.events.ThingsEvent(*args, **kwargs)[source]¶
Bases:
Event
Webhook ThingsEvent.
https://developers.line.biz/en/reference/messaging-api/#device-link-event https://developers.line.biz/en/reference/messaging-api/#device-unlink-event https://developers.line.biz/en/reference/messaging-api/#scenario-result-event
Event sent from LINE Things Webhook service.
- __init__(mode=None, timestamp=None, source=None, reply_token=None, things=None, **kwargs)[source]¶
__init__ method.
- Parameters
mode (str) – Channel state
timestamp (long) – Time of the event in milliseconds
source (T <=
linebot.models.sources.Source
) – Source objectreply_token (str) – Reply token
things (T <=
linebot.models.things.Things
) – Things objectkwargs –
- class linebot.models.events.UnsendEvent(*args, **kwargs)[source]¶
Bases:
Event
Webhook UnsendEvent.
https://developers.line.biz/en/reference/messaging-api/#unsend-event
Event object for when the user unsends a message in a group or room.
- __init__(mode=None, timestamp=None, source=None, unsend=None, **kwargs)[source]¶
__init__ method.
- Parameters
mode (str) – Channel state
timestamp (long) – Time of the event in milliseconds
source (T <=
linebot.models.sources.Source
) – Source objectunsend (T <=
linebot.models.unsend.Unsend
) – Unsend objectkwargs –
- class linebot.models.events.VideoPlayCompleteEvent(*args, **kwargs)[source]¶
Bases:
Event
Webhook VideoCompleteEvent.
https://developers.line.biz/en/reference/messaging-api/#video-viewing-complete
Event object Event for when a user finishes viewing a video at least once.
- __init__(mode=None, timestamp=None, source=None, reply_token=None, video_play_complete=None, **kwargs)[source]¶
__init__ method.
- Parameters
mode (str) – Channel state
timestamp (long) – Time of the event in milliseconds
source (T <=
linebot.models.sources.Source
) – Source objectreply_token (str) – Reply token
video_play_complete (T <=
linebot.models.video_play_complete.VideoPlayComplete
) – VideoPlayComplete objectkwargs –
- class linebot.models.events.UnknownEvent(*args, **kwargs)[source]¶
Bases:
Event
Unknown event.
We welcome your contribution to line-bot-sdk-python!
- class linebot.models.events.Postback(*args, **kwargs)[source]¶
Bases:
Base
Postback.
https://developers.line.biz/en/reference/messaging-api/#postback-event
- class linebot.models.events.Beacon(*args, **kwargs)[source]¶
Bases:
Base
Beacon.
https://developers.line.biz/en/reference/messaging-api/#beacon-event
- __init__(type=None, hwid=None, dm=None, **kwargs)[source]¶
__init__ method.
- Parameters
type (str) – Type of beacon event
hwid (str) – Hardware ID of the beacon that was detected
dm (str) – Optional. Device message of beacon which is hex string
kwargs –
- property device_message¶
Get dm(device_message) as bytearray.
- Return type
bytearray
- class linebot.models.events.Joined(*args, **kwargs)[source]¶
Bases:
Base
Joined.
https://developers.line.biz/en/reference/messaging-api/#member-joined-event
- __init__(members=None, **kwargs)[source]¶
__init__ method.
- Parameters
members (dict) – Member of users who joined
kwargs –
- property members¶
Get members as list of SourceUser.
- class linebot.models.events.Left(*args, **kwargs)[source]¶
Bases:
Base
Left.
https://developers.line.biz/en/reference/messaging-api/#member-left-event
- __init__(members=None, **kwargs)[source]¶
__init__ method.
- Parameters
members (dict) – Member of users who joined
kwargs –
- property members¶
Get members as list of SourceUser.
- class linebot.models.events.Link(*args, **kwargs)[source]¶
Bases:
Base
Link.
https://developers.line.me/en/docs/messaging-api/reference/#link-object
linebot.models.filter module¶
linebot.models.filter module.
- class linebot.models.filter.Filter(demographic=None, **kwargs)[source]¶
Bases:
Base
Filter.
https://developers.line.biz/en/reference/messaging-api/#narrowcast-demographic-filter
A filter is the top-level structure of a demographic element.
- class linebot.models.filter.DemographicFilter(**kwargs)[source]¶
Bases:
Filter
DemographicFilter.
https://developers.line.biz/en/reference/messaging-api/#narrowcast-demographic-filter
Demographic filter objects represent criteria (e.g. age, gender, OS, region, and friendship duration) on which to filter the list of recipients. You can filter recipients based on a combination of different criteria using logical operator objects.
- class linebot.models.filter.GenderFilter(one_of=None, **kwargs)[source]¶
Bases:
DemographicFilter
GenderFilter.
- class linebot.models.filter.AppTypeFilter(one_of=None, **kwargs)[source]¶
Bases:
DemographicFilter
AppTypeFilter.
- class linebot.models.filter.AreaFilter(one_of=None, **kwargs)[source]¶
Bases:
DemographicFilter
AreaFilter.
- class linebot.models.filter.AgeFilter(gte=None, lt=None, **kwargs)[source]¶
Bases:
DemographicFilter
AgeFilter.
This lets you filter recipients with a given age range.
- __init__(gte=None, lt=None, **kwargs)[source]¶
__init__ method.
Be sure to specify either gte, lt, or both.
- Parameters
gte (str) – Send messages to users at least as old as the specified age.
lt (str) – Send messages to users younger than the specified age. You can specify the same values as for the gte property.
- class linebot.models.filter.SubscriptionPeriodFilter(gte=None, lt=None, **kwargs)[source]¶
Bases:
DemographicFilter
SubscriptionPeriodFilter.
This lets you filter recipients with a given range of friendship durations.
- __init__(gte=None, lt=None, **kwargs)[source]¶
__init__ method.
Be sure to specify either gte, lt, or both.
- Parameters
gte (str) – Send messages to users who have been friends of yours for at least the specified number of days
lt (str) – Send messages to users who have been friends of yours for less than the specified number of days. You can specify the same values as for the gte property.
linebot.models.flex_message module¶
linebot.models.flex_message module.
- class linebot.models.flex_message.FlexSendMessage(alt_text=None, contents=None, **kwargs)[source]¶
Bases:
SendMessage
FlexSendMessage.
https://developers.line.biz/en/reference/messaging-api/#flex-message
Flex Messages are messages with a customizable layout. You can customize the layout freely by combining multiple elements.
- __init__(alt_text=None, contents=None, **kwargs)[source]¶
__init__ method.
- Parameters
alt_text (str) – Alternative text
contents (
linebot.models.flex_message.FlexContainer
) – Flex Message container objectkwargs –
- class linebot.models.flex_message.FlexContainer(**kwargs)[source]¶
Bases:
Base
FlexContainer.
https://developers.line.biz/en/reference/messaging-api/#container
A container is the top-level structure of a Flex Message.
- class linebot.models.flex_message.BubbleContainer(size=None, direction=None, header=None, hero=None, body=None, footer=None, styles=None, action=None, **kwargs)[source]¶
Bases:
FlexContainer
BubbleContainer.
https://developers.line.biz/en/reference/messaging-api/#bubble
This is a container that contains one message bubble. It can contain four blocks: header, hero, body, and footer.
- __init__(size=None, direction=None, header=None, hero=None, body=None, footer=None, styles=None, action=None, **kwargs)[source]¶
__init__ method.
- Parameters
size (str) – The size of the bubble. nano, micro, kilo, mega, or giga.
direction (str) – Text directionality and the order of components in horizontal boxes in the container
header (
linebot.models.flex_message.BoxComponent
) – Header blockhero (
linebot.models.flex_message.ImageComponent
|linebot.models.flex_message.BoxComponent
|linebot.models.flex_message.VideoComponent
) – Hero blockbody (
linebot.models.flex_message.BoxComponent
) – Body blockfooter (
linebot.models.flex_message.BoxComponent
) – Footer blockstyles (
linebot.models.flex_message.BubbleStyle
) – Style of each blockaction (list[T <=
linebot.models.actions.Action
]) – Action performed when this button is tappedkwargs –
- class linebot.models.flex_message.BubbleStyle(header=None, hero=None, body=None, footer=None, **kwargs)[source]¶
Bases:
Base
BubbleStyle.
https://developers.line.biz/en/reference/messaging-api/#bubble-style
- __init__(header=None, hero=None, body=None, footer=None, **kwargs)[source]¶
__init__ method.
- Parameters
header (
linebot.models.flex_message.BlockStyle
) – Style of the header blockhero (
linebot.models.flex_message.BlockStyle
) – Style of the hero blockbody (
linebot.models.flex_message.BlockStyle
) – Style of the body blockfooter (
linebot.models.flex_message.BlockStyle
) – Style of the footer blockkwargs –
- class linebot.models.flex_message.BlockStyle(background_color=None, separator=None, separator_color=None, **kwargs)[source]¶
Bases:
Base
BlockStyle.
https://developers.line.biz/en/reference/messaging-api/#block-style
- __init__(background_color=None, separator=None, separator_color=None, **kwargs)[source]¶
__init__ method.
- Parameters
background_color (str) – Background color of the block. Use a hexadecimal color code
separator (bool) – True to place a separator above the block True will be ignored for the first block in a container because you cannot place a separator above the first block. The default value is False
separator_color (str) – Color of the separator. Use a hexadecimal color code
kwargs –
- class linebot.models.flex_message.CarouselContainer(contents=None, **kwargs)[source]¶
Bases:
FlexContainer
CarouselContainer.
https://developers.line.biz/en/reference/messaging-api/#f-carousel
This is a container that contains multiple bubble containers, or message bubbles. The bubbles will be shown in order by scrolling horizontally.
- __init__(contents=None, **kwargs)[source]¶
__init__ method.
- Parameters
contents (list[T <=
linebot.models.flex_message.BubbleContainer
]) – Array of bubble containerskwargs –
- class linebot.models.flex_message.FlexComponent(**kwargs)[source]¶
Bases:
Base
FlexComponent.
https://developers.line.biz/en/reference/messaging-api/#component
Components are objects that compose a Flex Message container.
- class linebot.models.flex_message.BoxComponent(layout=None, contents=None, background_color=None, border_color=None, border_width=None, corner_radius=None, justify_content=None, align_items=None, background=None, width=None, max_width=None, height=None, max_height=None, flex=None, spacing=None, margin=None, padding_all=None, padding_top=None, padding_bottom=None, padding_start=None, padding_end=None, position=None, offset_top=None, offset_bottom=None, offset_start=None, offset_end=None, action=None, **kwargs)[source]¶
Bases:
FlexComponent
BoxComponent.
https://developers.line.biz/en/reference/messaging-api/#box
This is a component that defines the layout of child components. You can also include a box in a box.
- __init__(layout=None, contents=None, background_color=None, border_color=None, border_width=None, corner_radius=None, justify_content=None, align_items=None, background=None, width=None, max_width=None, height=None, max_height=None, flex=None, spacing=None, margin=None, padding_all=None, padding_top=None, padding_bottom=None, padding_start=None, padding_end=None, position=None, offset_top=None, offset_bottom=None, offset_start=None, offset_end=None, action=None, **kwargs)[source]¶
__init__ method.
- Parameters
layout (str) – The placement style of components in this box
contents (list[T <=
linebot.models.flex_message.FlexComponent
]) – Components in this boxbackground_color (str) – Background color of the block
border_color (str) – Color of box border
border_width (str) – Width of box border
corner_radius (str) – Radius at the time of rounding the corners of the border
justify_content (str) – How child elements are aligned along the main axis of the parent element
align_items (str) – How child elements are aligned along the cross axis of the parent element
background (T <=
linebot.models.background.Background
) – Background objectwidth (str) – Width of the box
max_width (str) – Maximum width of the box
height (str) – Height of the box
max_height (str) – Maximum height of the box
flex (float) – The ratio of the width or height of this box within the parent box and the previous component in the parent box
spacing (str) – Minimum space between components in this box
margin (str) – Minimum space between this box
padding_all (str) – Free space between the borders of this box and the child element
padding_top (str) – Free space between the border at the upper end of this box and the upper end of the child element
padding_bottom (str) – Free space between the border at the lower end of this box and the lower end of the child element
padding_start (str) – Free space between the border at the left end of this box and the left end of the child element
padding_end (str) – Free space between the border at the right end of this box and the right end of the child element
position (str) – Reference position for placing this box
offset_top (str) – The top offset
offset_bottom (str) – The bottom offset
offset_start (str) – The left offset
offset_end (str) – The right offset
action (list[T <=
linebot.models.actions.Action
]) – Action performed when this button is tappedkwargs –
- class linebot.models.flex_message.ButtonComponent(action=None, flex=None, margin=None, position=None, offset_top=None, offset_bottom=None, offset_start=None, offset_end=None, height=None, style=None, color=None, gravity=None, adjust_mode=None, **kwargs)[source]¶
Bases:
FlexComponent
ButtonComponent.
https://developers.line.biz/en/reference/messaging-api/#button
This component draws a button. When the user taps a button, a specified action is performed.
- __init__(action=None, flex=None, margin=None, position=None, offset_top=None, offset_bottom=None, offset_start=None, offset_end=None, height=None, style=None, color=None, gravity=None, adjust_mode=None, **kwargs)[source]¶
__init__ method.
- Parameters
action (list[T <=
linebot.models.actions.Action
]) – Action performed when this button is tappedflex (float) – The ratio of the width or height of this component within the parent box
margin (str) – Minimum space between this component and the previous component in the parent box
position (str) – Reference position for placing this box
offset_top (str) – The top offset
offset_bottom (str) – The bottom offset
offset_start (str) – The left offset
offset_end (str) – The right offset
height (str) – Height of the button
style (str) – Style of the button
color (str) – Character color when the style property is link. Background color when the style property is primary or secondary. Use a hexadecimal color code
gravity (str) – Vertical alignment style
adjust_mode (str) – The method by which to adjust the text font size
kwargs –
- class linebot.models.flex_message.FillerComponent(flex=None, **kwargs)[source]¶
Bases:
FlexComponent
FillerComponent.
https://developers.line.biz/en/reference/messaging-api/#filler
This is an invisible component to fill extra space between components.
- class linebot.models.flex_message.IconComponent(url=None, margin=None, position=None, offset_top=None, offset_bottom=None, offset_start=None, offset_end=None, size=None, aspect_ratio=None, **kwargs)[source]¶
Bases:
FlexComponent
IconComponent.
https://developers.line.biz/en/reference/messaging-api/#icon
This component draws an icon.
- __init__(url=None, margin=None, position=None, offset_top=None, offset_bottom=None, offset_start=None, offset_end=None, size=None, aspect_ratio=None, **kwargs)[source]¶
__init__ method.
- Parameters
url (str) – Image URL Protocol: HTTPS Image format: JPEG or PNG
margin (str) – Minimum space between this component and the previous component in the parent box
position (str) – Reference position for placing this box
offset_top (str) – The top offset
offset_bottom (str) – The bottom offset
offset_start (str) – The left offset
offset_end (str) – The right offset
size (str) – Maximum size of the icon width
aspect_ratio (str) – Aspect ratio of the icon
kwargs –
- class linebot.models.flex_message.ImageComponent(url=None, flex=None, margin=None, position=None, offset_top=None, offset_bottom=None, offset_start=None, offset_end=None, align=None, gravity=None, size=None, aspect_ratio=None, aspect_mode=None, background_color=None, action=None, animated=False, **kwargs)[source]¶
Bases:
FlexComponent
ImageComponent.
https://developers.line.biz/en/reference/messaging-api/#f-image
This component draws an image.
- __init__(url=None, flex=None, margin=None, position=None, offset_top=None, offset_bottom=None, offset_start=None, offset_end=None, align=None, gravity=None, size=None, aspect_ratio=None, aspect_mode=None, background_color=None, action=None, animated=False, **kwargs)[source]¶
__init__ method.
- Parameters
url (str) – Image URL Protocol: HTTPS Image format: JPEG or PNG
flex (float) – The ratio of the width or height of this component within the parent box
margin (str) – Minimum space between this component and the previous component in the parent box
position (str) – Reference position for placing this box
offset_top (str) – The top offset
offset_bottom (str) – The bottom offset
offset_start (str) – The left offset
offset_end (str) – The right offset
align (str) – Horizontal alignment style
gravity (str) – Vertical alignment style
size (str) – Maximum size of the image width
aspect_ratio (str) – Aspect ratio of the image
aspect_mode (str) – Style of the image
background_color (str) – Background color of the image. Use a hexadecimal color code.
action (list[T <=
linebot.models.actions.Action
]) – Action performed when this image is tappedanimated (bool) – True to play an animated image. Default is False.
kwargs –
- class linebot.models.flex_message.SeparatorComponent(margin=None, color=None, **kwargs)[source]¶
Bases:
FlexComponent
SeparatorComponent.
https://developers.line.biz/en/reference/messaging-api/#separator
This component draws a separator between components in the parent box.
- class linebot.models.flex_message.SpanComponent(text=None, color=None, size=None, weight=None, style=None, decoration=None, **kwargs)[source]¶
Bases:
FlexComponent
SpanComponent.
https://developers.line.biz/en/reference/messaging-api/#span
This component renders multiple text strings with different designs in one row.
- __init__(text=None, color=None, size=None, weight=None, style=None, decoration=None, **kwargs)[source]¶
__init__ method.
- Parameters
text (str) – Text
color (str) – Font color
size (str) – Font size
weight (str) – Font weight
style (str) – Style of the text
decoration (str) – Decoration of the text
kwargs –
- class linebot.models.flex_message.TextComponent(text=None, contents=None, flex=None, margin=None, position=None, offset_top=None, offset_bottom=None, offset_start=None, offset_end=None, size=None, align=None, gravity=None, wrap=None, line_spacing=None, max_lines=None, weight=None, color=None, action=None, style=None, decoration=None, **kwargs)[source]¶
Bases:
FlexComponent
TextComponent.
https://developers.line.biz/en/reference/messaging-api/#f-text
This component draws text. You can format the text.
- __init__(text=None, contents=None, flex=None, margin=None, position=None, offset_top=None, offset_bottom=None, offset_start=None, offset_end=None, size=None, align=None, gravity=None, wrap=None, line_spacing=None, max_lines=None, weight=None, color=None, action=None, style=None, decoration=None, **kwargs)[source]¶
__init__ method.
- Parameters
text (str) – Text
contents (list[T <=
linebot.models.flex_message.SpanComponent
]) – Array of spansflex (float) – The ratio of the width or height of this component within the parent box
margin (str) – Minimum space between this component and the previous component in the parent box
position (str) – Reference position for placing this box
offset_top (str) – The top offset
offset_bottom (str) – The bottom offset
offset_start (str) – The left offset
offset_end (str) – The right offset
size (str) – Font size
align (str) – Horizontal alignment style
gravity (str) – Vertical alignment style
wrap (bool) – rue to wrap text. The default value is False. If set to True, you can use a new line character (n) to begin on a new line.
line_spacing (str) – Line spacing in a wrapping text
max_lines (int) – Max number of lines
weight (str) – Font weight
color (str) – Font color
action (list[T <=
linebot.models.actions.Action
]) – Action performed when this image is tappedstyle (str) – Style of the text
decoration (str) – Decoration of the text
kwargs –
- class linebot.models.flex_message.VideoComponent(url=None, preview_url=None, alt_content=None, aspect_ratio=None, action=None, **kwargs)[source]¶
Bases:
FlexComponent
VideoComponent.
https://developers.line.biz/en/reference/messaging-api/#f-video
This component renders a video.
- __init__(url=None, preview_url=None, alt_content=None, aspect_ratio=None, action=None, **kwargs)[source]¶
__init__ method.
- Parameters
url (str) – URL of video file
preview_url (str) – URL of preview image
alt_content (
linebot.models.flex_message.ImageComponent
|linebot.models.flex_message.BoxComponent
) – Alternative contentaspect_ratio (float) – Aspect ratio of the video
action (list[T <=
linebot.models.actions.Action
]) – Action performed when this video is tappedkwargs –
linebot.models.imagemap module¶
linebot.models.imagemap module.
- class linebot.models.imagemap.ImagemapSendMessage(base_url=None, alt_text=None, base_size=None, video=None, actions=None, **kwargs)[source]¶
Bases:
SendMessage
ImagemapSendMessage.
https://developers.line.biz/en/reference/messaging-api/#imagemap-message
Imagemaps are images with one or more links. You can assign one link for the entire image or multiple links which correspond to different regions of the image.
- __init__(base_url=None, alt_text=None, base_size=None, video=None, actions=None, **kwargs)[source]¶
__init__ method.
- Parameters
base_url (str) – Base URL of image. HTTPS
alt_text (str) – Alternative text
base_size (
linebot.models.imagemap.BaseSize
) – Width and height of base imagevideo (
linebot.models.imagemap.Video
) – Video in imagemap messageactions (list[T <=
linebot.models.imagemap.ImagemapAction
]) – Action when tappedkwargs –
- class linebot.models.imagemap.BaseSize(width=None, height=None, **kwargs)[source]¶
Bases:
Base
BaseSize.
https://developers.line.biz/en/reference/messaging-api/#imagemap-message
- class linebot.models.imagemap.ImagemapAction(**kwargs)[source]¶
Bases:
Base
ImagemapAction.
https://developers.line.biz/en/reference/messaging-api/#imagemap-message
- class linebot.models.imagemap.URIImagemapAction(link_uri=None, area=None, **kwargs)[source]¶
Bases:
ImagemapAction
URIImagemapAction.
https://developers.line.biz/en/reference/messaging-api/#imagemap-message
- __init__(link_uri=None, area=None, **kwargs)[source]¶
__init__ method.
- Parameters
link_uri (str) – Webpage URL
area (
linebot.models.imagemap.ImagemapArea
) – Defined tappable areakwargs –
- class linebot.models.imagemap.MessageImagemapAction(text=None, area=None, **kwargs)[source]¶
Bases:
ImagemapAction
MessageImagemapAction.
https://developers.line.biz/en/reference/messaging-api/#imagemap-message
- __init__(text=None, area=None, **kwargs)[source]¶
__init__ method.
- Parameters
text (str) – Message to send
area (
linebot.models.imagemap.ImagemapArea
) – Defined tappable areakwargs –
- class linebot.models.imagemap.ImagemapArea(x=None, y=None, width=None, height=None, **kwargs)[source]¶
Bases:
Base
ImagemapArea.
https://developers.line.biz/en/reference/messaging-api/#imagemap-area-object
Defines the size of the full imagemap with the width as 1040px. The top left is used as the origin of the area.
- class linebot.models.imagemap.Video(original_content_url=None, preview_image_url=None, area=None, external_link=None, **kwargs)[source]¶
Bases:
Base
Video.
https://developers.line.biz/en/reference/messaging-api/#imagemap-message
Defines the properties of the video object in imagemap.
- __init__(original_content_url=None, preview_image_url=None, area=None, external_link=None, **kwargs)[source]¶
__init__ method.
- Parameters
original_content_url (str) – URL of the video file
preview_image_url (str) – URL of the preview image
area (
linebot.models.imagemap.ImagemapArea
) – Defined video areaexternal_link (
linebot.models.imagemap.ExternalLink
) – Defined video external linkkwargs –
- class linebot.models.imagemap.ExternalLink(link_uri=None, label=None, **kwargs)[source]¶
Bases:
Base
ExternalLink.
https://developers.line.biz/en/reference/messaging-api/#imagemap-message
Defines URL and label of external link in video.
linebot.models.insight module¶
linebot.models.insight module.
- class linebot.models.insight.DemographicInsight(percentage=None, **kwargs)[source]¶
Bases:
Base
Abstract Base Class of DemographicInsight.
- class linebot.models.insight.GenderInsight(percentage=None, gender=None, **kwargs)[source]¶
Bases:
DemographicInsight
GenderInsight.
- class linebot.models.insight.AgeInsight(percentage=None, age=None, **kwargs)[source]¶
Bases:
DemographicInsight
AgeInsight.
- class linebot.models.insight.AreaInsight(percentage=None, area=None, **kwargs)[source]¶
Bases:
DemographicInsight
AreaInsight.
- class linebot.models.insight.AppTypeInsight(percentage=None, app_type=None, **kwargs)[source]¶
Bases:
DemographicInsight
AppTypeInsight.
- class linebot.models.insight.SubscriptionPeriodInsight(percentage=None, subscription_period=None, **kwargs)[source]¶
Bases:
DemographicInsight
SubscriptionPeriodInsight.
- class linebot.models.insight.MessageStatistics(request_id=None, timestamp=None, delivered=None, unique_impression=None, unique_click=None, unique_media_played=None, unique_media_played_100_percent=None, **kwargs)[source]¶
Bases:
Base
MessageStatistics.
- __init__(request_id=None, timestamp=None, delivered=None, unique_impression=None, unique_click=None, unique_media_played=None, unique_media_played_100_percent=None, **kwargs)[source]¶
__init__ method.
- Parameters
request_id (str) – Request ID.
timestamp (int) – UNIX timestamp for message delivery time.
delivered (int) – Number of messages delivered. This property shows values of less than 20.
unique_impression (int) – Number of people who opened the message, meaning they displayed at least 1 bubble.
unique_click (int) – Number of people who opened any URL in the message.
unique_media_played (int) – Number of people who started playing any video or audio in the message.
unique_media_played_100_percent (int) – Number of people who played the entirety of any video or audio in the message.
- class linebot.models.insight.MessageStatisticsOfCustomAggregationUnit(unique_impression=None, unique_click=None, unique_media_played=None, unique_media_played_100_percent=None, **kwargs)[source]¶
Bases:
Base
MessageStatisticsOfCustomAggregationUnit.
- __init__(unique_impression=None, unique_click=None, unique_media_played=None, unique_media_played_100_percent=None, **kwargs)[source]¶
__init__ method.
- Parameters
unique_impression (int) – Number of people who opened the message, meaning they displayed at least 1 bubble.
unique_click (int) – Number of people who opened any URL in the message.
unique_media_played (int) – Number of people who started playing any video or audio in the message.
unique_media_played_100_percent (int) – Number of people who played the entirety of any video or audio in the message.
- class linebot.models.insight.MessageInsight(seq=None, impression=None, media_played=None, media_played_25_percent=None, media_played_50_percent=None, media_played_75_percent=None, media_played_100_percent=None, unique_media_played=None, unique_media_played_25_percent=None, unique_media_played_50_percent=None, unique_media_played_75_percent=None, unique_media_played_100_percent=None, **kwargs)[source]¶
Bases:
Base
MessageInsight.
- __init__(seq=None, impression=None, media_played=None, media_played_25_percent=None, media_played_50_percent=None, media_played_75_percent=None, media_played_100_percent=None, unique_media_played=None, unique_media_played_25_percent=None, unique_media_played_50_percent=None, unique_media_played_75_percent=None, unique_media_played_100_percent=None, **kwargs)[source]¶
__init__ method.
- Parameters
seq (int) – Bubble’s serial number.
impression (int) – Number of times the bubble was displayed.
media_played (int) – Number of times audio or video in the bubble started playing.
media_played_25_percent (int) – Number of times audio or video in the bubble was played from start to 25%.
media_played_50_percent (int) – Number of times audio or video in the bubble was played from start to 50%.
media_played_75_percent (int) – Number of times audio or video in the bubble was played from start to 75%.
media_played_100_percent (int) – Number of times audio or video in the bubble was played in its entirety.
unique_media_played (int) – Number of people that started playing audio or video in the bubble.
unique_media_played_25_percent (int) – Number of people that played audio or video in the bubble from start to 25%.
unique_media_played_50_percent (int) – Number of people that played audio or video in the bubble from start to 50%.
unique_media_played_75_percent (int) – Number of people that played audio or video in the bubble from start to 75%.
unique_media_played_100_percent (int) – Number of people that played audio or video in the bubble in its entirety.
- class linebot.models.insight.ClickInsight(seq=None, url=None, click=None, unique_click=None, unique_click_of_request=None, **kwargs)[source]¶
Bases:
Base
ClickInsight.
- __init__(seq=None, url=None, click=None, unique_click=None, unique_click_of_request=None, **kwargs)[source]¶
__init__ method.
- Parameters
seq (int) – The URL’s serial number.
url (str) – URL.
click (int) – Number of times the URL was opened.
unique_click (int) – Number of people that opened the URL.
unique_click_of_request (int) – Number of people who opened this url through any link in the message.
- class linebot.models.insight.JobInsight(audience_group_job_id=None, audience_group_id=None, description=None, type=None, job_status=None, failed_type=None, audience_count=None, created=None, **kwargs)[source]¶
Bases:
Base
ClickInsight.
- __init__(audience_group_job_id=None, audience_group_id=None, description=None, type=None, job_status=None, failed_type=None, audience_count=None, created=None, **kwargs)[source]¶
__init__ method.
- Parameters
audience_group_job_id (int) – A job ID.
audience_group_id (int) – An audience ID.
description (str) – The job’s description.
type (str) – The job’s type. One of: ‘DIFF_ADD’
job_status (str) – The job’s status. One of: ‘QUEUED’, ‘WORKING’, ‘FINISHED’, ‘FAILED’
failed_type (str) – The reason why the operation failed. This is only included when jobs[].jobStatus is FAILED.
audience_count (int) – The number of accounts (recipients) that were added or removed.
created (int) – When the job was created (in UNIX time).
kwargs –
linebot.models.limit module¶
linebot.models.recipient module.
linebot.models.messages module¶
linebot.models.messages module.
- class linebot.models.messages.Message(*args, **kwargs)[source]¶
Bases:
Base
Abstract Base Class of Message.
- class linebot.models.messages.TextMessage(*args, **kwargs)[source]¶
Bases:
Message
TextMessage.
https://developers.line.biz/en/reference/messaging-api/#wh-text
Message object which contains the text sent from the source.
- class linebot.models.messages.ImageMessage(*args, **kwargs)[source]¶
Bases:
Message
ImageMessage.
https://developers.line.biz/en/reference/messaging-api/#wh-image
Message object which contains the image content sent from the source. The binary image data can be retrieved with the Content API.
- __init__(id=None, content_provider=None, image_set=None, **kwargs)[source]¶
__init__ method.
- Parameters
id (str) – Message ID
content_provider (
linebot.models.messages.ContentProvider
) – ContentProvider objectimage_set (
linebot.models.messages.ImageSet
) – ImageSet objectkwargs –
- class linebot.models.messages.VideoMessage(*args, **kwargs)[source]¶
Bases:
Message
VideoMessage.
https://developers.line.biz/en/reference/messaging-api/#wh-video
Message object which contains the video content sent from the source. The binary video data can be retrieved with the Content API.
- __init__(id=None, duration=None, content_provider=None, **kwargs)[source]¶
__init__ method.
- Parameters
id (str) – Message ID
duration (long) – Length of video file (milliseconds)
content_provider (
linebot.models.messages.ContentProvider
) – ContentProvider objectkwargs –
- class linebot.models.messages.AudioMessage(*args, **kwargs)[source]¶
Bases:
Message
AudioMessage.
https://developers.line.biz/en/reference/messaging-api/#wh-audio
Message object which contains the audio content sent from the source. The binary audio data can be retrieved with the Content API.
- __init__(id=None, duration=None, content_provider=None, **kwargs)[source]¶
__init__ method.
- Parameters
id (str) – Message ID
duration (long) – Length of audio file (milliseconds)
content_provider (
linebot.models.messages.ContentProvider
) – ContentProvider objectkwargs –
- class linebot.models.messages.LocationMessage(*args, **kwargs)[source]¶
Bases:
Message
LocationMessage.
https://developers.line.biz/en/reference/messaging-api/#wh-location
- class linebot.models.messages.StickerMessage(*args, **kwargs)[source]¶
Bases:
Message
StickerMessage.
https://developers.line.biz/en/reference/messaging-api/#wh-sticker
Message object which contains the sticker data sent from the source. For a list of basic LINE stickers and sticker IDs, see sticker list.
- __init__(id=None, package_id=None, sticker_id=None, sticker_resource_type=None, keywords=None, text=None, **kwargs)[source]¶
__init__ method.
- Parameters
id (str) – Message ID
package_id (str) – Package ID
sticker_id (str) – Sticker ID
sticker_resource_type (str) – Sticker resource type
keywords (list[str]) – List of up to 15 keywords describing the sticker
text (str) – Any text entered by the user
kwargs –
- class linebot.models.messages.FileMessage(*args, **kwargs)[source]¶
Bases:
Message
FileMessage.
https://developers.line.biz/en/reference/messaging-api/#wh-file
Message object which contains the file content sent from the source. The binary file data can be retrieved with the Content API.
- class linebot.models.messages.ContentProvider(*args, **kwargs)[source]¶
Bases:
Base
Content provider.
linebot.models.operator module¶
linebot.models.filter module.
- class linebot.models.operator.Operator(**kwargs)[source]¶
Bases:
Base
Operator.
https://developers.line.biz/en/reference/messaging-api/#narrowcast-demographic-filter
Use logical AND, OR, and NOT operators to combine multiple recipient objects or demographic filter objects together. You can specify up to 10 recipient objects or demographic filter objects per request.
- class linebot.models.operator.And(*args, **kwargs)[source]¶
Bases:
Operator
And.
Create a new recipient object or demographic filter object by taking the logical conjunction (AND) of the specified array of objects.
linebot.models.recipient module¶
linebot.models.limit module.
- class linebot.models.recipient.Recipient(**kwargs)[source]¶
Bases:
Base
Recipient.
https://developers.line.biz/en/reference/messaging-api/#narrowcast-recipient
Recipient objects represent audiences. You can specify recipients based on a combination of criteria using logical operator objects.
- class linebot.models.recipient.AudienceRecipient(group_id=None, **kwargs)[source]¶
Bases:
Recipient
AudienceRecipient.
linebot.models.responses module¶
linebot.models.responses module.
- class linebot.models.responses.BroadcastResponse(request_id=None)[source]¶
Bases:
object
BroadcastResponse.
https://developers.line.biz/en/reference/messaging-api/#send-broadcast-message
- class linebot.models.responses.ValidateReplyMessageObjectsResponse(request_id=None)[source]¶
Bases:
object
ValidateReplyMessageObjectsResponse.
https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-reply-message
- class linebot.models.responses.ValidatePushMessageObjectsResponse(request_id=None)[source]¶
Bases:
object
ValidatePushMessageObjectsResponse.
https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-push-message
- class linebot.models.responses.ValidateMulticastMessageObjectsResponse(request_id=None)[source]¶
Bases:
object
ValidateMulticastMessageObjectsResponse.
- class linebot.models.responses.ValidateNarrowcastMessageObjectsResponse(request_id=None)[source]¶
Bases:
object
ValidateNarrowcastMessageObjectsResponse.
- class linebot.models.responses.ValidateBroadcastMessageObjectsResponse(request_id=None)[source]¶
Bases:
object
ValidateBroadcastMessageObjectsResponse.
- class linebot.models.responses.Profile(display_name=None, user_id=None, picture_url=None, status_message=None, language=None, **kwargs)[source]¶
Bases:
Base
Profile.
https://developers.line.biz/en/reference/messaging-api/#get-profile
- __init__(display_name=None, user_id=None, picture_url=None, status_message=None, language=None, **kwargs)[source]¶
__init__ method.
- Parameters
display_name (str) – Display name
user_id (str) – User ID
picture_url (str) – Image URL
status_message (str) – Status message
language (str) – Get user’s language
kwargs –
- class linebot.models.responses.Group(group_id=None, group_name=None, picture_url=None, **kwargs)[source]¶
Bases:
Base
Group.
https://developers.line.biz/en/reference/messaging-api/#get-group-id-response
- class linebot.models.responses.MemberIds(member_ids=None, next=None, **kwargs)[source]¶
Bases:
Base
MemberIds.
https://developers.line.biz/en/reference/messaging-api/#get-group-member-user-ids https://developers.line.biz/en/reference/messaging-api/#get-room-member-user-ids
- class linebot.models.responses.Content(response)[source]¶
Bases:
object
MessageContent.
https://developers.line.biz/en/reference/messaging-api/#get-content
- __init__(response)[source]¶
__init__ method.
- Parameters
response (T <=
linebot.http_client.HttpResponse
) – HttpResponse object
- property content_type¶
Get Content-type header value.
- Return type
str
- Returns
content-type header value
- property content¶
Get content.
If content size is large, should use iter_content.
- Return type
binary
- class linebot.models.responses.RichMenuResponse(rich_menu_id=None, size=None, selected=None, name=None, chat_bar_text=None, areas=None, **kwargs)[source]¶
Bases:
Base
RichMenuResponse.
https://developers.line.me/en/docs/messaging-api/reference/#rich-menu-response-object
- __init__(rich_menu_id=None, size=None, selected=None, name=None, chat_bar_text=None, areas=None, **kwargs)[source]¶
__init__ method.
- Parameters
id (str) – Rich Menu ID
size (
linebot.models.rich_menu.RichMenuSize
) – size object which describe the rich menu displayed in the chat. Rich menu images must be one of the following sizes: 2500x1686, 2500x843.selected (bool) – true to display the rich menu by default. Otherwise, false.
name (str) – Name of the rich menu. Maximum of 300 characters.
chat_bar_text (str) – Text displayed in the chat bar. Maximum of 14 characters.
areas (list[T <=
linebot.models.rich_menu.RichMenuArea
]) – Array of area objects which define coordinates and size of tappable areas. Maximum of 20 area objects.kwargs –
- class linebot.models.responses.RichMenuAliasResponse(rich_menu_alias_id=None, rich_menu_id=None, **kwargs)[source]¶
Bases:
Base
RichMenuAliasResponse.
https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-alias-by-id-response
- class linebot.models.responses.RichMenuAliasListResponse(aliases=None, **kwargs)[source]¶
Bases:
Base
RichMenuAliasListResponse.
https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-alias-list-response
- class linebot.models.responses.MessageQuotaResponse(type=None, value=None, **kwargs)[source]¶
Bases:
Base
MessageQuotaResponse.
https://developers.line.biz/en/reference/messaging-api/#get-quota
- class linebot.models.responses.MessageQuotaConsumptionResponse(total_usage=None, **kwargs)[source]¶
Bases:
Base
MessageQuotaConsumptionResponse.
https://developers.line.biz/en/reference/messaging-api/#get-consumption
- class linebot.models.responses.MessageDeliveryBroadcastResponse(status=None, success=None, **kwargs)[source]¶
Bases:
Base
MessageDeliveryBroadcastResponse.
- class linebot.models.responses.MessageDeliveryReplyResponse(status=None, success=None, **kwargs)[source]¶
Bases:
Base
MessageDeliveryReplyResponse.
- class linebot.models.responses.MessageDeliveryPushResponse(status=None, success=None, **kwargs)[source]¶
Bases:
Base
MessageDeliveryPushResponse.
- class linebot.models.responses.MessageDeliveryMulticastResponse(status=None, success=None, **kwargs)[source]¶
Bases:
Base
MessageDeliveryMulticastResponse.
- class linebot.models.responses.MessageProgressNarrowcastResponse(phase=None, success_count=None, failure_count=None, target_count=None, failed_description=None, error_code=None, accepted_time=None, completed_time=None, **kwargs)[source]¶
Bases:
Base
MessageProgressNarrowcastResponse.
- __init__(phase=None, success_count=None, failure_count=None, target_count=None, failed_description=None, error_code=None, accepted_time=None, completed_time=None, **kwargs)[source]¶
__init__ method.
- Parameters
phase (str) – Progress status. One of waiting, sending, succeeded, or failed.
success_count (int) – Number of narrowcast messages sent successful.
failure_count (int) – Number of narrowcast messages sent failed.
target_count (int) – Number of targeted messages sent.
failed_description (str) – Reason why narrowcast failed, useful when phase is failed.
error_code (int) – Summary of the error. One of 1 or 2. 1 means internal error, whereas 2 indicates too few targets.
accepted_time (str) – Narrowcast message request accepted time in milliseconds.
completed_time (str) – Processing of narrowcast message request completion time in milliseconds.
kwargs –
- class linebot.models.responses.IssueLinkTokenResponse(link_token=None, **kwargs)[source]¶
Bases:
Base
IssueLinkTokenResponse.
https://developers.line.biz/en/reference/messaging-api/#issue-link-token
- class linebot.models.responses.IssueChannelTokenResponse(access_token=None, expires_in=None, token_type=None, **kwargs)[source]¶
Bases:
Base
IssueAccessTokenResponse.
https://developers.line.biz/en/reference/messaging-api/#issue-channel-access-token
- __init__(access_token=None, expires_in=None, token_type=None, **kwargs)[source]¶
__init__ method.
- Parameters
access_token (str) – Short-lived channel access token.
expires_in (int) – Time until channel access token expires in seconds from time the token is issued.
token_type (str) – Bearer.
kwargs –
- class linebot.models.responses.InsightMessageDeliveryResponse(status=None, broadcast=None, targeting=None, auto_response=None, welcome_response=None, chat=None, api_broadcast=None, api_push=None, api_multicast=None, api_reply=None, **kwargs)[source]¶
Bases:
Base
InsightMessageDeliveryResponse.
- __init__(status=None, broadcast=None, targeting=None, auto_response=None, welcome_response=None, chat=None, api_broadcast=None, api_push=None, api_multicast=None, api_reply=None, **kwargs)[source]¶
__init__ method.
- Parameters
status (str) – Calculation status. One of ready, unready, or out_of_service.
broadcast (int) – Number of broadcast messages sent.
targeting (int) – Number of targeted/segmented messages sent.
auto_response (int) – Number of auto-response messages sent.
welcome_response (int) – Number of greeting messages sent.
chat (int) – Number of messages sent from LINE Official Account Manager Chat screen.
api_broadcast (int) – Number of broadcast messages sent with the Send broadcast message Messaging API operation.
api_push (int) – Number of push messages sent with the Send push message Messaging API operation.
api_multicast (int) – Number of multicast messages sent with the Send multicast message Messaging API operation.
api_reply (int) – Number of replies sent with the Send reply message Messaging API operation.
success (int) – The number of messages sent with the Messaging API on the date specified in date.
kwargs –
- class linebot.models.responses.InsightFollowersResponse(status=None, followers=None, targeted_reaches=None, blocks=None, **kwargs)[source]¶
Bases:
Base
InsightFollowersResponse.
- __init__(status=None, followers=None, targeted_reaches=None, blocks=None, **kwargs)[source]¶
__init__ method.
- Parameters
status (str) – Calculation status. One of ready, unready, or out_of_service.
followers (int) – The number of times, as of the specified date, that a user added this LINE official account as a friend for the first time.
targeted_reaches (int) – The number of users, as of the specified date, that the official account can reach through targeted messages based on gender, age, and/or region.
blocks (int) – The number of users blocking the account as of the specified date.
kwargs –
- class linebot.models.responses.InsightDemographicResponse(available=None, genders=None, ages=None, areas=None, app_types=None, subscription_periods=None, **kwargs)[source]¶
Bases:
Base
InsightDemographicResponse.
- __init__(available=None, genders=None, ages=None, areas=None, app_types=None, subscription_periods=None, **kwargs)[source]¶
__init__ method.
- Parameters
available (bool) – true if friend demographic information is available.
genders (list[T <=
linebot.models.GenderInsight
]) – Percentage per gender.ages (list[T <=
linebot.models.AgeInsight
]) – Percentage per age group.areas (list[T <=
linebot.models.AreaInsight
]) – Percentage per area.app_types (list[T <=
linebot.models.AppTypeInsight
]) – Percentage by OS.subscription_periods (list[T <=
linebot.models.SubscriptionPeriodInsight
]) – Percentage per friendship duration.kwargs –
- class linebot.models.responses.InsightMessageEventResponse(overview=None, messages=None, clicks=None, **kwargs)[source]¶
Bases:
Base
InsightMessageEventResponse.
- __init__(overview=None, messages=None, clicks=None, **kwargs)[source]¶
__init__ method.
- Parameters
overview (T <=
linebot.models.MessageStatistics
) – Summary of message statistics.messages (list[T <=
linebot.models.MessageInsight
]) – Array of information about individual message bubbles.clicks (list[T <=
linebot.models.ClickInsight
]) – Array of information about URLs in the message.kwargs –
- class linebot.models.responses.InsightMessageEventOfCustomAggregationUnitResponse(overview=None, messages=None, clicks=None, **kwargs)[source]¶
Bases:
Base
InsightMessageEventResponse.
- __init__(overview=None, messages=None, clicks=None, **kwargs)[source]¶
__init__ method.
- Parameters
overview (T <=
linebot.models.MessageStatisticsOfCustomAggregationUnit
) – Summary of message statistics.messages (list[T <=
linebot.models.MessageInsight
]) – Array of information about individual message bubbles.clicks (list[T <=
linebot.models.ClickInsight
]) – Array of information about URLs in the message.kwargs –
- class linebot.models.responses.AggregationInfoResponse(num_of_custom_aggregation_units=None, **kwargs)[source]¶
Bases:
Base
The number of aggregation units used this month.
https://developers.line.biz/en/reference/partner-docs/#get-number-of-units-used-this-month
- class linebot.models.responses.AggregationNameListResponse(custom_aggregation_units=None, next=None, **kwargs)[source]¶
Bases:
Base
The name list of units used this month for statistics aggregation.
https://developers.line.biz/en/reference/partner-docs/#get-name-list-of-units-used-this-month
- __init__(custom_aggregation_units=None, next=None, **kwargs)[source]¶
__init__ method.
- Parameters
custom_aggregation_units (list[str]) – name list of aggregation units used this month. Max: 100 unit names
next (str) – continuationToken. A continuation token to get the next array of unit names.
kwargs –
- class linebot.models.responses.NarrowcastResponse(request_id=None, **kwargs)[source]¶
Bases:
Base
NarrowcastResponse.
https://developers.line.biz/en/reference/messaging-api/#send-narrowcast-message
- class linebot.models.responses.BotInfo(user_id=None, basic_id=None, premium_id=None, display_name=None, picture_url=None, chat_mode=None, mark_as_read_mode=None, **kwargs)[source]¶
Bases:
Base
Response of linebot.get_bot_info() .
https://developers.line.biz/en/reference/messaging-api/#get-bot-info
- class linebot.models.responses.GetWebhookResponse(endpoint=None, active=None, **kwargs)[source]¶
Bases:
Base
Response of get_webhook_endpoint() .
https://developers.line.biz/en/reference/messaging-api/#get-webhook-endpoint-information
- class linebot.models.responses.TestWebhookResponse(success=None, timestamp=None, status_code=None, reason=None, detail=None, **kwargs)[source]¶
Bases:
Base
Response of test_webhook_endpoint() .
https://developers.line.biz/en/reference/messaging-api/#test-webhook-endpoint
- __init__(success=None, timestamp=None, status_code=None, reason=None, detail=None, **kwargs)[source]¶
__init__ method.
- Parameters
success (bool) – Result of the communication from the LINE platform to the webhook URL.
timestamp (str) – Timestamp
status_code (int) – The HTTP status code.
reason (str) – Reason for the response.
detail (str) – Details of the response.
kwargs –
- class linebot.models.responses.AudienceGroup(audience_group_id=None, type=None, description=None, status=None, audience_count=None, created=None, is_ifa_audience=None, permission=None, create_route=None, request_id=None, failed_type=None, click_url=None, jobs=None, **kwargs)[source]¶
Bases:
Base
AudienceGroups.
https://developers.line.biz/en/reference/messaging-api/#get-audience-group
- __init__(audience_group_id=None, type=None, description=None, status=None, audience_count=None, created=None, is_ifa_audience=None, permission=None, create_route=None, request_id=None, failed_type=None, click_url=None, jobs=None, **kwargs)[source]¶
__init__ method.
- Parameters
audience_group_id (int) – The audience ID.
type (str) – The audience type. One of UPLOAD or CLICK or IMP or CHAT_TAG or FRIEND_PATH.
description (str) – The audience’s name.
status (str) – The audience’s status. One of IN_PROGRESS or READY or FAILED or EXPIRED.
audience_count (int) – The number of valid recipients.
created (int) – When the audience was created (in UNIX time).
is_ifa_audience (bool) – The value specified when creating an audience for uploading user IDs to indicate the type of accounts that will be given as recipients.
permission (str) – Audience’s update permission. Audiences linked to the same channel will be READ_WRITE.
create_route (str) – How the audience was created. If omitted, you will get all audiences.
request_id (str) – The request ID that was specified when the audience was created.
failed_type (str) – The reason why the operation failed. This is only included when status is FAILED. One of AUDIENCE_GROUP_AUDIENCE_INSUFFICIENT or INTERNAL_ERROR
click_url (str) – The URL that was specified when the audience was created. This is only included when type is CLICK
jobs – An array of jobs. This array is used to keep track of each attempt to add new user IDs or IFAs to an audience for uploading user IDs.
kwargs –
- class linebot.models.responses.ClickAudienceGroup(audience_group_id=None, create_route=None, type=None, description=None, created=None, permission=None, expire_timestamp=None, is_ifa_audience=None, request_id=None, click_url=None, **kwargs)[source]¶
Bases:
Base
ClickAudienceGroup.
https://developers.line.biz/en/reference/messaging-api/#create-click-audience-group
- __init__(audience_group_id=None, create_route=None, type=None, description=None, created=None, permission=None, expire_timestamp=None, is_ifa_audience=None, request_id=None, click_url=None, **kwargs)[source]¶
__init__ method.
- Parameters
audience_group_id (int) – The audience ID.
create_route (str) – How the audience was created. If omitted, you will get all audiences.
type (str) – The audience type. One of UPLOAD or CLICK or IMP or CHAT_TAG or FRIEND_PATH.
description (str) – The audience’s name.
created (int) – When the audience was created (in UNIX time).
permission (str) – Audience’s update permission. Audiences linked to the same channel will be READ_WRITE.
expire_timestamp (int) – Time of audience expiration. Only returned for specific audiences.
is_ifa_audience (bool) – The value specified when creating an audience for uploading user IDs to indicate the type of accounts that will be given as recipients.
request_id (str) – The request ID that was specified when the audience was created.
click_url (str) – The URL that was specified when the audience was created. This is only included when type is CLICK
kwargs –
- class linebot.models.responses.CreateAudienceGroup(audience_group_id=None, create_route=None, type=None, description=None, created=None, permission=None, expire_timestamp=None, is_ifa_audience=None, **kwargs)[source]¶
Bases:
Base
ClickAudienceGroup.
https://developers.line.biz/en/reference/messaging-api/#create-upload-audience-group
- __init__(audience_group_id=None, create_route=None, type=None, description=None, created=None, permission=None, expire_timestamp=None, is_ifa_audience=None, **kwargs)[source]¶
__init__ method.
- Parameters
audience_group_id (int) – The audience ID.
create_route (str) – How the audience was created. If omitted, you will get all audiences.
type (str) – The audience type. One of UPLOAD or CLICK or IMP or CHAT_TAG or FRIEND_PATH.
description (str) – The audience’s name.
created (int) – When the audience was created (in UNIX time).
permission (str) – Audience’s update permission. Audiences linked to the same channel will be READ_WRITE.
expire_timestamp (int) – Time of audience expiration. Only returned for specific audiences.
is_ifa_audience (bool) – The value specified when creating an audience for uploading user IDs to indicate the type of accounts that will be given as recipients.
kwargs –
- class linebot.models.responses.ImpAudienceGroup(audience_group_id=None, create_route=None, type=None, description=None, created=None, permission=None, expire_timestamp=None, is_ifa_audience=None, request_id=None, **kwargs)[source]¶
Bases:
Base
ImpAudienceGroup.
https://developers.line.biz/en/reference/messaging-api/#create-imp-audience-group
- __init__(audience_group_id=None, create_route=None, type=None, description=None, created=None, permission=None, expire_timestamp=None, is_ifa_audience=None, request_id=None, **kwargs)[source]¶
__init__ method.
- Parameters
audience_group_id (int) – The audience ID.
create_route (str) – How the audience was created. If omitted, you will get all audiences.
type (str) – The audience type. One of UPLOAD or CLICK or IMP or CHAT_TAG or FRIEND_PATH.
description (str) – The audience’s name.
created (int) – When the audience was created (in UNIX time).
permission (str) – Audience’s update permission. Audiences linked to the same channel will be READ_WRITE.
expire_timestamp (int) – Time of audience expiration. Only returned for specific audiences.
is_ifa_audience (bool) – The value specified when creating an audience for uploading user IDs to indicate the type of accounts that will be given as recipients.
request_id (str) – The request ID that was specified when the audience was created.
kwargs –
- class linebot.models.responses.GetAuthorityLevel(authority_level=None, **kwargs)[source]¶
Bases:
Base
GetAuthorityLevel.
https://developers.line.biz/en/reference/messaging-api/#get-authority-level
- class linebot.models.responses.Audience(id=None, **kwargs)[source]¶
Bases:
Base
Audience.
https://developers.line.biz/en/reference/messaging-api/#update-upload-audience-group
- class linebot.models.responses.UserIds(user_ids=None, next=None, **kwargs)[source]¶
Bases:
Base
UserIds.
https://developers.line.biz/en/reference/messaging-api/#get-follower-ids
- __init__(user_ids=None, next=None, **kwargs)[source]¶
__init__ method.
- Parameters
user_ids (list[str]) – List of user IDs of users that have added the LINE Official Account as a friend. Max: 300 user IDs
next (str) – continuationToken. A continuation token to get the next array of user IDs.
kwargs –
- class linebot.models.responses.IssueChannelTokenResponseV2(access_token=None, expires_in=None, token_type=None, key_id=None, **kwargs)[source]¶
Bases:
Base
IssueAccessTokenResponseV2.
https://developers.line.biz/en/reference/messaging-api/#issue-channel-access-token-v2-1
- __init__(access_token=None, expires_in=None, token_type=None, key_id=None, **kwargs)[source]¶
__init__ method.
- Parameters
access_token (str) – Short-lived channel access token.
expires_in (int) – Time until channel access token expires in seconds from time the token is issued.
token_type (str) – Bearer.
key_id – Unique key ID for identifying the channel access token.
kwargs –
- class linebot.models.responses.ChannelAccessTokens(access_tokens=None, **kwargs)[source]¶
Bases:
Base
ChannelAccessTokens.
https://developers.line.biz/en/reference/messaging-api/#get-issued-channel-access-tokens-v2-1
- class linebot.models.responses.VerifyChannelTokenResponseV2(client_id=None, expires_in=None, scope=None, **kwargs)[source]¶
Bases:
Base
VerifyChannelTokenResponseV2.
https://developers.line.biz/en/reference/messaging-api/#verfiy-channel-access-token-v2-1
- __init__(client_id=None, expires_in=None, scope=None, **kwargs)[source]¶
__init__ method.
- Parameters
client_id (str) – The channel ID for which the channel access token was issued.
expires_in (int) – Number of seconds before the channel access token expires.
scope (str) – Permissions granted to the channel access token.
kwargs –
linebot.models.send_messages module¶
linebot.models.send_messages module.
- class linebot.models.send_messages.SendMessage(quick_reply=None, sender=None, **kwargs)[source]¶
Bases:
Base
Abstract Base Class of SendMessage.
- __init__(quick_reply=None, sender=None, **kwargs)[source]¶
__init__ method.
- Parameters
quick_reply (T <=
linebot.models.send_messages.QuickReply
) – QuickReply objectsender (T <=
linebot.models.send_messages.Sender
) – Sender objectkwargs –
- class linebot.models.send_messages.TextSendMessage(text=None, emojis=None, quick_reply=None, sender=None, **kwargs)[source]¶
Bases:
SendMessage
TextSendMessage.
https://developers.line.biz/en/reference/messaging-api/#text-message
- __init__(text=None, emojis=None, quick_reply=None, sender=None, **kwargs)[source]¶
__init__ method.
- Parameters
text (str) – Message text
quick_reply (T <=
linebot.models.send_messages.QuickReply
) – QuickReply objectkwargs –
- class linebot.models.send_messages.ImageSendMessage(original_content_url=None, preview_image_url=None, quick_reply=None, sender=None, **kwargs)[source]¶
Bases:
SendMessage
ImageSendMessage.
https://developers.line.biz/en/reference/messaging-api/#image-message
- __init__(original_content_url=None, preview_image_url=None, quick_reply=None, sender=None, **kwargs)[source]¶
__init__ method.
- Parameters
original_content_url (str) – Image URL. HTTPS JPEG Max: 1024 x 1024 Max: 1 MB
preview_image_url (str) – Preview image URL HTTPS JPEG Max: 240 x 240 Max: 1 MB
quick_reply (T <=
linebot.models.send_messages.QuickReply
) – QuickReply objectkwargs –
- class linebot.models.send_messages.VideoSendMessage(original_content_url=None, preview_image_url=None, tracking_id=None, quick_reply=None, sender=None, **kwargs)[source]¶
Bases:
SendMessage
VideoSendMessage.
https://developers.line.biz/en/reference/messaging-api/#video-message
- __init__(original_content_url=None, preview_image_url=None, tracking_id=None, quick_reply=None, sender=None, **kwargs)[source]¶
__init__ method.
- Parameters
original_content_url (str) – URL of video file. HTTPS. mp4. Less than 1 minute. Max: 10 MB.
preview_image_url (str) – URL of preview image. HTTPS. JPEG. Max: 240 x 240. Max: 1 MB.
tracking_id (str) – the video viewing complete event occurs when the user finishes watching the video. Max character limit: 100.
quick_reply (T <=
linebot.models.send_messages.QuickReply
) – QuickReply objectkwargs –
- class linebot.models.send_messages.AudioSendMessage(original_content_url=None, duration=None, quick_reply=None, sender=None, **kwargs)[source]¶
Bases:
SendMessage
AudioSendMessage.
https://developers.line.biz/en/reference/messaging-api/#audio-message
- __init__(original_content_url=None, duration=None, quick_reply=None, sender=None, **kwargs)[source]¶
__init__ method.
- Parameters
original_content_url (str) – URL of audio file. HTTPS. m4a. Less than 1 minute. Max 10 MB.
duration (long) – Length of audio file (milliseconds).
quick_reply (T <=
linebot.models.send_messages.QuickReply
) – QuickReply objectkwargs –
- class linebot.models.send_messages.LocationSendMessage(title=None, address=None, latitude=None, longitude=None, quick_reply=None, sender=None, **kwargs)[source]¶
Bases:
SendMessage
LocationSendMessage.
https://developers.line.biz/en/reference/messaging-api/#location-message
- __init__(title=None, address=None, latitude=None, longitude=None, quick_reply=None, sender=None, **kwargs)[source]¶
__init__ method.
- Parameters
title (str) – Title
address (str) – Address
latitude (float) – Latitude
longitude (float) – Longitude
quick_reply (T <=
linebot.models.send_messages.QuickReply
) – QuickReply objectkwargs –
- class linebot.models.send_messages.StickerSendMessage(package_id=None, sticker_id=None, quick_reply=None, sender=None, **kwargs)[source]¶
Bases:
SendMessage
StickerSendMessage.
https://developers.line.biz/en/reference/messaging-api/#sticker-message
- __init__(package_id=None, sticker_id=None, quick_reply=None, sender=None, **kwargs)[source]¶
__init__ method.
- Parameters
package_id (str) – Package ID
sticker_id (str) – Sticker ID
quick_reply (T <=
linebot.models.send_messages.QuickReply
) – QuickReply objectkwargs –
- class linebot.models.send_messages.QuickReply(items=None, **kwargs)[source]¶
Bases:
Base
QuickReply.
https://developers.line.me/en/docs/messaging-api/#quick-reply
- __init__(items=None, **kwargs)[source]¶
__init__ method.
- Parameters
items (list[T <=
linebot.models.send_messages.QuickReplyButton
]) – Quick reply button objectskwargs –
- class linebot.models.send_messages.QuickReplyButton(image_url=None, action=None, **kwargs)[source]¶
Bases:
Base
QuickReplyButton.
https://developers.line.me/en/reference/messaging-api/#quick-reply-button-object
- __init__(image_url=None, action=None, **kwargs)[source]¶
__init__ method.
- Parameters
image_url (str) – URL of the icon that is displayed at the beginning of the button
action (T <=
linebot.models.actions.Action
) – Action performed when this button is tappedkwargs –
- class linebot.models.send_messages.Sender(name=None, icon_url=None, **kwargs)[source]¶
Bases:
Base
Sender.
https://developers.line.biz/en/reference/messaging-api/#icon-nickname-switch
linebot.models.sources module¶
linebot.models.sources module.
- class linebot.models.sources.Source(*args, **kwargs)[source]¶
Bases:
Base
Abstract Base Class of Source.
- abstract property sender_id¶
Abstract property of id to send a message.
If SourceUser, return user_id. If SourceGroup, return group_id. If SourceRoom, return room_id.
‘sender_id’ is deprecated.
- Return type
str
- class linebot.models.sources.SourceUser(*args, **kwargs)[source]¶
Bases:
Source
SourceUser.
https://developers.line.biz/en/reference/messaging-api/#source-user
JSON object which contains the source user of the event.
- __init__(user_id=None, **kwargs)[source]¶
__init__ method.
- Parameters
user_id (str) – ID of the source user
kwargs –
- property sender_id¶
Alias of user_id.
‘sender_id’ is deprecated. Use ‘user_id’ instead.
- Return type
str
- class linebot.models.sources.SourceGroup(*args, **kwargs)[source]¶
Bases:
Source
SourceGroup.
https://developers.line.biz/en/reference/messaging-api/#source-group
JSON object which contains the source group of the event.
- __init__(group_id=None, user_id=None, **kwargs)[source]¶
__init__ method.
- Parameters
group_id (str) – ID of the source group
user_id (str) – ID of the source user
kwargs –
- property sender_id¶
Alias of group_id.
‘sender_id’ is deprecated. Use ‘group_id’ instead.
- Return type
str
- class linebot.models.sources.SourceRoom(*args, **kwargs)[source]¶
Bases:
Source
SourceRoom.
https://developers.line.biz/en/reference/messaging-api/#source-room
JSON object which contains the source room of the event.
- __init__(room_id=None, user_id=None, **kwargs)[source]¶
__init__ method.
- Parameters
room_id (str) – ID of the source room
user_id (str) – ID of the source user
kwargs –
- property sender_id¶
Alias of room_id.
‘sender_id’ is deprecated. Use ‘room_id’ instead.
- Return type
str
linebot.models.template module¶
linebot.models.template module.
- class linebot.models.template.TemplateSendMessage(alt_text=None, template=None, **kwargs)[source]¶
Bases:
SendMessage
TemplateSendMessage.
https://developers.line.biz/en/reference/messaging-api/#template-messages
Template messages are messages with predefined layouts which you can customize. There are three types of templates available that can be used to interact with users through your bot.
- __init__(alt_text=None, template=None, **kwargs)[source]¶
__init__ method.
- Parameters
alt_text (str) – Alternative text for unsupported devices.
template (T <=
linebot.models.template.Template
) – Object with the contents of the template.kwargs –
- class linebot.models.template.Template(**kwargs)[source]¶
Bases:
Base
Abstract Base Class of Template.
- class linebot.models.template.ButtonsTemplate(text=None, title=None, thumbnail_image_url=None, image_aspect_ratio=None, image_size=None, image_background_color=None, actions=None, default_action=None, **kwargs)[source]¶
Bases:
Template
ButtonsTemplate.
https://developers.line.biz/en/reference/messaging-api/#buttons
Template message with an image, title, text, and multiple action buttons.
- __init__(text=None, title=None, thumbnail_image_url=None, image_aspect_ratio=None, image_size=None, image_background_color=None, actions=None, default_action=None, **kwargs)[source]¶
__init__ method.
- Parameters
text (str) – Message text. Max: 160 characters (no image or title). Max: 60 characters (message with an image or title)
title (str) – Title. Max: 40 characters
thumbnail_image_url (str) – Image URL. HTTPS JPEG or PNG Aspect ratio: 1:1.51 Max width: 1024px Max: 1 MB
image_aspect_ratio (str) – Aspect ratio of the image. Specify one of the following values: rectangle: 1.51:1 square: 1:1
image_size (str) – Size of the image. Specify
cover
orcontain
.image_background_color (str) – Background color of image. Specify a RGB color value.
actions (list[T <=
linebot.models.actions.Action
]) – Action when tapped. Max: 4default_action (T <=
linebot.models.actions.Action
) – Action when image is tapped; set for the entire image, title, and text areakwargs –
- class linebot.models.template.ConfirmTemplate(text=None, actions=None, **kwargs)[source]¶
Bases:
Template
ConfirmTemplate.
https://developers.line.biz/en/reference/messaging-api/#confirm
Template message with two action buttons.
- __init__(text=None, actions=None, **kwargs)[source]¶
__init__ method.
- Parameters
text (str) – Message text. Max: 240 characters
actions (list[T <=
linebot.models.actions.Action
]) – Action when tapped. Max: 2kwargs –
- class linebot.models.template.CarouselTemplate(columns=None, image_aspect_ratio=None, image_size=None, **kwargs)[source]¶
Bases:
Template
CarouselTemplate.
https://developers.line.biz/en/reference/messaging-api/#carousel
Template message with multiple columns which can be cycled like a carousel.
- __init__(columns=None, image_aspect_ratio=None, image_size=None, **kwargs)[source]¶
__init__ method.
- Parameters
columns (list[T <=
linebot.models.template.CarouselColumn
]) – Array of columns. Max: 10image_aspect_ratio (str) – Aspect ratio of the image. Specify
rectangle
orsquare
.image_size (str) – Size of the image. Specify
cover
orcontain
.kwargs –
- class linebot.models.template.ImageCarouselTemplate(columns=None, **kwargs)[source]¶
Bases:
Template
ImageCarouselTemplate.
https://developers.line.biz/en/reference/messaging-api/#image-carousel
Template message with multiple images columns which can be cycled like as carousel.
- __init__(columns=None, **kwargs)[source]¶
__init__ method.
- Parameters
columns (list[T <=
linebot.models.template.ImageCarouselColumn
]) – Array of columns. Max: 10kwargs –
- class linebot.models.template.CarouselColumn(text=None, title=None, thumbnail_image_url=None, image_background_color=None, actions=None, default_action=None, **kwargs)[source]¶
Bases:
Base
CarouselColumn.
https://developers.line.biz/en/reference/messaging-api/#column-object
- __init__(text=None, title=None, thumbnail_image_url=None, image_background_color=None, actions=None, default_action=None, **kwargs)[source]¶
__init__ method.
- Parameters
text (str) – Message text. Max: 120 characters (no image or title) Max: 60 characters (message with an image or title)
title (str) – Title. Max: 40 characters
thumbnail_image_url (str) – Image URL (HTTPS). JPEG or PNG. Aspect ration is 1:1.51. Max width: 1024px, Max: 1 MB.
image_background_color (str) – Background color of image. Specify a RGB color value.
actions (list[T <=
linebot.models.actions.Action
]) – Action when tapped. Max: 3default_action (T <=
linebot.models.actions.Action
) – Action when image is tapped; set for the entire image, title, and text areakwargs –
- class linebot.models.template.ImageCarouselColumn(image_url=None, action=None, **kwargs)[source]¶
Bases:
Base
ImageCarouselColumn.
https://developers.line.biz/en/reference/messaging-api/#column-object-for-image-carousel
- __init__(image_url=None, action=None, **kwargs)[source]¶
__init__ method.
- Parameters
image_url (str) – Image URL (HTTPS). JPEG or PNG. Aspect ration is 1:1. Max width: 1024px, Max: 1 MB.
action (T <=
linebot.models.actions.Action
) – Action when image is tapped. Max: 5.kwargs –
linebot.models.things module¶
linebot.models.things module.
- class linebot.models.things.Things(*args, **kwargs)[source]¶
Bases:
Base
Abstract Base Class of Things.
- class linebot.models.things.DeviceLink(*args, **kwargs)[source]¶
Bases:
Things
DeviceLink.
https://developers.line.biz/en/reference/messaging-api/#device-link-event
Indicates that a user linked a device with LINE.
- class linebot.models.things.DeviceUnlink(*args, **kwargs)[source]¶
Bases:
Things
DeviceUnlink.
https://developers.line.biz/en/reference/messaging-api/#device-unlink-event
Indicates that the user unlinked a device from LINE.
- class linebot.models.things.ScenarioResult(*args, **kwargs)[source]¶
Bases:
Things
ScenarioResult.
https://developers.line.biz/en/reference/messaging-api/#scenario-result-event
Indicates that an automatic communication scenario has been executed.
- class linebot.models.things.ScenarioResultPayload(*args, **kwargs)[source]¶
Bases:
Base
ScenarioResultPayload.
- __init__(scenario_id=None, revision=None, start_time=None, result_code=None, end_time=None, action_results=None, ble_notification_payload=None, error_reason=None, **kwargs)[source]¶
__init__ method.
- Parameters
scenario_id (str) – Scenario ID executed.
revision (long) – Revision number.
start_time (long) – Timestamp for when execution of scenario action started (milliseconds).
end_time (long) – Timestamp for when execution of scenario was completed (milliseconds).
result_code (str) – Scenario execution completion status.
action_results (list[T <=
linebot.models.things.ActionResult
]) – Array of actions specified in a scenario.ble_notification_payload (str) – Data contained in notification.
error_reason (str) – Error response.
kwargs –