-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Bot API 7.0 #300
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ Gemfile.lock | |
.bundle/ | ||
.env | ||
pkg/ | ||
tmp/ | ||
vendor/bundle/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
module Telegram | ||
module Bot | ||
module Types | ||
class ChatBoost < Base | ||
attribute :boost_id, Types::String | ||
attribute :add_date, Types::Integer | ||
attribute :expiration_date, Types::Integer | ||
attribute :source, ChatBoostSource | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
module Telegram | ||
module Bot | ||
module Types | ||
class ChatBoostRemoved < Base | ||
attribute :chat, Chat | ||
attribute :boost_id, Types::String | ||
attribute :remove_date, Types::Integer | ||
attribute :source, ChatBoostSource | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
module Telegram | ||
module Bot | ||
module Types | ||
ChatBoostSource = ( # rubocop:disable Naming/ConstantName | ||
ChatBoostSourcePremium | | ||
ChatBoostSourceGiftCode | | ||
ChatBoostSourceGiveaway | ||
) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# frozen_string_literal: true | ||
|
||
module Telegram | ||
module Bot | ||
module Types | ||
class ChatBoostSourceGiftCode < Base | ||
attribute :source, Types::String.constrained(eql: 'gift_code').default('gift_code') | ||
attribute :user, User | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
module Telegram | ||
module Bot | ||
module Types | ||
class ChatBoostSourceGiveaway < Base | ||
attribute :source, Types::String.constrained(eql: 'giveaway').default('giveaway') | ||
attribute :giveaway_message_id, Types::Integer | ||
attribute? :user, User | ||
attribute? :is_unclaimed, Types::True | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# frozen_string_literal: true | ||
|
||
module Telegram | ||
module Bot | ||
module Types | ||
class ChatBoostSourcePremium < Base | ||
attribute :source, Types::String.constrained(eql: 'premium').default('premium') | ||
attribute :user, User | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# frozen_string_literal: true | ||
|
||
module Telegram | ||
module Bot | ||
module Types | ||
class ChatBoostUpdated < Base | ||
attribute :chat, Chat | ||
attribute :boost, ChatBoost | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# frozen_string_literal: true | ||
|
||
module Telegram | ||
module Bot | ||
module Types | ||
class ExternalReplyInfo < Base | ||
attribute :origin, MessageOrigin | ||
attribute? :chat, Chat | ||
attribute? :message_id, Types::Integer | ||
attribute? :link_preview_options, LinkPreviewOptions | ||
attribute? :animation, Animation | ||
attribute? :audio, Audio | ||
attribute? :document, Document | ||
attribute? :photo, Types::Array.of(PhotoSize) | ||
attribute? :sticker, Sticker | ||
attribute? :story, Story | ||
attribute? :video, Video | ||
attribute? :video_note, VideoNote | ||
attribute? :voice, Voice | ||
attribute? :has_media_spoiler, Types::True | ||
attribute? :contact, Contact | ||
attribute? :dice, Dice | ||
attribute? :game, Game | ||
attribute? :giveaway, Giveaway | ||
attribute? :giveaway_winners, GiveawayWinners | ||
attribute? :invoice, Invoice | ||
attribute? :location, Location | ||
attribute? :poll, Poll | ||
attribute? :venue, Venue | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
module Telegram | ||
module Bot | ||
module Types | ||
class Giveaway < Base | ||
attribute :chats, Types::Array.of(Chat) | ||
attribute :winners_selection_date, Types::Integer | ||
attribute :winner_count, Types::Integer | ||
attribute? :only_new_members, Types::True | ||
attribute? :has_public_winners, Types::True | ||
attribute? :prize_description, Types::String | ||
attribute? :country_codes, Types::Array.of(Types::String) | ||
attribute? :premium_subscription_month_count, Types::Integer | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
module Telegram | ||
module Bot | ||
module Types | ||
class GiveawayCompleted < Base | ||
attribute :winner_count, Types::Integer | ||
attribute? :unclaimed_prize_count, Types::Integer | ||
attribute? :giveaway_message, Message | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
module Telegram | ||
module Bot | ||
module Types | ||
class GiveawayCreated < Base | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Telegram | ||
module Bot | ||
module Types | ||
class GiveawayWinners < Base | ||
attribute :chat, Chat | ||
attribute :giveaway_message_id, Types::Integer | ||
attribute :winners_selection_date, Types::Integer | ||
attribute :winner_count, Types::Integer | ||
attribute :winners, Types::Array.of(User) | ||
attribute? :additional_chat_count, Types::Integer | ||
attribute? :premium_subscription_month_count, Types::Integer | ||
attribute? :unclaimed_prize_count, Types::Integer | ||
attribute? :only_new_members, Types::True | ||
attribute? :was_refunded, Types::True | ||
attribute? :prize_description, Types::String | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
module Telegram | ||
module Bot | ||
module Types | ||
class InaccessibleMessage < Base | ||
attribute :chat, Chat | ||
attribute :message_id, Types::Integer | ||
attribute :date, Types::Integer | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
module Telegram | ||
module Bot | ||
module Types | ||
class LinkPreviewOptions < Base | ||
attribute? :is_disabled, Types::Bool | ||
attribute? :url, Types::String | ||
attribute? :prefer_small_media, Types::Bool | ||
attribute? :prefer_large_media, Types::Bool | ||
attribute? :show_above_text, Types::Bool | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# frozen_string_literal: true | ||
|
||
module Telegram | ||
module Bot | ||
module Types | ||
MaybeInaccessibleMessage = ( # rubocop:disable Naming/ConstantName | ||
Message | | ||
InaccessibleMessage | ||
) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we really replace (remove the old one)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH, I don't know if we should. I plan to release it with 2.0 version, so breaking changes are possible. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see nothing what would break this library. I think the deletion of the old name will be in a new API release. But… it's just for backward compatibility, and we have our own, so it's up to you.
I personally see
request_user
withKeyboardButtonRequestUsers
type kind of confusing.