Skip to content
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

Update telegram API to 4.5 #42

Merged
merged 1 commit into from
Dec 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased
- Warn when fetching token by bot's name and there are no token
- Update Telegram API to 4.5

## [0.8.1]
- Add the ability to configure custom tesla middlewares
Expand Down
40 changes: 36 additions & 4 deletions lib/ex_gram.ex
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,13 @@ defmodule ExGram do
true
)

method(
:post,
"setChatAdministratorCustomTitle",
[{chat_id, [:integer, :string]}, {user_id, [:integer]}, {custom_title, [:string]}],
true
)

method(
:post,
"setChatPermissions",
Expand Down Expand Up @@ -679,7 +686,7 @@ defmodule ExGram do
[ExGram.Model.GameHighScore]
)

# 65 methods
# 66 methods

# ----------MODELS-----------

Expand Down Expand Up @@ -731,6 +738,7 @@ defmodule ExGram do
{:invite_link, :string},
{:pinned_message, Message},
{:permissions, ChatPermissions},
{:slow_mode_delay, :integer},
{:sticker_set_name, :string},
{:can_set_sticker_set, :boolean}
])
Expand Down Expand Up @@ -795,13 +803,15 @@ defmodule ExGram do

model(PhotoSize, [
{:file_id, :string},
{:file_unique_id, :string},
{:width, :integer},
{:height, :integer},
{:file_size, :integer}
])

model(Audio, [
{:file_id, :string},
{:file_unique_id, :string},
{:duration, :integer},
{:performer, :string},
{:title, :string},
Expand All @@ -812,6 +822,7 @@ defmodule ExGram do

model(Document, [
{:file_id, :string},
{:file_unique_id, :string},
{:thumb, PhotoSize},
{:file_name, :string},
{:mime_type, :string},
Expand All @@ -820,6 +831,7 @@ defmodule ExGram do

model(Video, [
{:file_id, :string},
{:file_unique_id, :string},
{:width, :integer},
{:height, :integer},
{:duration, :integer},
Expand All @@ -830,6 +842,7 @@ defmodule ExGram do

model(Animation, [
{:file_id, :string},
{:file_unique_id, :string},
{:width, :integer},
{:height, :integer},
{:duration, :integer},
Expand All @@ -841,13 +854,15 @@ defmodule ExGram do

model(Voice, [
{:file_id, :string},
{:file_unique_id, :string},
{:duration, :integer},
{:mime_type, :string},
{:file_size, :integer}
])

model(VideoNote, [
{:file_id, :string},
{:file_unique_id, :string},
{:length, :integer},
{:duration, :integer},
{:thumb, PhotoSize},
Expand Down Expand Up @@ -883,7 +898,12 @@ defmodule ExGram do

model(UserProfilePhotos, [{:total_count, :integer}, {:photos, {:array, {:array, PhotoSize}}}])

model(File, [{:file_id, :string}, {:file_size, :integer}, {:file_path, :string}])
model(File, [
{:file_id, :string},
{:file_unique_id, :string},
{:file_size, :integer},
{:file_path, :string}
])

model(ReplyKeyboardMarkup, [
{:keyboard, {:array, {:array, KeyboardButton}}},
Expand Down Expand Up @@ -932,11 +952,17 @@ defmodule ExGram do

model(ForceReply, [{:force_reply, :boolean}, {:selective, :boolean}])

model(ChatPhoto, [{:small_file_id, :string}, {:big_file_id, :string}])
model(ChatPhoto, [
{:small_file_id, :string},
{:small_file_unique_id, :string},
{:big_file_id, :string},
{:big_file_unique_id, :string}
])

model(ChatMember, [
{:user, User},
{:status, :string},
{:custom_title, :string},
{:until_date, :integer},
{:can_be_edited, :boolean},
{:can_post_messages, :boolean},
Expand Down Expand Up @@ -1036,6 +1062,7 @@ defmodule ExGram do

model(Sticker, [
{:file_id, :string},
{:file_unique_id, :string},
{:width, :integer},
{:height, :integer},
{:is_animated, :boolean},
Expand Down Expand Up @@ -1420,7 +1447,12 @@ defmodule ExGram do
{:credentials, EncryptedCredentials}
])

model(PassportFile, [{:file_id, :string}, {:file_size, :integer}, {:file_date, :integer}])
model(PassportFile, [
{:file_id, :string},
{:file_unique_id, :string},
{:file_size, :integer},
{:file_date, :integer}
])

model(EncryptedPassportElement, [
{:type, :string},
Expand Down