Class Message
java.lang.Object
io.micronaut.chatbots.telegram.api.Message
This object represents a message.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@Nullable Animation
@Nullable Audio
getAudio()
@Nullable String
@Nullable String
@Nullable List<MessageEntity>
@Nullable Boolean
@NonNull Chat
getChat()
@Nullable String
@Nullable Contact
@NonNull Integer
getDate()
@Nullable Boolean
@Nullable Dice
getDice()
@Nullable Document
@Nullable Integer
@Nullable List<MessageEntity>
@Nullable Integer
@Nullable User
@Nullable Chat
@Nullable Integer
@Nullable String
@Nullable String
@Nullable User
getFrom()
@Nullable Game
getGame()
@Nullable Boolean
@Nullable Boolean
@Nullable Invoice
@Nullable User
@Nullable Location
@Nullable String
@Nullable MessageAutoDeleteTimerChanged
@NonNull Integer
@Nullable Long
@Nullable Long
@Nullable String
@Nullable PassportData
getPhoto()
@Nullable Message
@Nullable Poll
getPoll()
@Nullable InlineKeyboardMarkup
@Nullable Message
@Nullable Chat
@Nullable Sticker
@Nullable SuccessfulPayment
@Nullable Boolean
@Nullable String
getText()
@Nullable Venue
getVenue()
@Nullable User
@Nullable Video
getVideo()
@Nullable VideoChatEnded
@Nullable VideoChatParticipantsInvited
@Nullable VideoChatScheduled
@Nullable VideoChatStarted
@Nullable VideoNote
@Nullable Voice
getVoice()
@Nullable WebAppData
@Nullable Boolean
void
setAnimation
(@Nullable Animation animation) void
void
setAuthorSignature
(@Nullable String authorSignature) void
setAutomaticForward
(@Nullable Boolean automaticForward) void
setCaption
(@Nullable String caption) void
setCaptionEntities
(@Nullable List<MessageEntity> captionEntities) void
setChannelChatCreated
(@Nullable Boolean channelChatCreated) void
void
setConnectedWebsite
(@Nullable String connectedWebsite) void
setContact
(@Nullable Contact contact) void
void
setDeleteChatPhoto
(@Nullable Boolean deleteChatPhoto) void
void
setDocument
(@Nullable Document document) void
setEditDate
(@Nullable Integer editDate) void
setEntities
(@Nullable List<MessageEntity> entities) void
setForwardDate
(@Nullable Integer forwardDate) void
setForwardFrom
(@Nullable User forwardFrom) void
setForwardFromChat
(@Nullable Chat forwardFromChat) void
setForwardFromMessageId
(@Nullable Integer forwardFromMessageId) void
setForwardSenderName
(@Nullable String forwardSenderName) void
setForwardSignature
(@Nullable String forwardSignature) void
void
void
setGroupChatCreated
(@Nullable Boolean groupChatCreated) void
setHasProtectedContent
(@Nullable Boolean hasProtectedContent) void
setInvoice
(@Nullable Invoice invoice) void
setLeftChatMember
(@Nullable User leftChatMember) void
setLocation
(@Nullable Location location) void
setMediaGroupId
(@Nullable String mediaGroupId) void
setMessageAutoDeleteTimerChanged
(@Nullable MessageAutoDeleteTimerChanged messageAutoDeleteTimerChanged) void
setMessageId
(@NonNull Integer messageId) void
setMigrateFromChatId
(@Nullable Long migrateFromChatId) void
setMigrateToChatId
(@Nullable Long migrateToChatId) void
setNewChatMembers
(@Nullable List<User> newChatMembers) void
setNewChatPhoto
(@Nullable List<PhotoSize> newChatPhoto) void
setNewChatTitle
(@Nullable String newChatTitle) void
setPassportData
(@Nullable PassportData passportData) void
void
setPinnedMessage
(@Nullable Message pinnedMessage) void
void
setReplyMarkup
(@Nullable InlineKeyboardMarkup replyMarkup) void
setReplyToMessage
(@Nullable Message replyToMessage) void
setSenderChat
(@Nullable Chat senderChat) void
setSticker
(@Nullable Sticker sticker) void
setSuccessfulPayment
(@Nullable SuccessfulPayment successfulPayment) void
setSupergroupChatCreated
(@Nullable Boolean supergroupChatCreated) void
void
void
void
void
setVideoChatEnded
(@Nullable VideoChatEnded videoChatEnded) void
setVideoChatParticipantsInvited
(@Nullable VideoChatParticipantsInvited videoChatParticipantsInvited) void
setVideoChatScheduled
(@Nullable VideoChatScheduled videoChatScheduled) void
setVideoChatStarted
(@Nullable VideoChatStarted videoChatStarted) void
setVideoNote
(@Nullable VideoNote videoNote) void
void
setWebAppData
(@Nullable WebAppData webAppData) toString()
-
Constructor Details
-
Message
public Message()
-
-
Method Details
-
getMessageId
- Returns:
- Unique message identifier inside this chat.
-
setMessageId
- Parameters:
messageId
- Unique message identifier inside this chat.
-
getFrom
- Returns:
- Sender, empty for messages sent to channels.
-
setFrom
- Parameters:
from
- Sender, empty for messages sent to channels.
-
getDate
- Returns:
- Date the message was sent in Unix time.
-
setDate
- Parameters:
date
- Date the message was sent in Unix time.
-
getChat
- Returns:
- Conversation the message belongs to.
-
setChat
- Parameters:
chat
- Conversation the message belongs to.
-
getForwardFrom
- Returns:
- For forwarded messages, sender of the original message.
-
setForwardFrom
- Parameters:
forwardFrom
- For forwarded messages, sender of the original message.
-
getForwardFromChat
- Returns:
- For messages forwarded from channels, information about the original channel.
-
setForwardFromChat
- Parameters:
forwardFromChat
- For messages forwarded from channels, information about the original channel.
-
getForwardFromMessageId
- Returns:
- For messages forwarded from channels, identifier of the original message in the channel.
-
setForwardFromMessageId
- Parameters:
forwardFromMessageId
- For messages forwarded from channels, identifier of the original message in the channel.
-
getForwardSignature
- Returns:
- For messages forwarded from channels, signature of the post author if present.
-
setForwardSignature
- Parameters:
forwardSignature
- For messages forwarded from channels, signature of the post author if present.
-
getForwardSenderName
- Returns:
- Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages.
-
setForwardSenderName
- Parameters:
forwardSenderName
- Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages.
-
getForwardDate
- Returns:
- For forwarded messages, date the original message was sent in Unix time
-
setForwardDate
- Parameters:
forwardDate
- For forwarded messages, date the original message was sent in Unix time
-
getReplyToMessage
- Returns:
- For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
-
setReplyToMessage
- Parameters:
replyToMessage
- For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
-
getEditDate
- Returns:
- Date the message was last edited in Unix time.
-
setEditDate
- Parameters:
editDate
- Date the message was last edited in Unix time.
-
getMediaGroupId
- Returns:
- The unique identifier of a media message group this message belongs to.
-
setMediaGroupId
- Parameters:
mediaGroupId
- The unique identifier of a media message group this message belongs to.
-
getAuthorSignature
- Returns:
- Signature of the post author for messages in channels.
-
setAuthorSignature
- Parameters:
authorSignature
- Signature of the post author for messages in channels.
-
getText
- Returns:
- For text messages, the actual UTF-8 text of the message, 0-4096 characters.
-
setText
- Parameters:
text
- For text messages, the actual UTF-8 text of the message, 0-4096 characters.
-
getEntities
- Returns:
- For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text.
-
setEntities
- Parameters:
entities
- For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text.
-
getCaptionEntities
- Returns:
- For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption.
-
setCaptionEntities
- Parameters:
captionEntities
- For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption.
-
getAudio
- Returns:
- Message is an audio file, information about the file.
-
setAudio
- Parameters:
audio
- Message is an audio file, information about the file.
-
getDocument
- Returns:
- Message is a general file, information about the file.
-
setDocument
- Parameters:
document
- Message is a general file, information about the file.
-
getAnimation
- Returns:
- Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set.
-
setAnimation
- Parameters:
animation
- Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set.
-
getGame
- Returns:
- Message is a game, information about the game.
-
setGame
- Parameters:
game
- Message is a game, information about the game.
-
getPhoto
- Returns:
- Message is a photo, available sizes of the photo
-
setPhoto
- Parameters:
photo
- Message is a photo, available sizes of the photo
-
getSticker
- Returns:
- Message is a sticker, information about the sticker.
-
setSticker
- Parameters:
sticker
- Message is a sticker, information about the sticker.
-
getVideo
- Returns:
- Message is a video, information about the video.
-
setVideo
- Parameters:
video
- Message is a video, information about the video.
-
getVoice
- Returns:
- Message is a voice message, information about the file.
-
setVoice
- Parameters:
voice
- Message is a voice message, information about the file.
-
getVideoNote
- Returns:
- Message is a video note, information about the video message.
-
setVideoNote
- Parameters:
videoNote
- Message is a video note, information about the video message.
-
getCaption
- Returns:
- Caption for the animation, audio, document, photo, video or voice, 0-1024 characters.
-
setCaption
- Parameters:
caption
- Caption for the animation, audio, document, photo, video or voice, 0-1024 characters.
-
getContact
- Returns:
- Message is a shared contact, information about the contact.
-
setContact
- Parameters:
contact
- Message is a shared contact, information about the contact.
-
getLocation
- Returns:
- Message is a shared location, information about the location.
-
setLocation
- Parameters:
location
- Message is a shared location, information about the location.
-
getVenue
- Returns:
- Message is a venue, information about the venue.
-
setVenue
- Parameters:
venue
- Message is a venue, information about the venue.
-
getPoll
- Returns:
- Message is a native poll, information about the poll.
-
setPoll
- Parameters:
poll
- Message is a native poll, information about the poll.
-
getNewChatMembers
- Returns:
- New members that were added to the group or supergroup and information about them (the bot itself may be one of these members).
-
setNewChatMembers
- Parameters:
newChatMembers
- New members that were added to the group or supergroup and information about them (the bot itself may be one of these members).
-
getLeftChatMember
- Returns:
- A member was removed from the group, information about them (this member may be the bot itself).
-
setLeftChatMember
- Parameters:
leftChatMember
- A member was removed from the group, information about them (this member may be the bot itself).
-
getNewChatTitle
- Returns:
- A chat title was changed to this value.
-
setNewChatTitle
- Parameters:
newChatTitle
- A chat title was changed to this value.
-
getNewChatPhoto
- Returns:
- A chat photo was change to this value.
-
setNewChatPhoto
- Parameters:
newChatPhoto
- A chat photo was change to this value.
-
getDeleteChatPhoto
- Returns:
- Service message: the chat photo was deleted.
-
setDeleteChatPhoto
- Parameters:
deleteChatPhoto
- Service message: the chat photo was deleted.
-
getGroupChatCreated
- Returns:
- Service message: the group has been created.
-
setGroupChatCreated
- Parameters:
groupChatCreated
- Service message: the group has been created.
-
getSupergroupChatCreated
- Returns:
- if the supergroup has been created.
-
setSupergroupChatCreated
- Parameters:
supergroupChatCreated
- if the supergroup has been created.
-
getChannelChatCreated
- Returns:
- the channel has been created
-
setChannelChatCreated
- Parameters:
channelChatCreated
- the channel has been created
-
getMigrateToChatId
- Returns:
- The group has been migrated to a supergroup with the specified identifier.
-
setMigrateToChatId
- Parameters:
migrateToChatId
- The group has been migrated to a supergroup with the specified identifier.
-
getMigrateFromChatId
- Returns:
- The supergroup has been migrated from a group with the specified identifier.
-
setMigrateFromChatId
- Parameters:
migrateFromChatId
- The supergroup has been migrated from a group with the specified identifier.
-
getPinnedMessage
- Returns:
- Specified message was pinned.
-
setPinnedMessage
- Parameters:
pinnedMessage
- Specified message was pinned.
-
getInvoice
- Returns:
- Message is an invoice for a payment, information about the invoice.
-
setInvoice
- Parameters:
invoice
- Message is an invoice for a payment, information about the invoice.
-
getSuccessfulPayment
- Returns:
- Message is a service message about a successful payment, information about the payment.
-
setSuccessfulPayment
- Parameters:
successfulPayment
- Message is a service message about a successful payment, information about the payment.
-
getConnectedWebsite
- Returns:
- The domain name of the website on which the user has logged in.
-
setConnectedWebsite
- Parameters:
connectedWebsite
- The domain name of the website on which the user has logged in.
-
getPassportData
- Returns:
- Telegram Passport data.
-
setPassportData
- Parameters:
passportData
- Telegram Passport data.
-
getReplyMarkup
- Returns:
- Inline keyboard attached to the message.
-
setReplyMarkup
- Parameters:
replyMarkup
- Inline keyboard attached to the message.
-
getSenderChat
- Returns:
- Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.
-
setSenderChat
- Parameters:
senderChat
- Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.
-
isAutomaticForward
- Returns:
- True, if the message is a channel post that was automatically forwarded to the connected discussion group
-
setAutomaticForward
- Parameters:
automaticForward
- True, if the message is a channel post that was automatically forwarded to the connected discussion group
-
getViaBot
- Returns:
- Bot through which the message was sent.
-
setViaBot
- Parameters:
viaBot
- Bot through which the message was sent.
-
getHasProtectedContent
- Returns:
- True, if the message can't be forwarded
-
setHasProtectedContent
- Parameters:
hasProtectedContent
- True, if the message can't be forwarded
-
getDice
- Returns:
- Message is a dice with random value
-
setDice
- Parameters:
dice
- Message is a dice with random value
-
getMessageAutoDeleteTimerChanged
- Returns:
- Service message: auto-delete timer settings changed in the chat.
-
setMessageAutoDeleteTimerChanged
public void setMessageAutoDeleteTimerChanged(@Nullable @Nullable MessageAutoDeleteTimerChanged messageAutoDeleteTimerChanged) - Parameters:
messageAutoDeleteTimerChanged
- Service message: auto-delete timer settings changed in the chat.
-
getVideoChatScheduled
- Returns:
- Service message: video chat scheduled
-
setVideoChatScheduled
- Parameters:
videoChatScheduled
- Service message: video chat scheduled
-
getVideoChatStarted
- Returns:
- Service message: video chat started
-
setVideoChatStarted
- Parameters:
videoChatStarted
- Service message: video chat started
-
getVideoChatEnded
- Returns:
- Service message: video chat ended
-
setVideoChatEnded
- Parameters:
videoChatEnded
- Service message: video chat ended
-
getVideoChatParticipantsInvited
- Returns:
- Service message: new participants invited to a video chat
-
setVideoChatParticipantsInvited
public void setVideoChatParticipantsInvited(@Nullable @Nullable VideoChatParticipantsInvited videoChatParticipantsInvited) - Parameters:
videoChatParticipantsInvited
- Service message: new participants invited to a video chat
-
getWebAppData
- Returns:
- Service message: data sent by a Web App
-
setWebAppData
- Parameters:
webAppData
- Service message: data sent by a Web App
-
toString
-