-
public final class CustomMessageBuilderKt
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringMESSAGE_TYPE_ALBUMpublic final static StringMESSAGE_TYPE_CONTACTpublic final static StringMESSAGE_TYPE_LOCATIONpublic final static StringPARSE_MODEpublic final static StringDISABLE_NOTIFICATIONpublic final static StringREPLY_MARKUPpublic final static StringDISABLE_LINK_PREVIEW
-
Method Summary
Modifier and Type Method Description final static MessageBuilderphoto(MessageBuilder $self, String photoRef, String caption)Sends a photo. final static MessageBuilderphoto(MessageBuilder $self, InputStream photo, String caption)Sends a photo. final static MessageBuilderaudio(MessageBuilder $self, String audioRef, String caption)Sends an audio file. final static MessageBuilderaudio(MessageBuilder $self, InputStream audio, String caption)Sends an audio file. final static MessageBuilderaudio(MessageBuilder $self, String audioRef, Integer duration, String performer, String title)Sends an audio file. final static MessageBuilderaudio(MessageBuilder $self, InputStream audio, Integer duration, String performer, String title)Sends an audio file. final static MessageBuildervideo(MessageBuilder $self, String videoRef, String caption, Integer duration, Integer width, Integer height, Boolean supportsStreaming)Sends a video. final static MessageBuildervideo(MessageBuilder $self, InputStream video, String caption, Integer duration, Integer width, Integer height, Boolean supportsStreaming)Sends a photo. final static MessageBuilderdocument(MessageBuilder $self, String documentRef, String caption)Sends a document. final static MessageBuilderdocument(MessageBuilder $self, InputStream document, String caption)Sends a document. final static MessageBuilderanimation(MessageBuilder $self, String animationRef, String caption, Integer duration, Integer width, Integer height)Sends animation files. final static MessageBuilderanimation(MessageBuilder $self, InputStream animation, String caption, Integer duration, Integer width, Integer height)Sends animation files. final static MessageBuildervoice(MessageBuilder $self, String voiceRef, String caption, Integer duration)Sends a voice message. final static MessageBuildervoice(MessageBuilder $self, InputStream voice, String caption, Integer duration)Sends a voice message. final static MessageBuilderphotoAlbum(MessageBuilder $self, String itemsRefs)Sends a group of photos as an album. final static MessageBuilderphotoAlbum(MessageBuilder $self, InputStream items)Sends a group of photos as an album. final static MessageBuildervideoAlbum(MessageBuilder $self, String itemsRefs)Sends a group of videos as an album. final static MessageBuildervideoAlbum(MessageBuilder $self, InputStream items)Sends a group of videos as an album. final static MessageBuildercontact(MessageBuilder $self, String phoneNumber, String firstName, String lastName, String vCard)Sends a contact from the address book. final static MessageBuilderlocation(MessageBuilder $self, Float latitude, Float longitude, Float horizontalAccuracy, Integer livePeriod, Integer heading, Integer proximityAlertRadius)Sends a location. final static MessageBuilderparseMode(MessageBuilder $self, ParseMode parseMode)Mode for parsing entities in the animation caption. final static MessageBuilderdisableNotification(MessageBuilder $self)Sends the message silently. final static MessageBuilderreplyMarkup(MessageBuilder $self, ReplyMarkup replyMarkup)Additional interface options. final static MessageBuilderdisableLinkPreview(MessageBuilder $self)Disables link previews for links in this message. -
-
Method Detail
-
photo
final static MessageBuilder photo(MessageBuilder $self, String photoRef, String caption)
Sends a photo.
- Parameters:
photoRef- Either a URL or a client-specific file id.caption- Text displayed with the photo.
-
photo
final static MessageBuilder photo(MessageBuilder $self, InputStream photo, String caption)
Sends a photo.
- Parameters:
photo- Input stream to read the photo.caption- Text displayed with the photo.
-
audio
final static MessageBuilder audio(MessageBuilder $self, String audioRef, String caption)
Sends an audio file.
- Parameters:
audioRef- Either a URL or a client-specific file id.caption- Text displayed with the audio.
-
audio
final static MessageBuilder audio(MessageBuilder $self, InputStream audio, String caption)
Sends an audio file.
- Parameters:
audio- Input stream to read the audio.caption- Text displayed with the audio.
-
audio
final static MessageBuilder audio(MessageBuilder $self, String audioRef, Integer duration, String performer, String title)
Sends an audio file.
- Parameters:
audioRef- Either a URL or a client-specific file id.duration- Duration of the audio in seconds.performer- Performer name.title- Track name.
-
audio
final static MessageBuilder audio(MessageBuilder $self, InputStream audio, Integer duration, String performer, String title)
Sends an audio file.
- Parameters:
audio- Input stream to read the audio.duration- Duration of the audio in seconds.performer- Performer name.title- Track name.
-
video
final static MessageBuilder video(MessageBuilder $self, String videoRef, String caption, Integer duration, Integer width, Integer height, Boolean supportsStreaming)
Sends a video.
- Parameters:
videoRef- Either a URL or a client-specific file id.caption- Text displayed with the video.
-
video
final static MessageBuilder video(MessageBuilder $self, InputStream video, String caption, Integer duration, Integer width, Integer height, Boolean supportsStreaming)
Sends a photo.
- Parameters:
video- Input stream to read the video.caption- Text displayed with the video.
-
document
final static MessageBuilder document(MessageBuilder $self, String documentRef, String caption)
Sends a document.
- Parameters:
documentRef- Either a URL or a client-specific file id.caption- Text displayed with the document.
-
document
final static MessageBuilder document(MessageBuilder $self, InputStream document, String caption)
Sends a document.
- Parameters:
document- Input stream to read the document.caption- Text displayed with the document.
-
animation
final static MessageBuilder animation(MessageBuilder $self, String animationRef, String caption, Integer duration, Integer width, Integer height)
Sends animation files. It supports GIF or H.264/MPEG-4 AVC video without sound. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
- Parameters:
animationRef- Either a URL or a client-specific file id.caption- Text displayed with the voice message.
-
animation
final static MessageBuilder animation(MessageBuilder $self, InputStream animation, String caption, Integer duration, Integer width, Integer height)
Sends animation files. It supports GIF or H.264/MPEG-4 AVC video without sound. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
- Parameters:
caption- Text displayed with the voice message.
-
voice
final static MessageBuilder voice(MessageBuilder $self, String voiceRef, String caption, Integer duration)
Sends a voice message. The file constraints and how to display the voice message is client-specific.
- Parameters:
voiceRef- Either a URL or a client-specific file id.caption- Text displayed with the voice message.duration- Duration of the voice message in seconds.
-
voice
final static MessageBuilder voice(MessageBuilder $self, InputStream voice, String caption, Integer duration)
Sends a voice message. The file constraints and how to display the voice message is client-specific.
- Parameters:
voice- Input stream to read the audio file.caption- Text displayed with the voice message.duration- Duration of the voice message in seconds.
-
photoAlbum
final static MessageBuilder photoAlbum(MessageBuilder $self, String itemsRefs)
Sends a group of photos as an album.
- Parameters:
itemsRefs- List of URLs or a client-specific ids of the media to send.
-
photoAlbum
final static MessageBuilder photoAlbum(MessageBuilder $self, InputStream items)
Sends a group of photos as an album.
- Parameters:
items- List of streams to read the media items.
-
videoAlbum
final static MessageBuilder videoAlbum(MessageBuilder $self, String itemsRefs)
Sends a group of videos as an album.
- Parameters:
itemsRefs- List of URLs or a client-specific ids of the media to send.
-
videoAlbum
final static MessageBuilder videoAlbum(MessageBuilder $self, InputStream items)
Sends a group of videos as an album.
- Parameters:
items- List of streams to read the media items.
-
contact
final static MessageBuilder contact(MessageBuilder $self, String phoneNumber, String firstName, String lastName, String vCard)
Sends a contact from the address book.
- Parameters:
phoneNumber- Contact phone number.firstName- Contact first name.lastName- Contact last name.vCard- Additional vcard information.
-
location
final static MessageBuilder location(MessageBuilder $self, Float latitude, Float longitude, Float horizontalAccuracy, Integer livePeriod, Integer heading, Integer proximityAlertRadius)
Sends a location.
- Parameters:
latitude- Latitude of the location.longitude- Longitude of the location.horizontalAccuracy- The radius of uncertainty for the location, measured in meters; 0-1500.livePeriod- Period in seconds for which the location will be updated, should be between 60 and 86400.heading- For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters.proximityAlertRadius- For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters.
-
parseMode
final static MessageBuilder parseMode(MessageBuilder $self, ParseMode parseMode)
Mode for parsing entities in the animation caption. See formatting options for more details.
- Parameters:
parseMode- Parse mode to use for parsing the message.
-
disableNotification
final static MessageBuilder disableNotification(MessageBuilder $self)
Sends the message silently. Users will receive a notification with no sound.
-
replyMarkup
final static MessageBuilder replyMarkup(MessageBuilder $self, ReplyMarkup replyMarkup)
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
- Parameters:
replyMarkup- One of the supported reply markups.
-
disableLinkPreview
final static MessageBuilder disableLinkPreview(MessageBuilder $self)
Disables link previews for links in this message.
-
-
-
-