Download the PHP package amirrh6/litegram without Composer
On this page you can find all versions of the php package amirrh6/litegram. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download amirrh6/litegram
More information about amirrh6/litegram
Files in amirrh6/litegram
Package litegram
Short Description Lightweight PHP wrapper library for Telegram Bot API
License GPL-2.0-only
Informations about the package litegram
Litegram
Lightweight PHP wrapper library for Telegram Bot API
Bot API version: v7.11 (October 31, 2024) - Snapshot Link
PHP version: 8.3 - Unknown compatibility with earlier (8+) or later versions.
- Minimal, Doesn't get in your way
- Fully documented, Employs identical names for methods and classes as those found in the official API
- Uses Guzzle as the HTTP client
- Provides type hints for IDE autocompletion
Litegram is still in early development stages so expect bugs and non-backward compatible changes.
Use Github Issues for comments, bug reports and questions.
TODOs:
- [ ] Full implementation of all types (classes) and methods
- [ ] Provide built-in validations
- [ ] Concurrent (bulk) requests: Has been experimentally implemented for some methods
- [ ] Provide helper utilities (e.g. For formatting messages using HTML or Markdown) and builtin checks (e.g. Making sure the message text's length does not exceed 4096 chars)
- [ ] Async requests
- [ ] Better error handling (retry requests which failed due to network error etc ...)
- [ ] Update to Bot API 8.0
- [ ] Update to Bot API 8.1
- [ ] Update to Bot API 8.2
- [ ] Update to Bot API 8.3
Installation / Updating
composer require amirrh6/litegram dev-main
Usage and Examples
This file provides usage example for some primary methods.
History
Over a year ago, during my free time between university classes, I started working on another Telegram bot. I wanted to challenge myself by creating my own wrapper library for it. Although the bot project was eventually abandoned, I decided to revive the wrapper library, and here we are today.
License:
Classes and methods:
* Make sure you view this section on Github rather than Packagist as it doesn't display checkmarks correctly.
Getting updates
(4/4 methods implemented, 2/2 classes implemented)
- [X] Update
- [X] getUpdates
- [X] setWebhook
- [X] deleteWebhook
- [X] getWebhookInfo
- [X] WebhookInfo
Available types
(71/150 classes implemented)
- [X] User
-
_get_full_name()
helper method is provided by Litegram
- [X] Chat
- [X] ChatFullInfo
- [X] Message
- [X] MessageId
- [X] InaccessibleMessage
- [X] MaybeInaccessibleMessage : InaccessibleMessage | Message
- [X] MessageEntity
- [X] TextQuote
- [X] ExternalReplyInfo
- [X] ReplyParameters
- [X] MessageOrigin
- [ ] PhotoSize
- [ ] Animation
- [ ] Audio
- [ ] Document
- [ ] Story
- [ ] Video
- [ ] VideoNote
- [ ] Voice
- [ ] PaidMediaInfo
- [X] PaidMedia
-
- [X] PaidMediaPreview
-
- [X] PaidMediaPhoto
-
- [X] PaidMediaVideo
- [X] Contact
- [X] Dice
- [X] PollOption
- [X] InputPollOption
- [X] PollAnswer
- [X] Poll
- [ ] Location
- [ ] Venue
- [ ] WebAppData
- [ ] ProximityAlertTriggered
- [ ] MessageAutoDeleteTimerChanged
- [ ] ChatBoostAdded
- [ ] BackgroundFill
- [ ] BackgroundFillSolid
- [ ] BackgroundFillGradient
- [ ] BackgroundFillFreeformGradient
- [ ] BackgroundType
- [ ] BackgroundTypeFill
- [ ] BackgroundTypeWallpaper
- [ ] BackgroundTypePattern
- [ ] BackgroundTypeChatTheme
- [ ] ChatBackground
- [ ] ForumTopicCreated
- [ ] ForumTopicClosed
- [ ] ForumTopicEdited
- [ ] ForumTopicReopened
- [ ] GeneralForumTopicHidden
- [ ] GeneralForumTopicUnhidden
- [ ] SharedUser
- [ ] UsersShared
- [X] ChatShared
- [ ] WriteAccessAllowed
- [ ] VideoChatScheduled
- [ ] VideoChatStarted
- [ ] VideoChatEnded
- [ ] VideoChatParticipantsInvited
- [ ] GiveawayCreated
- [ ] Giveaway
- [ ] GiveawayWinners
- [ ] GiveawayCompleted
- [X] LinkPreviewOptions
- [ ] UserProfilePhotos
- [ ] File
- [X] WebAppInfo
- [X] ReplyKeyboardMarkup
- [X] KeyboardButton
- [X] KeyboardButtonRequestUsers
- [X] KeyboardButtonRequestChat
- [X] KeyboardButtonPollType
- [X] ReplyKeyboardRemove
- [X] InlineKeyboardMarkup
- [X] InlineKeyboardButton
- [X] LoginUrl
- [X] SwitchInlineQueryChosenChat
- [X] CopyTextButton
- [X] CallbackQuery
- [X] ForceReply
- [ ] ChatPhoto
- [ ] ChatInviteLink
- [ ] ChatAdministratorRights
- [X] ChatMemberUpdated
- [X] ChatMember
-
- [ ] ChatMemberOwner
-
- [ ] ChatMemberMember
-
- [ ] ChatMemberLeft
-
- [ ] ChatMemberBanned
- [X] ChatJoinRequest
- [ ] ChatPermissions
- [ ] Birthdate
- [ ] BusinessIntro
- [ ] BusinessLocation
- [ ] BusinessOpeningHoursInterval
- [ ] BusinessOpeningHours
- [ ] ChatLocation
- [X] ReactionType
-
- [X] ReactionTypePaid
- [ ] ReactionCount
- [ ] MessageReactionUpdated
- [ ] MessageReactionCountUpdated
- [ ] ForumTopic
- [X] BotCommand
- [X] BotCommandScope
- [X] BotName
- [X] BotDescription
- [X] BotShortDescription
- [X] MenuButton
-
- [ ] MenuButtonWebApp
- [X] ChatBoostSource
- [ ] ChatBoost
- [ ] ChatBoostUpdated
- [ ] ChatBoostRemoved
- [ ] UserChatBoosts
- [X] BusinessConnection
- [X] BusinessMessagesDeleted
- [X] ResponseParameters
- [X] InputMedia
-
- [ ] InputMediaPhoto
-
- [ ] InputMediaVideo
-
- [ ] InputMediaAudio
- [X] InputFile
- [X] InputPaidMedia
Available methods
(11/85 methods implemented)
* Every method here has a signature similar to:
See here for usage and examples.
- [X] getMe
- [X] logOut
- [X] close
- [X] sendMessage
- [X] forwardMessage
- [X] forwardMessages
- [X] copyMessage *
- [X] copyMessages
- [X] sendPhoto
- [ ] sendAudio
- [X] sendDocument
- [ ] sendVideo
- [ ] sendAnimation
- [ ] sendVoice
- [ ] sendVideoNote
- [ ] sendPaidMedia
- [ ] sendMediaGroup
- [ ] sendLocation
- [ ] sendVenue
- [ ] sendContact
- [ ] sendPoll
- [ ] sendDice
- [ ] sendChatAction
- [ ] setMessageReaction
- [ ] getUserProfilePhotos
- [ ] getFile
- [ ] banChatMember
- [ ] unbanChatMember
- [ ] restrictChatMember
- [ ] promoteChatMember
- [ ] setChatAdministratorCustomTitle
- [ ] banChatSenderChat
- [ ] unbanChatSenderChat
- [ ] setChatPermissions
- [ ] exportChatInviteLink
- [ ] createChatInviteLink
- [ ] editChatInviteLink
- [ ] createChatSubscriptionInviteLink
- [ ] editChatSubscriptionInviteLink
- [ ] revokeChatInviteLink
- [ ] approveChatJoinRequest
- [ ] declineChatJoinRequest
- [ ] setChatPhoto
- [ ] deleteChatPhoto
- [ ] setChatTitle
- [ ] setChatDescription
- [ ] pinChatMessage
- [ ] unpinChatMessage
- [ ] unpinAllChatMessages
- [ ] leaveChat
- [ ] getChat
- [ ] getChatAdministrators
- [ ] getChatMemberCount
- [ ] getChatMember
- [ ] setChatStickerSet
- [ ] deleteChatStickerSet
- [ ] getForumTopicIconStickers
- [ ] createForumTopic
- [ ] editForumTopic
- [ ] closeForumTopic
- [ ] reopenForumTopic
- [ ] deleteForumTopic
- [ ] unpinAllForumTopicMessages
- [ ] editGeneralForumTopic
- [ ] closeGeneralForumTopic
- [ ] reopenGeneralForumTopic
- [ ] hideGeneralForumTopic
- [ ] unhideGeneralForumTopic
- [ ] unpinAllGeneralForumTopicMessages
- [X] answerCallbackQuery
- [ ] getUserChatBoosts
- [ ] getBusinessConnection
- [ ] setMyCommands
- [ ] deleteMyCommands
- [ ] getMyCommands
- [ ] setMyName
- [ ] getMyName
- [ ] setMyDescription
- [ ] getMyDescription
- [ ] setMyShortDescription
- [ ] getMyShortDescription
- [ ] setChatMenuButton
- [ ] getChatMenuButton
- [ ] setMyDefaultAdministratorRights
- [ ] getMyDefaultAdministratorRights
* Experimental bulk (concurrent) version of this method is available. These methods are named like this: copyMessage()
---> _bulkCopyMessage()
Updating messages
(1/9 methods implemented)
- [X] editMessageText
- [ ] editMessageCaption
- [ ] editMessageMedia
- [ ] editMessageLiveLocation
- [ ] stopMessageLiveLocation
- [ ] editMessageReplyMarkup
- [ ] stopPoll
- [ ] deleteMessage
- [ ] deleteMessages
Stickers
(0/16 methods implemented, 0/4 classes implemented)
- [ ] Sticker
- [ ] StickerSet
- [ ] MaskPosition
- [ ] InputSticker
- [ ] sendSticker
- [ ] getStickerSet
- [ ] getCustomEmojiStickers
- [ ] uploadStickerFile
- [ ] createNewStickerSet
- [ ] addStickerToSet
- [ ] setStickerPositionInSet
- [ ] deleteStickerFromSet
- [ ] replaceStickerInSet
- [ ] setStickerEmojiList
- [ ] setStickerKeywords
- [ ] setStickerMaskPosition
- [ ] setStickerSetTitle
- [ ] setStickerSetThumbnail
- [ ] setCustomEmojiStickerSetThumbnail
- [ ] deleteStickerSet
Inline mode
(0/2 methods implemented, 3/29 classes implemented + 2 union types)
- [X] InlineQuery
- [ ] answerInlineQuery
- [X] InlineQueryResultsButton
- InlineQueryResult
- InputMessageContent
- [X] ChosenInlineResult
- [ ] answerWebAppQuery
- [ ] SentWebAppMessage
Payments
(0/6 methods implemented, 3/19 classes implemented + 2 union types)
- [ ] sendInvoice
- [ ] createInvoiceLink
- [ ] answerShippingQuery
- [ ] answerPreCheckoutQuery
- [ ] getStarTransactions
- [ ] refundStarPayment
- [ ] LabeledPrice
- [ ] Invoice
- [ ] ShippingAddress
- [ ] OrderInfo
- [ ] ShippingOption
- [ ] SuccessfulPayment
- [ ] RefundedPayment
- [X] ShippingQuery
- [X] PreCheckoutQuery
- [X] PaidMediaPurchased
- RevenueWithdrawalState
- TransactionPartner
- [ ] StarTransaction
- [ ] StarTransactions
Telegram Passport
(0/1 methods implemented, 0/13 classes implemented + 1 union type)
- [ ] PassportData
- [ ] PassportFile
- [ ] EncryptedPassportElement
- [ ] EncryptedCredentials
- [ ] setPassportDataErrors
- PassportElementError
Games
(0/3 methods implemented, 0/3 classes implemented)
- [ ] sendGame
- [ ] Game
- [ ] CallbackGame
- [ ] setGameScore
- [ ] setGameHighScores
- [ ] GameHighScore