diff options
Diffstat (limited to 'protocols/Telegram/tdlib/td')
87 files changed, 6024 insertions, 1388 deletions
diff --git a/protocols/Telegram/tdlib/td/CMake/AddCXXCompilerFlag.cmake b/protocols/Telegram/tdlib/td/CMake/AddCXXCompilerFlag.cmake index 2162dadb26..6fb615a1f7 100644 --- a/protocols/Telegram/tdlib/td/CMake/AddCXXCompilerFlag.cmake +++ b/protocols/Telegram/tdlib/td/CMake/AddCXXCompilerFlag.cmake @@ -21,14 +21,14 @@ include(CheckCXXCompilerFlag) function(mangle_compiler_flag FLAG OUTPUT) string(TOUPPER "HAVE_CXX_FLAG_${FLAG}" SANITIZED_FLAG) - string(REPLACE "+" "X" SANITIZED_FLAG "${SANITIZED_FLAG}") + string(REPLACE "+" "X" SANITIZED_FLAG ${SANITIZED_FLAG}) string(REGEX REPLACE "[^A-Za-z_0-9]" "_" SANITIZED_FLAG ${SANITIZED_FLAG}) string(REGEX REPLACE "_+" "_" SANITIZED_FLAG ${SANITIZED_FLAG}) set(${OUTPUT} "${SANITIZED_FLAG}" PARENT_SCOPE) endfunction(mangle_compiler_flag) function(add_cxx_compiler_flag FLAG) - string(REPLACE "-Wno-" "-W" MAIN_FLAG "${FLAG}") + string(REPLACE "-Wno-" "-W" MAIN_FLAG ${FLAG}) mangle_compiler_flag("${MAIN_FLAG}" MANGLED_FLAG_NAME) if (DEFINED CMAKE_REQUIRED_FLAGS) set(OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") diff --git a/protocols/Telegram/tdlib/td/CMake/FindAtomics.cmake b/protocols/Telegram/tdlib/td/CMake/FindAtomics.cmake new file mode 100644 index 0000000000..a855132581 --- /dev/null +++ b/protocols/Telegram/tdlib/td/CMake/FindAtomics.cmake @@ -0,0 +1,62 @@ +# Original issue: +# * https://gitlab.kitware.com/cmake/cmake/-/issues/23021#note_1098733 +# +# For reference: +# * https://gcc.gnu.org/wiki/Atomic/GCCMM +# +# riscv64 specific: +# * https://lists.debian.org/debian-riscv/2022/01/msg00009.html +# +# ATOMICS_FOUND - system has C++ atomics +# ATOMICS_LIBRARIES - libraries needed to use C++ atomics + +if (ATOMICS_FOUND) + return() +endif() + +include(CheckCXXSourceCompiles) + +# RISC-V only has 32-bit and 64-bit atomic instructions. GCC is supposed +# to convert smaller atomics to those larger ones via masking and +# shifting like LLVM, but it's a known bug that it does not. This means +# anything that wants to use atomics on 1-byte or 2-byte types needs +# to link atomic library, but not 4-byte or 8-byte (though it does no harm). +set(ATOMIC_CODE + " + #include <atomic> + #include <cstdint> + std::atomic<std::uint8_t> n8{0}; // riscv64 + std::atomic<std::uint64_t> n64{0}; // armel, mipsel, powerpc + int main() { + ++n8; + ++n64; + }") + +set(ATOMICS_LIBS " " "-latomic") +if (CMAKE_SYSTEM_NAME MATCHES "NetBSD") + set(ATOMICS_LIBS "${ATOMICS_LIBS}" /usr/pkg/gcc12/x86_64--netbsd/lib/libatomic.so /usr/pkg/gcc12/i486--netbsdelf/lib/libatomic.so) +endif() + +foreach (ATOMICS_LIBRARY ${ATOMICS_LIBS}) + unset(ATOMICS_FOUND CACHE) + set(CMAKE_REQUIRED_LIBRARIES "${ATOMICS_LIBRARY}") + check_cxx_source_compiles("${ATOMIC_CODE}" ATOMICS_FOUND) + unset(CMAKE_REQUIRED_LIBRARIES) + if (ATOMICS_FOUND) + if (NOT ATOMICS_LIBRARY STREQUAL " ") + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Atomics DEFAULT_MSG ATOMICS_LIBRARY) + set(ATOMICS_LIBRARIES "${ATOMICS_LIBRARY}" CACHE STRING "Atomic library" FORCE) + else() + set(ATOMICS_LIBRARIES "" CACHE STRING "Atomic operations library" FORCE) + endif() + break() + endif() +endforeach() +if (Atomics_FIND_REQUIRED AND NOT ATOMICS_FOUND) + message(FATAL_ERROR "Atomic operations library isn't found.") +endif() + +unset(ATOMICS_LIBRARY) +unset(ATOMICS_LIBS) +unset(ATOMIC_CODE) diff --git a/protocols/Telegram/tdlib/td/CMake/GeneratePkgConfig.cmake b/protocols/Telegram/tdlib/td/CMake/GeneratePkgConfig.cmake index afbe06ac60..a2800e1073 100644 --- a/protocols/Telegram/tdlib/td/CMake/GeneratePkgConfig.cmake +++ b/protocols/Telegram/tdlib/td/CMake/GeneratePkgConfig.cmake @@ -27,6 +27,7 @@ function(get_relative_link OUTPUT PATH) set(${OUTPUT} "${LINK}" PARENT_SCOPE) endfunction() +# TODO: support interface libraries in dependencies function(generate_pkgconfig TARGET DESCRIPTION) # message("Generating pkg-config for ${TARGET}") get_filename_component(PREFIX "${CMAKE_INSTALL_PREFIX}" REALPATH) diff --git a/protocols/Telegram/tdlib/td/CMake/GetGitRevisionDescription.cmake b/protocols/Telegram/tdlib/td/CMake/GetGitRevisionDescription.cmake index 420772966c..724d078216 100644 --- a/protocols/Telegram/tdlib/td/CMake/GetGitRevisionDescription.cmake +++ b/protocols/Telegram/tdlib/td/CMake/GetGitRevisionDescription.cmake @@ -71,7 +71,7 @@ function(get_git_head_revision _refspecvar _hashvar) return() endif() - find_package(Git) + find_package(Git QUIET) # Check if the current source dir is a git submodule or a worktree. # In both cases .git is a file instead of a directory. diff --git a/protocols/Telegram/tdlib/td/CMake/TdSetUpCompiler.cmake b/protocols/Telegram/tdlib/td/CMake/TdSetUpCompiler.cmake index 536c5efb29..747d0aaa75 100644 --- a/protocols/Telegram/tdlib/td/CMake/TdSetUpCompiler.cmake +++ b/protocols/Telegram/tdlib/td/CMake/TdSetUpCompiler.cmake @@ -1,4 +1,4 @@ -# - Configures C++14 compiler, setting TDLib-specific compilation options. +# Configures C++14 compiler, setting TDLib-specific compilation options. function(td_set_up_compiler) set(CMAKE_EXPORT_COMPILE_COMMANDS 1 PARENT_SCOPE) @@ -62,6 +62,8 @@ function(td_set_up_compiler) set(TD_LINKER_FLAGS "-Wl,-z,ignore") elseif (EMSCRIPTEN) set(TD_LINKER_FLAGS "-Wl,--gc-sections") + elseif (ANDROID) + set(TD_LINKER_FLAGS "-Wl,--gc-sections -Wl,--exclude-libs,ALL -Wl,--icf=safe") else() set(TD_LINKER_FLAGS "-Wl,--gc-sections -Wl,--exclude-libs,ALL") endif() @@ -121,8 +123,12 @@ function(td_set_up_compiler) add_cxx_compiler_flag("-Wdeprecated") add_cxx_compiler_flag("-Wno-unused-command-line-argument") add_cxx_compiler_flag("-Qunused-arguments") + add_cxx_compiler_flag("-Wno-unknown-warning-option") add_cxx_compiler_flag("-Wodr") add_cxx_compiler_flag("-flto-odr-type-merging") + add_cxx_compiler_flag("-Wno-psabi") + add_cxx_compiler_flag("-Wunused-member-function") + add_cxx_compiler_flag("-Wunused-private-field") # add_cxx_compiler_flag("-Werror") @@ -135,7 +141,7 @@ function(td_set_up_compiler) # add_cxx_compiler_flag("-Wzero-as-null-pointer-constant") endif() - if (GCC AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)) + if (GCC) add_cxx_compiler_flag("-Wno-maybe-uninitialized") # too many false positives endif() if (WIN32 AND GCC AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)) @@ -154,6 +160,10 @@ function(td_set_up_compiler) # https://stackoverflow.com/questions/26744556/warning-returning-a-captured-reference-from-a-lambda add_cxx_compiler_flag("-Wno-return-stack-address") endif() + if (GCC AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0)) + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104030 + add_cxx_compiler_flag("-Wbidi-chars=none") + endif() if (MINGW) add_cxx_compiler_flag("-ftrack-macro-expansion=0") diff --git a/protocols/Telegram/tdlib/td/CMake/iOS.cmake b/protocols/Telegram/tdlib/td/CMake/iOS.cmake index 55e3f42c18..4ef76bd0f6 100644 --- a/protocols/Telegram/tdlib/td/CMake/iOS.cmake +++ b/protocols/Telegram/tdlib/td/CMake/iOS.cmake @@ -45,7 +45,7 @@ set (CMAKE_OSX_DEPLOYMENT_TARGET "" CACHE STRING "Force unset of the deployment # Determine the cmake host system version so we know where to find the iOS SDKs find_program (CMAKE_UNAME uname /bin /usr/bin /usr/local/bin) if (CMAKE_UNAME) - exec_program(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION) + execute_process(COMMAND uname -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) string (REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" DARWIN_MAJOR_VERSION "${CMAKE_HOST_SYSTEM_VERSION}") endif (CMAKE_UNAME) @@ -114,6 +114,23 @@ elseif (IOS_PLATFORM STREQUAL "TVSIMULATOR") set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-tvsimulator") set (APPLE_TV True) +elseif (IOS_PLATFORM STREQUAL "VISIONOS") + set (IOS_PLATFORM_LOCATION "XROS.platform") + set (XCODE_IOS_PLATFORM xros) + + # This causes the installers to properly locate the output libraries + set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-xros") + + set (APPLE_VISION True) +elseif (IOS_PLATFORM STREQUAL "VISIONSIMULATOR") + set (SIMULATOR_FLAG true) + set (IOS_PLATFORM_LOCATION "XRSimulator.platform") + set (XCODE_IOS_PLATFORM xros-simulator) + + # This causes the installers to properly locate the output libraries + set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-xrsimulator") + + set (APPLE_VISION True) else (IOS_PLATFORM STREQUAL "OS") message (FATAL_ERROR "Unsupported IOS_PLATFORM value selected. Please choose OS, SIMULATOR, or WATCHOS.") endif () @@ -163,7 +180,7 @@ set (IOS_DEPLOYMENT_TARGET ${IOS_DEPLOYMENT_TARGET} CACHE STRING "Minimum iOS ve # Setup iOS developer location unless specified manually with CMAKE_IOS_DEVELOPER_ROOT # Note Xcode 4.3 changed the installation location, choose the most recent one available -exec_program(/usr/bin/xcode-select ARGS -print-path OUTPUT_VARIABLE CMAKE_XCODE_DEVELOPER_DIR) +execute_process(COMMAND /usr/bin/xcode-select -print-path OUTPUT_VARIABLE CMAKE_XCODE_DEVELOPER_DIR OUTPUT_STRIP_TRAILING_WHITESPACE) set (XCODE_POST_43_ROOT "${CMAKE_XCODE_DEVELOPER_DIR}/Platforms/${IOS_PLATFORM_LOCATION}/Developer") set (XCODE_PRE_43_ROOT "/Developer/Platforms/${IOS_PLATFORM_LOCATION}/Developer") if (NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT) @@ -195,17 +212,27 @@ set (CMAKE_OSX_SYSROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Sysroot used for iOS su # Set the architectures unless specified manually with IOS_ARCH if (NOT DEFINED IOS_ARCH) if (IOS_PLATFORM STREQUAL "OS") - set (IOS_ARCH "armv7;armv7s;arm64") + set (IOS_ARCH "arm64") elseif (IOS_PLATFORM STREQUAL "SIMULATOR") - set (IOS_ARCH "i386;x86_64;arm64") + set (IOS_ARCH "x86_64;arm64") elseif (IOS_PLATFORM STREQUAL "WATCHOS") set (IOS_ARCH "armv7k;arm64_32;arm64") + + # Include C++ Standard Library for Xcode 15 builds. + include_directories(SYSTEM "${CMAKE_IOS_SDK_ROOT}/usr/include/c++/v1") elseif (IOS_PLATFORM STREQUAL "WATCHSIMULATOR") - set (IOS_ARCH "i386;x86_64;arm64") + set (IOS_ARCH "x86_64;arm64") + + # Include C++ Standard Library for Xcode 15 builds. + include_directories(SYSTEM "${CMAKE_IOS_SDK_ROOT}/usr/include/c++/v1") elseif (IOS_PLATFORM STREQUAL "TVOS") set (IOS_ARCH "arm64") elseif (IOS_PLATFORM STREQUAL "TVSIMULATOR") set (IOS_ARCH "x86_64;arm64") + elseif (IOS_PLATFORM STREQUAL "VISIONOS") + set (IOS_ARCH "arm64") + elseif (IOS_PLATFORM STREQUAL "VISIONSIMULATOR") + set (IOS_ARCH "x86_64;arm64") endif() endif() message (STATUS "The iOS architectures: ${IOS_ARCH}") diff --git a/protocols/Telegram/tdlib/td/benchmark/CMakeLists.txt b/protocols/Telegram/tdlib/td/benchmark/CMakeLists.txt index 53fbdede52..cdf359e956 100644 --- a/protocols/Telegram/tdlib/td/benchmark/CMakeLists.txt +++ b/protocols/Telegram/tdlib/td/benchmark/CMakeLists.txt @@ -7,7 +7,7 @@ if (NOT OPENSSL_FOUND) find_package(ZLIB REQUIRED) endif() -#TODO: all benchmarks in one file +# TODO: all benchmarks in one file add_executable(bench_crypto bench_crypto.cpp) target_link_libraries(bench_crypto PRIVATE tdutils ${OPENSSL_CRYPTO_LIBRARY} ${CMAKE_DL_LIBS} ${ZLIB_LIBRARIES}) if (WIN32) @@ -38,7 +38,7 @@ add_executable(bench_http_reader bench_http_reader.cpp) target_link_libraries(bench_http_reader PRIVATE tdnet tdutils) add_executable(bench_handshake bench_handshake.cpp) -target_link_libraries(bench_handshake PRIVATE tdcore tdutils) +target_link_libraries(bench_handshake PRIVATE tdmtproto tdutils) add_executable(bench_db bench_db.cpp) target_link_libraries(bench_db PRIVATE tdactor tddb tdutils) diff --git a/protocols/Telegram/tdlib/td/benchmark/bench_actor.cpp b/protocols/Telegram/tdlib/td/benchmark/bench_actor.cpp index 7045b80292..c336547b13 100644 --- a/protocols/Telegram/tdlib/td/benchmark/bench_actor.cpp +++ b/protocols/Telegram/tdlib/td/benchmark/bench_actor.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/benchmark/bench_crypto.cpp b/protocols/Telegram/tdlib/td/benchmark/bench_crypto.cpp index 98db8cf1e7..307254c92b 100644 --- a/protocols/Telegram/tdlib/td/benchmark/bench_crypto.cpp +++ b/protocols/Telegram/tdlib/td/benchmark/bench_crypto.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/benchmark/bench_db.cpp b/protocols/Telegram/tdlib/td/benchmark/bench_db.cpp index b47fa98bb1..e4a1d617d0 100644 --- a/protocols/Telegram/tdlib/td/benchmark/bench_db.cpp +++ b/protocols/Telegram/tdlib/td/benchmark/bench_db.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/benchmark/bench_empty.cpp b/protocols/Telegram/tdlib/td/benchmark/bench_empty.cpp index bd51e9f464..1d2aeff92a 100644 --- a/protocols/Telegram/tdlib/td/benchmark/bench_empty.cpp +++ b/protocols/Telegram/tdlib/td/benchmark/bench_empty.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/benchmark/bench_handshake.cpp b/protocols/Telegram/tdlib/td/benchmark/bench_handshake.cpp index 853da05e3e..cf7bcb0b9c 100644 --- a/protocols/Telegram/tdlib/td/benchmark/bench_handshake.cpp +++ b/protocols/Telegram/tdlib/td/benchmark/bench_handshake.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/benchmark/bench_http.cpp b/protocols/Telegram/tdlib/td/benchmark/bench_http.cpp index a1ae4f6702..cf281eea68 100644 --- a/protocols/Telegram/tdlib/td/benchmark/bench_http.cpp +++ b/protocols/Telegram/tdlib/td/benchmark/bench_http.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/benchmark/bench_http_reader.cpp b/protocols/Telegram/tdlib/td/benchmark/bench_http_reader.cpp index b4e865ba7a..fcf72390d3 100644 --- a/protocols/Telegram/tdlib/td/benchmark/bench_http_reader.cpp +++ b/protocols/Telegram/tdlib/td/benchmark/bench_http_reader.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -47,6 +47,7 @@ class HttpReaderBench final : public td::Benchmark { td::HttpReader http_reader_; void start_up() final { + writer_ = {}; reader_ = writer_.extract_reader(); http_reader_.init(&reader_, 10000, 0); } @@ -74,6 +75,7 @@ class BufferBench final : public td::Benchmark { td::HttpReader http_reader_; void start_up() final { + writer_ = {}; reader_ = writer_.extract_reader(); } }; @@ -104,6 +106,7 @@ class FindBoundaryBench final : public td::Benchmark { td::HttpReader http_reader_; void start_up() final { + writer_ = {}; reader_ = writer_.extract_reader(); } }; diff --git a/protocols/Telegram/tdlib/td/benchmark/bench_http_server.cpp b/protocols/Telegram/tdlib/td/benchmark/bench_http_server.cpp index d41328e2ad..9eeecc956d 100644 --- a/protocols/Telegram/tdlib/td/benchmark/bench_http_server.cpp +++ b/protocols/Telegram/tdlib/td/benchmark/bench_http_server.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/benchmark/bench_http_server_cheat.cpp b/protocols/Telegram/tdlib/td/benchmark/bench_http_server_cheat.cpp index 8fc5abe01f..327549bc70 100644 --- a/protocols/Telegram/tdlib/td/benchmark/bench_http_server_cheat.cpp +++ b/protocols/Telegram/tdlib/td/benchmark/bench_http_server_cheat.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/benchmark/bench_http_server_fast.cpp b/protocols/Telegram/tdlib/td/benchmark/bench_http_server_fast.cpp index af23dfc9c5..1b9373b231 100644 --- a/protocols/Telegram/tdlib/td/benchmark/bench_http_server_fast.cpp +++ b/protocols/Telegram/tdlib/td/benchmark/bench_http_server_fast.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/benchmark/bench_log.cpp b/protocols/Telegram/tdlib/td/benchmark/bench_log.cpp index 3082350bfb..d031bd6511 100644 --- a/protocols/Telegram/tdlib/td/benchmark/bench_log.cpp +++ b/protocols/Telegram/tdlib/td/benchmark/bench_log.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/benchmark/bench_misc.cpp b/protocols/Telegram/tdlib/td/benchmark/bench_misc.cpp index 9089890fb9..bfde3ab7fa 100644 --- a/protocols/Telegram/tdlib/td/benchmark/bench_misc.cpp +++ b/protocols/Telegram/tdlib/td/benchmark/bench_misc.cpp @@ -1,12 +1,14 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // +#include "td/telegram/td_api.h" #include "td/telegram/telegram_api.h" #include "td/telegram/telegram_api.hpp" +#include "td/utils/algorithm.h" #include "td/utils/benchmark.h" #include "td/utils/common.h" #include "td/utils/logging.h" @@ -17,9 +19,12 @@ #include "td/utils/port/RwMutex.h" #include "td/utils/port/Stat.h" #include "td/utils/port/thread.h" +#include "td/utils/Random.h" #include "td/utils/Slice.h" #include "td/utils/SliceBuilder.h" +#include "td/utils/StackAllocator.h" #include "td/utils/Status.h" +#include "td/utils/StringBuilder.h" #include "td/utils/ThreadSafeCounter.h" #if !TD_WINDOWS @@ -46,11 +51,11 @@ class F { template <class T> void operator()(const T &x) const { - sum += static_cast<td::uint32>(x.get_id()); + sum += static_cast<td::uint32>(reinterpret_cast<std::uintptr_t>(&x)); } }; -BENCH(Call, "TL Call") { +BENCH(TlCall, "TL Call") { td::tl_object_ptr<td::telegram_api::Function> x = td::make_tl_object<td::telegram_api::account_getWallPapers>(0); td::uint32 res = 0; F f(res); @@ -60,6 +65,67 @@ BENCH(Call, "TL Call") { td::do_not_optimize_away(res); } +static td::td_api::object_ptr<td::td_api::file> get_file_object() { + return td::td_api::make_object<td::td_api::file>( + 12345, 123456, 123456, + td::td_api::make_object<td::td_api::localFile>( + "/android/data/0/data/org.telegram.data/files/photos/12345678901234567890_123.jpg", true, true, false, true, + 0, 123456, 123456), + td::td_api::make_object<td::td_api::remoteFile>("abacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacaba", + "abacabadabacabaeabacabadabacaba", false, true, 123456)); +} + +BENCH(ToStringIntSmall, "to_string<int> small") { + auto buf = td::StackAllocator::alloc(1000); + td::StringBuilder sb(buf.as_slice()); + for (int i = 0; i < n; i++) { + sb << td::Random::fast(0, 100); + sb.clear(); + } +} + +BENCH(ToStringIntBig, "to_string<int> big") { + auto buf = td::StackAllocator::alloc(1000); + td::StringBuilder sb(buf.as_slice()); + for (int i = 0; i < n; i++) { + sb << 1234567890; + sb.clear(); + } +} + +BENCH(TlToStringUpdateFile, "TL to_string updateFile") { + auto x = td::td_api::make_object<td::td_api::updateFile>(get_file_object()); + + std::size_t res = 0; + for (int i = 0; i < n; i++) { + res += to_string(x).size(); + } + td::do_not_optimize_away(res); +} + +BENCH(TlToStringMessage, "TL to_string message") { + auto x = td::td_api::make_object<td::td_api::message>(); + x->id_ = 123456000111; + x->sender_id_ = td::td_api::make_object<td::td_api::messageSenderUser>(123456000112); + x->chat_id_ = 123456000112; + x->sending_state_ = td::td_api::make_object<td::td_api::messageSendingStatePending>(0); + x->date_ = 1699999999; + auto photo = td::td_api::make_object<td::td_api::photo>(); + for (int i = 0; i < 4; i++) { + photo->sizes_.push_back(td::td_api::make_object<td::td_api::photoSize>( + "a", get_file_object(), 160, 160, + td::vector<td::int32>{10000, 20000, 30000, 50000, 70000, 90000, 120000, 150000, 180000, 220000})); + } + x->content_ = td::td_api::make_object<td::td_api::messagePhoto>( + std::move(photo), td::td_api::make_object<td::td_api::formattedText>(), false, false, false); + + std::size_t res = 0; + for (int i = 0; i < n; i++) { + res += to_string(x).size(); + } + td::do_not_optimize_away(res); +} + #if !TD_EVENTFD_UNSUPPORTED BENCH(EventFd, "EventFd") { td::EventFd fd; @@ -416,7 +482,7 @@ class IdDuplicateCheckerOld { static td::string get_description() { return "Old"; } - td::Status check(td::int64 message_id) { + td::Status check(td::uint64 message_id) { if (saved_message_ids_.size() == MAX_SAVED_MESSAGE_IDS) { auto oldest_message_id = *saved_message_ids_.begin(); if (message_id < oldest_message_id) { @@ -437,7 +503,7 @@ class IdDuplicateCheckerOld { private: static constexpr size_t MAX_SAVED_MESSAGE_IDS = 1000; - std::set<td::int64> saved_message_ids_; + std::set<td::uint64> saved_message_ids_; }; template <size_t MAX_SAVED_MESSAGE_IDS> @@ -446,7 +512,7 @@ class IdDuplicateCheckerNew { static td::string get_description() { return PSTRING() << "New" << MAX_SAVED_MESSAGE_IDS; } - td::Status check(td::int64 message_id) { + td::Status check(td::uint64 message_id) { auto insert_result = saved_message_ids_.insert(message_id); if (!insert_result.second) { return td::Status::Error(1, PSLICE() << "Ignore already processed message " << message_id); @@ -464,7 +530,7 @@ class IdDuplicateCheckerNew { } private: - std::set<td::int64> saved_message_ids_; + std::set<td::uint64> saved_message_ids_; }; class IdDuplicateCheckerNewOther { @@ -472,7 +538,7 @@ class IdDuplicateCheckerNewOther { static td::string get_description() { return "NewOther"; } - td::Status check(td::int64 message_id) { + td::Status check(td::uint64 message_id) { if (!saved_message_ids_.insert(message_id).second) { return td::Status::Error(1, PSLICE() << "Ignore already processed message " << message_id); } @@ -490,7 +556,7 @@ class IdDuplicateCheckerNewOther { private: static constexpr size_t MAX_SAVED_MESSAGE_IDS = 1000; - std::set<td::int64> saved_message_ids_; + std::set<td::uint64> saved_message_ids_; }; class IdDuplicateCheckerNewSimple { @@ -498,7 +564,7 @@ class IdDuplicateCheckerNewSimple { static td::string get_description() { return "NewSimple"; } - td::Status check(td::int64 message_id) { + td::Status check(td::uint64 message_id) { auto insert_result = saved_message_ids_.insert(message_id); if (!insert_result.second) { return td::Status::Error(1, "Ignore already processed message"); @@ -516,7 +582,7 @@ class IdDuplicateCheckerNewSimple { private: static constexpr size_t MAX_SAVED_MESSAGE_IDS = 1000; - std::set<td::int64> saved_message_ids_; + std::set<td::uint64> saved_message_ids_; }; template <size_t max_size> @@ -525,7 +591,7 @@ class IdDuplicateCheckerArray { static td::string get_description() { return PSTRING() << "Array" << max_size; } - td::Status check(td::int64 message_id) { + td::Status check(td::uint64 message_id) { if (end_pos_ == 2 * max_size) { std::copy_n(&saved_message_ids_[max_size], max_size, &saved_message_ids_[0]); end_pos_ = max_size; @@ -550,7 +616,7 @@ class IdDuplicateCheckerArray { } private: - std::array<td::int64, 2 * max_size> saved_message_ids_; + std::array<td::uint64, 2 * max_size> saved_message_ids_; std::size_t end_pos_ = 0; }; @@ -632,9 +698,75 @@ class DuplicateCheckerBenchEvenOdd final : public td::Benchmark { } }; +BENCH(AddToTopStd, "add_to_top std") { + td::vector<int> v; + for (int i = 0; i < n; i++) { + for (size_t j = 0; j < 10; j++) { + auto value = td::Random::fast(0, 9); + auto it = std::find(v.begin(), v.end(), value); + if (it == v.end()) { + if (v.size() == 8) { + v.back() = value; + } else { + v.push_back(value); + } + it = v.end() - 1; + } + std::rotate(v.begin(), it, it + 1); + } + } +} + +BENCH(AddToTopTd, "add_to_top td") { + td::vector<int> v; + for (int i = 0; i < n; i++) { + for (size_t j = 0; j < 10; j++) { + td::add_to_top(v, 8, td::Random::fast(0, 9)); + } + } +} + +BENCH(AnyOfStd, "any_of std") { + td::vector<int> v; + for (int i = 0; i < 100; i++) { + v.push_back(i); + } + int res = 0; + for (int i = 0; i < n; i++) { + int rem = td::Random::fast(0, 127); + res += static_cast<int>(std::any_of(v.begin(), v.end(), [rem](int x) { return (x & 127) == rem; })); + } + td::do_not_optimize_away(res); +} + +BENCH(AnyOfTd, "any_of td") { + td::vector<int> v; + for (int i = 0; i < 100; i++) { + v.push_back(i); + } + int res = 0; + for (int i = 0; i < n; i++) { + int rem = td::Random::fast(0, 127); + res += static_cast<int>(td::any_of(v, [rem](int x) { return (x & 127) == rem; })); + } + td::do_not_optimize_away(res); +} + int main() { SET_VERBOSITY_LEVEL(VERBOSITY_NAME(DEBUG)); + td::bench(AnyOfStdBench()); + td::bench(AnyOfTdBench()); + + td::bench(ToStringIntSmallBench()); + td::bench(ToStringIntBigBench()); + + td::bench(AddToTopStdBench()); + td::bench(AddToTopTdBench()); + + td::bench(TlToStringUpdateFileBench()); + td::bench(TlToStringMessageBench()); + td::bench(DuplicateCheckerBenchEvenOdd<IdDuplicateCheckerNew<1000>>()); td::bench(DuplicateCheckerBenchEvenOdd<IdDuplicateCheckerNew<300>>()); td::bench(DuplicateCheckerBenchEvenOdd<IdDuplicateCheckerArray<1000>>()); @@ -691,7 +823,7 @@ int main() { td::bench(CreateFileBench()); td::bench(PwriteBench()); - td::bench(CallBench()); + td::bench(TlCallBench()); #if !TD_THREAD_UNSUPPORTED td::bench(ThreadNewBench()); #endif diff --git a/protocols/Telegram/tdlib/td/benchmark/bench_queue.cpp b/protocols/Telegram/tdlib/td/benchmark/bench_queue.cpp index c28554c757..30571fd69f 100644 --- a/protocols/Telegram/tdlib/td/benchmark/bench_queue.cpp +++ b/protocols/Telegram/tdlib/td/benchmark/bench_queue.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/benchmark/bench_tddb.cpp b/protocols/Telegram/tdlib/td/benchmark/bench_tddb.cpp index a2c4a80d32..b59589572e 100644 --- a/protocols/Telegram/tdlib/td/benchmark/bench_tddb.cpp +++ b/protocols/Telegram/tdlib/td/benchmark/bench_tddb.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/benchmark/check_proxy.cpp b/protocols/Telegram/tdlib/td/benchmark/check_proxy.cpp index dcf49b5976..72893c5063 100644 --- a/protocols/Telegram/tdlib/td/benchmark/check_proxy.cpp +++ b/protocols/Telegram/tdlib/td/benchmark/check_proxy.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/benchmark/check_tls.cpp b/protocols/Telegram/tdlib/td/benchmark/check_tls.cpp index 7b779dfdd0..9586df076e 100644 --- a/protocols/Telegram/tdlib/td/benchmark/check_tls.cpp +++ b/protocols/Telegram/tdlib/td/benchmark/check_tls.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/benchmark/hashmap_build.cpp b/protocols/Telegram/tdlib/td/benchmark/hashmap_build.cpp index c536ab6020..9953c3ce49 100644 --- a/protocols/Telegram/tdlib/td/benchmark/hashmap_build.cpp +++ b/protocols/Telegram/tdlib/td/benchmark/hashmap_build.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/benchmark/hashset_memory.cpp b/protocols/Telegram/tdlib/td/benchmark/hashset_memory.cpp index 18b9cd940c..fbd3a97290 100644 --- a/protocols/Telegram/tdlib/td/benchmark/hashset_memory.cpp +++ b/protocols/Telegram/tdlib/td/benchmark/hashset_memory.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/benchmark/rmdir.cpp b/protocols/Telegram/tdlib/td/benchmark/rmdir.cpp index ffc51828f4..0ae93bfe87 100644 --- a/protocols/Telegram/tdlib/td/benchmark/rmdir.cpp +++ b/protocols/Telegram/tdlib/td/benchmark/rmdir.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/benchmark/wget.cpp b/protocols/Telegram/tdlib/td/benchmark/wget.cpp index f29e02c1e1..a5aae5fba5 100644 --- a/protocols/Telegram/tdlib/td/benchmark/wget.cpp +++ b/protocols/Telegram/tdlib/td/benchmark/wget.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/memprof/memprof.cpp b/protocols/Telegram/tdlib/td/memprof/memprof.cpp index 334a072f23..e6564e66ad 100644 --- a/protocols/Telegram/tdlib/td/memprof/memprof.cpp +++ b/protocols/Telegram/tdlib/td/memprof/memprof.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/memprof/memprof.h b/protocols/Telegram/tdlib/td/memprof/memprof.h index 48c6bbbffa..a4729abc1d 100644 --- a/protocols/Telegram/tdlib/td/memprof/memprof.h +++ b/protocols/Telegram/tdlib/td/memprof/memprof.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/memprof/memprof_stat.cpp b/protocols/Telegram/tdlib/td/memprof/memprof_stat.cpp index a6c524a4e0..6bed0262a6 100644 --- a/protocols/Telegram/tdlib/td/memprof/memprof_stat.cpp +++ b/protocols/Telegram/tdlib/td/memprof/memprof_stat.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -41,7 +41,7 @@ static std::atomic<std::size_t> total_memory_used; void register_xalloc(malloc_info *info, std::int32_t diff) { my_assert(info->size >= 0); // TODO: this is very slow in case of several threads. - // Currently this statistics is intended only for memory benchmarks. + // Currently, the statistics are intended only for memory benchmarks. total_memory_used.fetch_add(diff * info->size, std::memory_order_relaxed); } diff --git a/protocols/Telegram/tdlib/td/memprof/memprof_stat.h b/protocols/Telegram/tdlib/td/memprof/memprof_stat.h index d04c57369c..cfcbd4c940 100644 --- a/protocols/Telegram/tdlib/td/memprof/memprof_stat.h +++ b/protocols/Telegram/tdlib/td/memprof/memprof_stat.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/sqlite/CMakeLists.txt b/protocols/Telegram/tdlib/td/sqlite/CMakeLists.txt index 1072a5a52c..82ceb04c8c 100644 --- a/protocols/Telegram/tdlib/td/sqlite/CMakeLists.txt +++ b/protocols/Telegram/tdlib/td/sqlite/CMakeLists.txt @@ -61,7 +61,7 @@ endif() if (GCC OR CLANG) target_compile_options(tdsqlite PRIVATE -Wno-deprecated-declarations -Wno-unused-variable -Wno-unused-const-variable -Wno-unused-function -Wno-maybe-uninitialized -Wno-return-local-addr) if (CLANG) - target_compile_options(tdsqlite PRIVATE -Wno-parentheses-equality -Wno-unused-value -Wno-unused-command-line-argument -Qunused-arguments) + target_compile_options(tdsqlite PRIVATE -Wno-parentheses-equality -Wno-unused-value -Wno-unknown-warning-option -Wno-unused-command-line-argument -Qunused-arguments) endif() if (GCC AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0)) target_compile_options(tdsqlite PRIVATE -Wno-return-local-addr -Wno-stringop-overflow) @@ -70,7 +70,7 @@ elseif (MSVC) target_compile_options(tdsqlite PRIVATE /wd4996) endif() -install(TARGETS tdsqlite EXPORT TdTargets +install(TARGETS tdsqlite EXPORT TdStaticTargets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ) diff --git a/protocols/Telegram/tdlib/td/td/generate/CMakeLists.txt b/protocols/Telegram/tdlib/td/td/generate/CMakeLists.txt index e7f6aea067..1ff2d3d81f 100644 --- a/protocols/Telegram/tdlib/td/td/generate/CMakeLists.txt +++ b/protocols/Telegram/tdlib/td/td/generate/CMakeLists.txt @@ -14,10 +14,14 @@ set(TL_TD_AUTO_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/auto PARENT_SCOPE) set(TD_AUTO_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/auto/td) -set(TL_TD_AUTO_SOURCE +set(TL_MTPROTO_AUTO_SOURCE ${TD_AUTO_INCLUDE_DIR}/mtproto/mtproto_api.cpp ${TD_AUTO_INCLUDE_DIR}/mtproto/mtproto_api.h ${TD_AUTO_INCLUDE_DIR}/mtproto/mtproto_api.hpp + PARENT_SCOPE +) + +set(TL_TD_AUTO_SOURCE ${TD_AUTO_INCLUDE_DIR}/telegram/telegram_api.cpp ${TD_AUTO_INCLUDE_DIR}/telegram/telegram_api.h ${TD_AUTO_INCLUDE_DIR}/telegram/telegram_api.hpp @@ -53,9 +57,7 @@ set(TL_DOTNET_AUTO_SOURCE PARENT_SCOPE ) -set(TL_GENERATE_COMMON_SOURCE - generate_common.cpp - +set(TL_WRITER_CPP_SOURCE tl_writer_cpp.cpp tl_writer_h.cpp tl_writer_hpp.cpp @@ -71,6 +73,14 @@ set(TL_GENERATE_COMMON_SOURCE tl_writer_td.h ) +set(TL_GENERATE_MTPROTO_SOURCE + generate_mtproto.cpp +) + +set(TL_GENERATE_COMMON_SOURCE + generate_common.cpp +) + set(TL_GENERATE_C_SOURCE generate_c.cpp @@ -101,7 +111,7 @@ if (NOT CMAKE_CROSSCOMPILING) endif() if (PHP_EXECUTABLE AND NOT TD_ENABLE_DOTNET) - set(GENERATE_COMMON_CMD generate_common && ${PHP_EXECUTABLE} DoxygenTlDocumentationGenerator.php scheme/td_api.tl auto/td/telegram/td_api.h) + set(GENERATE_COMMON_CMD generate_common && ${PHP_EXECUTABLE} ../DoxygenTlDocumentationGenerator.php ../scheme/td_api.tl td/telegram/td_api.h) else() set(GENERATE_COMMON_CMD generate_common) endif() @@ -129,10 +139,29 @@ if (NOT CMAKE_CROSSCOMPILING) DEPENDS tl-parser ${CMAKE_CURRENT_SOURCE_DIR}/scheme/mtproto_api.tl ${CMAKE_CURRENT_SOURCE_DIR}/scheme/secret_api.tl ${CMAKE_CURRENT_SOURCE_DIR}/scheme/td_api.tl ${CMAKE_CURRENT_SOURCE_DIR}/scheme/telegram_api.tl ) + add_library(tl_writer_cpp STATIC ${TL_WRITER_CPP_SOURCE}) + target_link_libraries(tl_writer_cpp PRIVATE tdtl) + target_include_directories(tl_writer_cpp PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>) + if (TD_ENABLE_JNI) + target_compile_definitions(tl_writer_cpp PRIVATE TD_ENABLE_JNI=1 GIT_COMMIT_HASH=${TD_GIT_COMMIT_HASH}) + endif() + if (TD_ENABLE_DOTNET) + target_compile_definitions(tl_writer_cpp PRIVATE DISABLE_HPP_DOCUMENTATION=1) + endif() + + add_executable(generate_mtproto ${TL_GENERATE_MTPROTO_SOURCE}) + target_link_libraries(generate_mtproto PRIVATE tdtl tl_writer_cpp) + add_custom_target(tl_generate_mtproto + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/auto + COMMAND generate_mtproto + COMMENT "Generate MTProto API source files" + DEPENDS generate_mtproto tl_generate_tlo ${TLO_FILES} + ) + add_executable(generate_common ${TL_GENERATE_COMMON_SOURCE}) - target_link_libraries(generate_common PRIVATE tdtl) + target_link_libraries(generate_common PRIVATE tdtl tl_writer_cpp) add_custom_target(tl_generate_common - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/auto COMMAND ${GENERATE_COMMON_CMD} COMMENT "Generate common TL source files" DEPENDS generate_common tl_generate_tlo ${TLO_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/scheme/td_api.tl ${CMAKE_CURRENT_SOURCE_DIR}/DoxygenTlDocumentationGenerator.php @@ -140,14 +169,11 @@ if (NOT CMAKE_CROSSCOMPILING) if (TD_ENABLE_JNI) target_compile_definitions(generate_common PRIVATE TD_ENABLE_JNI=1) endif() - if (TD_ENABLE_DOTNET) - target_compile_definitions(generate_common PRIVATE DISABLE_HPP_DOCUMENTATION=1) - endif() add_executable(generate_c ${TL_GENERATE_C_SOURCE}) target_link_libraries(generate_c PRIVATE tdtl) add_custom_target(tl_generate_c - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/auto COMMAND generate_c COMMENT "Generate C TL source files" DEPENDS generate_c tl_generate_tlo ${TD_API_TLO_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/scheme/td_api.tl @@ -155,11 +181,12 @@ if (NOT CMAKE_CROSSCOMPILING) add_executable(td_generate_java_api ${TL_GENERATE_JAVA_SOURCE}) target_link_libraries(td_generate_java_api PRIVATE tdtl) + target_compile_definitions(td_generate_java_api PRIVATE GIT_COMMIT_HASH=${TD_GIT_COMMIT_HASH}) add_executable(generate_json ${TL_GENERATE_JSON_SOURCE}) target_link_libraries(generate_json PRIVATE tdtl tdutils) add_custom_target(tl_generate_json - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/auto COMMAND generate_json COMMENT "Generate JSON TL source files" DEPENDS generate_json tl_generate_tlo ${TD_API_TLO_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/scheme/td_api.tl @@ -173,7 +200,7 @@ if (NOT CMAKE_CROSSCOMPILING) if (TD_ENABLE_DOTNET) if (PHP_EXECUTABLE) - set(GENERATE_DOTNET_API_CMD td_generate_dotnet_api ${TD_API_TLO_FILE} && ${PHP_EXECUTABLE} DotnetTlDocumentationGenerator.php scheme/td_api.tl auto/td/telegram/TdDotNetApi.h) + set(GENERATE_DOTNET_API_CMD td_generate_dotnet_api ${TD_API_TLO_FILE} && ${PHP_EXECUTABLE} ../DotnetTlDocumentationGenerator.php ../scheme/td_api.tl td/telegram/TdDotNetApi.h) else() set(GENERATE_DOTNET_API_CMD td_generate_dotnet_api ${TD_API_TLO_FILE}) endif() @@ -181,7 +208,7 @@ if (NOT CMAKE_CROSSCOMPILING) add_executable(td_generate_dotnet_api generate_dotnet.cpp tl_writer_dotnet.h) target_link_libraries(td_generate_dotnet_api PRIVATE tdtl) add_custom_target(generate_dotnet_api - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/auto COMMAND ${GENERATE_DOTNET_API_CMD} COMMENT "Generate .NET API files" DEPENDS td_generate_dotnet_api tl_generate_tlo ${TD_API_TLO_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/scheme/td_api.tl ${CMAKE_CURRENT_SOURCE_DIR}/DotnetTlDocumentationGenerator.php diff --git a/protocols/Telegram/tdlib/td/td/generate/DotnetTlDocumentationGenerator.php b/protocols/Telegram/tdlib/td/td/generate/DotnetTlDocumentationGenerator.php index da792b3620..f6bb561f32 100644 --- a/protocols/Telegram/tdlib/td/td/generate/DotnetTlDocumentationGenerator.php +++ b/protocols/Telegram/tdlib/td/td/generate/DotnetTlDocumentationGenerator.php @@ -11,7 +11,7 @@ class DotnetTlDocumentationGenerator extends TlDocumentationGenerator { return ucfirst(preg_replace_callback('/_([A-Za-z])/', function ($matches) {return strtoupper($matches[1]);}, $word_matches[0])); }, $doc); - $doc = htmlspecialchars($doc, ENT_XML1); + $doc = htmlspecialchars($doc, ENT_XML1, 'UTF-8'); $doc = str_replace('*/', '*/', $doc); return $doc; } @@ -177,9 +177,12 @@ EOT protected function addFieldDocumentation($class_name, $field_name, $type_name, $field_info, $may_be_null) { $end = ';'; - if (substr($type_name, 0, strlen($field_name)) === $field_name) { + if ($type_name == $field_name.'^' || ($type_name == 'Message^' && $field_name == 'ReplyToMessage')) { $type_name = '::Telegram::Td::Api::'.$type_name; $end = ' {'; + } else if ($class_name == "WebPage" && $field_name == "Stickers" && $type_name == "Array<Sticker^>^") { + $type_name = 'Array<::Telegram::Td::Api::Sticker^>^'; + $end = ' {'; } $full_line = $class_name." property $type_name $field_name$end"; $this->addDocumentation($full_line, <<<EOT diff --git a/protocols/Telegram/tdlib/td/td/generate/DoxygenTlDocumentationGenerator.php b/protocols/Telegram/tdlib/td/td/generate/DoxygenTlDocumentationGenerator.php index b9fca60f44..5fa507bafe 100644 --- a/protocols/Telegram/tdlib/td/td/generate/DoxygenTlDocumentationGenerator.php +++ b/protocols/Telegram/tdlib/td/td/generate/DoxygenTlDocumentationGenerator.php @@ -39,7 +39,7 @@ class DoxygenTlDocumentationGenerator extends TlDocumentationGenerator protected function escapeDocumentation($doc) { - $doc = htmlspecialchars($doc); + $doc = htmlspecialchars($doc, ENT_COMPAT, 'UTF-8'); $doc = preg_replace_callback('/"((http|https|tg):\/\/[^" ]*)"/', function ($quoted_link) { @@ -130,7 +130,7 @@ class DoxygenTlDocumentationGenerator extends TlDocumentationGenerator strpos($tline, 'result += ') === 0 || strpos($tline, 'result = ') || strpos($tline, ' : values') || strpos($line, 'JNIEnv') || strpos($line, 'jfieldID') || $tline === 'virtual ~Object() {' || $tline === 'virtual void store(TlStorerToString &s, const char *field_name) const = 0;' || - $tline === 'void set_package_name(const char *new_package_name);'; + $tline === 'const char *&get_package_name_ref();' || $tline === 'const char *get_git_commit_hash();'; } protected function isHeaderLine($line) @@ -235,11 +235,11 @@ EOT * auto get_me_request = td::td_api::make_object<td::td_api::getMe>(); * auto message_text = td::td_api::make_object<td::td_api::formattedText>("Hello, world!!!", * td::td_api::array<td::td_api::object_ptr<td::td_api::textEntity>>()); - * auto send_message_request = td::td_api::make_object<td::td_api::sendMessage>(chat_id, 0, 0, nullptr, nullptr, - * td::td_api::make_object<td::td_api::inputMessageText>(std::move(message_text), false, true)); + * auto send_message_request = td::td_api::make_object<td::td_api::sendMessage>(chat_id, 0, nullptr, nullptr, nullptr, + * td::td_api::make_object<td::td_api::inputMessageText>(std::move(message_text), nullptr, true)); * \\endcode * - * \\tparam Type Type of an object to construct. + * \\tparam Type Type of object to construct. * \\param[in] args Arguments to pass to the object constructor. * \\return Wrapped pointer to the created object. */ @@ -287,8 +287,8 @@ EOT * } * \\endcode * - * \\tparam ToType Type of a TDLib API object to move to. - * \\tparam FromType Type of a TDLib API object to move from, this is auto-deduced. + * \\tparam ToType Type of TDLib API object to move to. + * \\tparam FromType Type of TDLib API object to move from, this is auto-deduced. * \\param[in] from Wrapped in td::td_api::object_ptr pointer to a TDLib API object. */ EOT diff --git a/protocols/Telegram/tdlib/td/td/generate/JavadocTlDocumentationGenerator.php b/protocols/Telegram/tdlib/td/td/generate/JavadocTlDocumentationGenerator.php index 1d785dc0cb..c8729bba73 100644 --- a/protocols/Telegram/tdlib/td/td/generate/JavadocTlDocumentationGenerator.php +++ b/protocols/Telegram/tdlib/td/td/generate/JavadocTlDocumentationGenerator.php @@ -15,7 +15,7 @@ class JavadocTlDocumentationGenerator extends TlDocumentationGenerator { return preg_replace_callback('/_([A-Za-z])/', function ($matches) {return strtoupper($matches[1]);}, $word_matches[0]); }, $doc); - $doc = htmlspecialchars($doc); + $doc = htmlspecialchars($doc, ENT_COMPAT, 'UTF-8'); $doc = str_replace('*/', '*/', $doc); return $doc; } diff --git a/protocols/Telegram/tdlib/td/td/generate/TlDocumentationGenerator.php b/protocols/Telegram/tdlib/td/td/generate/TlDocumentationGenerator.php index 09c0f58c70..e46deafacb 100644 --- a/protocols/Telegram/tdlib/td/td/generate/TlDocumentationGenerator.php +++ b/protocols/Telegram/tdlib/td/td/generate/TlDocumentationGenerator.php @@ -42,6 +42,15 @@ abstract class TlDocumentationGenerator return ''; } + $brackets = preg_replace("/[^[\\](){}'\"]/", '', preg_replace("/[a-z]'/", '', $str)); + while (strlen($brackets)) { + $brackets = preg_replace(array('/[[]]/', '/[(][)]/', '/[{][}]/', "/''/", '/""/'), '', $brackets, -1, $replaced_bracket_count); + if ($replaced_bracket_count == 0) { + $this->printError('Unmatched bracket in '.$str); + break; + } + } + $len = strlen($str); if ($str[$len - 1] === '.') { return $str; @@ -66,7 +75,7 @@ abstract class TlDocumentationGenerator return substr($str, 0, -1).'.)'; } } else { - $this->printError("Unmatched bracket"); + $this->printError('Unmatched bracket'); } } return $str.'.'; diff --git a/protocols/Telegram/tdlib/td/td/generate/generate_c.cpp b/protocols/Telegram/tdlib/td/td/generate/generate_c.cpp index ecd7ca058f..83590fc785 100644 --- a/protocols/Telegram/tdlib/td/td/generate/generate_c.cpp +++ b/protocols/Telegram/tdlib/td/td/generate/generate_c.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -10,11 +10,8 @@ #include "td/tl/tl_generate.h" int main() { - td::tl::tl_config config_td = td::tl::read_tl_config_from_file("auto/tlo/td_api.tlo"); - td::tl::write_tl_to_file(config_td, "auto/td/telegram/td_tdc_api.h", - td::TlWriterCCommon("TdApi", 1, "#include \"td/telegram/td_api.h\"\n")); - td::tl::write_tl_to_file(config_td, "auto/td/telegram/td_tdc_api_inner.h", - td::TlWriterCCommon("TdApi", -1, "#include \"td/telegram/td_api.h\"\n")); - td::tl::write_tl_to_file(config_td, "auto/td/telegram/td_tdc_api.cpp", - td::TlWriterCCommon("TdApi", 0, "#include \"td/telegram/td_api.h\"\n")); + td::tl::tl_config config_td = td::tl::read_tl_config_from_file("tlo/td_api.tlo"); + td::tl::write_tl_to_file(config_td, "td/telegram/td_tdc_api.h", td::TlWriterCCommon("TdApi", 1)); + td::tl::write_tl_to_file(config_td, "td/telegram/td_tdc_api_inner.h", td::TlWriterCCommon("TdApi", -1)); + td::tl::write_tl_to_file(config_td, "td/telegram/td_tdc_api.cpp", td::TlWriterCCommon("TdApi", 0)); } diff --git a/protocols/Telegram/tdlib/td/td/generate/generate_common.cpp b/protocols/Telegram/tdlib/td/td/generate/generate_common.cpp index f295f95cfa..4fdc268825 100644 --- a/protocols/Telegram/tdlib/td/td/generate/generate_common.cpp +++ b/protocols/Telegram/tdlib/td/td/generate/generate_common.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -16,33 +16,33 @@ #include <string> #include <vector> -template <class WriterCpp = td::TD_TL_writer_cpp, class WriterH = td::TD_TL_writer_h, - class WriterHpp = td::TD_TL_writer_hpp> +template <bool generate_multiple_headers = false, class WriterCpp = td::TD_TL_writer_cpp, + class WriterH = td::TD_TL_writer_h, class WriterHpp = td::TD_TL_writer_hpp> static void generate_cpp(const std::string &directory, const std::string &tl_name, const std::string &string_type, const std::string &bytes_type, const std::vector<std::string> &ext_cpp_includes, const std::vector<std::string> &ext_h_includes) { std::string path = directory + "/" + tl_name; - td::tl::tl_config config = td::tl::read_tl_config_from_file("auto/tlo/" + tl_name + ".tlo"); + td::tl::tl_config config = td::tl::read_tl_config_from_file("tlo/" + tl_name + ".tlo"); td::tl::write_tl_to_file(config, path + ".cpp", WriterCpp(tl_name, string_type, bytes_type, ext_cpp_includes)); - td::tl::write_tl_to_file(config, path + ".h", WriterH(tl_name, string_type, bytes_type, ext_h_includes)); + if (generate_multiple_headers) { + td::tl::write_tl_to_multiple_files(config, path, ".h", WriterH(tl_name, string_type, bytes_type, ext_h_includes)); + } else { + td::tl::write_tl_to_file(config, path + ".h", WriterH(tl_name, string_type, bytes_type, ext_h_includes)); + } td::tl::write_tl_to_file(config, path + ".hpp", WriterHpp(tl_name, string_type, bytes_type)); } int main() { - generate_cpp<>("auto/td/telegram", "telegram_api", "std::string", "BufferSlice", + generate_cpp<>("td/telegram", "telegram_api", "std::string", "BufferSlice", {"\"td/tl/tl_object_parse.h\"", "\"td/tl/tl_object_store.h\""}, {"\"td/utils/buffer.h\""}); - generate_cpp<>("auto/td/telegram", "secret_api", "std::string", "BufferSlice", + generate_cpp<>("td/telegram", "secret_api", "std::string", "BufferSlice", {"\"td/tl/tl_object_parse.h\"", "\"td/tl/tl_object_store.h\""}, {"\"td/utils/buffer.h\""}); - generate_cpp<>("auto/td/mtproto", "mtproto_api", "Slice", "Slice", - {"\"td/tl/tl_object_parse.h\"", "\"td/tl/tl_object_store.h\""}, - {"\"td/utils/Slice.h\"", "\"td/utils/UInt.h\""}); - #ifdef TD_ENABLE_JNI - generate_cpp<td::TD_TL_writer_jni_cpp, td::TD_TL_writer_jni_h>( - "auto/td/telegram", "td_api", "std::string", "std::string", {"\"td/tl/tl_jni_object.h\""}, {"<string>"}); + generate_cpp<false, td::TD_TL_writer_jni_cpp, td::TD_TL_writer_jni_h>( + "td/telegram", "td_api", "std::string", "std::string", {"\"td/tl/tl_jni_object.h\""}, {"<string>"}); #else - generate_cpp<>("auto/td/telegram", "td_api", "std::string", "std::string", {}, {"<string>"}); + generate_cpp<>("td/telegram", "td_api", "std::string", "std::string", {}, {"<string>"}); #endif } diff --git a/protocols/Telegram/tdlib/td/td/generate/generate_dotnet.cpp b/protocols/Telegram/tdlib/td/td/generate/generate_dotnet.cpp index 1452e0a691..3194064250 100644 --- a/protocols/Telegram/tdlib/td/td/generate/generate_dotnet.cpp +++ b/protocols/Telegram/tdlib/td/td/generate/generate_dotnet.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -16,7 +16,7 @@ int main(int argc, char *argv[]) { td::tl::tl_config config_td = td::tl::read_tl_config_from_file(argv[1]); - td::tl::write_tl_to_file(config_td, "auto/td/telegram/TdDotNetApi.cpp", + td::tl::write_tl_to_file(config_td, "td/telegram/TdDotNetApi.cpp", td::tl::TlWriterDotNet("TdApi", false, "#include \"td/telegram/TdDotNetApi.h\"\n\n")); - td::tl::write_tl_to_file(config_td, "auto/td/telegram/TdDotNetApi.h", td::tl::TlWriterDotNet("TdApi", true, "")); + td::tl::write_tl_to_file(config_td, "td/telegram/TdDotNetApi.h", td::tl::TlWriterDotNet("TdApi", true, "")); } diff --git a/protocols/Telegram/tdlib/td/td/generate/generate_java.cpp b/protocols/Telegram/tdlib/td/td/generate/generate_java.cpp index 1a1e200bed..80468f5677 100644 --- a/protocols/Telegram/tdlib/td/td/generate/generate_java.cpp +++ b/protocols/Telegram/tdlib/td/td/generate/generate_java.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/td/generate/generate_json.cpp b/protocols/Telegram/tdlib/td/td/generate/generate_json.cpp index bff1368351..cf4383de92 100644 --- a/protocols/Telegram/tdlib/td/td/generate/generate_json.cpp +++ b/protocols/Telegram/tdlib/td/td/generate/generate_json.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -10,6 +10,6 @@ #include "td/tl/tl_generate.h" int main() { - td::gen_json_converter(td::tl::read_tl_config_from_file("auto/tlo/td_api.tlo"), "td/telegram/td_api_json", + td::gen_json_converter(td::tl::read_tl_config_from_file("tlo/td_api.tlo"), "td/telegram/td_api_json", td::tl::TL_writer::Server); } diff --git a/protocols/Telegram/tdlib/td/td/generate/generate_mtproto.cpp b/protocols/Telegram/tdlib/td/td/generate/generate_mtproto.cpp new file mode 100644 index 0000000000..e7d909094c --- /dev/null +++ b/protocols/Telegram/tdlib/td/td/generate/generate_mtproto.cpp @@ -0,0 +1,27 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#include "tl_writer_cpp.h" +#include "tl_writer_h.h" +#include "tl_writer_hpp.h" + +#include "td/tl/tl_config.h" +#include "td/tl/tl_generate.h" + +#include <string> + +int main() { + std::string tl_name = "mtproto_api"; + std::string path = "td/mtproto/" + tl_name; + td::tl::tl_config config = td::tl::read_tl_config_from_file("tlo/" + tl_name + ".tlo"); + td::tl::write_tl_to_file( + config, path + ".cpp", + td::TD_TL_writer_cpp(tl_name, "Slice", "Slice", {"\"td/tl/tl_object_parse.h\"", "\"td/tl/tl_object_store.h\""})); + td::tl::write_tl_to_file( + config, path + ".h", + td::TD_TL_writer_h(tl_name, "Slice", "Slice", {"\"td/utils/Slice.h\"", "\"td/utils/UInt.h\""})); + td::tl::write_tl_to_file(config, path + ".hpp", td::TD_TL_writer_hpp(tl_name, "Slice", "Slice")); +} diff --git a/protocols/Telegram/tdlib/td/td/generate/remove_documentation.cpp b/protocols/Telegram/tdlib/td/td/generate/remove_documentation.cpp index 435a905562..ad500654dc 100644 --- a/protocols/Telegram/tdlib/td/td/generate/remove_documentation.cpp +++ b/protocols/Telegram/tdlib/td/td/generate/remove_documentation.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -13,9 +13,9 @@ int main(int argc, char *argv[]) { for (int i = 1; i < argc; i++) { std::string file_name = argv[i]; - std::string old_contents = td::tl::get_file_contents(file_name, "rb"); + std::string old_contents = td::tl::get_file_contents(file_name); std::string new_contents = td::tl::remove_documentation(old_contents); - if (new_contents != old_contents && !td::tl::put_file_contents(file_name, "wb", new_contents)) { + if (!td::tl::put_file_contents(file_name, new_contents, true)) { std::fprintf(stderr, "Can't write file %s\n", file_name.c_str()); std::abort(); } diff --git a/protocols/Telegram/tdlib/td/td/generate/scheme/mtproto_api.tl b/protocols/Telegram/tdlib/td/td/generate/scheme/mtproto_api.tl index de2e94bd62..b2508b478b 100644 --- a/protocols/Telegram/tdlib/td/td/generate/scheme/mtproto_api.tl +++ b/protocols/Telegram/tdlib/td/td/generate/scheme/mtproto_api.tl @@ -25,8 +25,7 @@ dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set dh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer; dh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer; -bind_auth_key_inner#75a3f765 nonce:long temp_auth_key_id:long perm_auth_key_id:long temp_session_id:long expires_at:int -= BindAuthKeyInner; +bind_auth_key_inner#75a3f765 nonce:long temp_auth_key_id:long perm_auth_key_id:long temp_session_id:long expires_at:int = BindAuthKeyInner; //rpc_result#f35c6d01 req_msg_id:long result:string = RpcResult; rpc_error#2144ca19 error_code:int error_message:string = RpcError; diff --git a/protocols/Telegram/tdlib/td/td/generate/scheme/td_api.tl b/protocols/Telegram/tdlib/td/td/generate/scheme/td_api.tl index b649393620..e89433f535 100644 --- a/protocols/Telegram/tdlib/td/td/generate/scheme/td_api.tl +++ b/protocols/Telegram/tdlib/td/td/generate/scheme/td_api.tl @@ -24,15 +24,23 @@ ok = Ok; //@class AuthenticationCodeType @description Provides information about the method by which an authentication code is delivered to the user -//@description An authentication code is delivered via a private Telegram message, which can be viewed from another active session +//@description A digit-only authentication code is delivered via a private Telegram message, which can be viewed from another active session //@length Length of the code authenticationCodeTypeTelegramMessage length:int32 = AuthenticationCodeType; -//@description An authentication code is delivered via an SMS message to the specified phone number; applications may not receive this type of code +//@description A digit-only authentication code is delivered via an SMS message to the specified phone number; non-official applications may not receive this type of code //@length Length of the code authenticationCodeTypeSms length:int32 = AuthenticationCodeType; -//@description An authentication code is delivered via a phone call to the specified phone number +//@description An authentication code is a word delivered via an SMS message to the specified phone number; non-official applications may not receive this type of code +//@first_letter The first letters of the word if known +authenticationCodeTypeSmsWord first_letter:string = AuthenticationCodeType; + +//@description An authentication code is a phrase from multiple words delivered via an SMS message to the specified phone number; non-official applications may not receive this type of code +//@first_word The first word of the phrase if known +authenticationCodeTypeSmsPhrase first_word:string = AuthenticationCodeType; + +//@description A digit-only authentication code is delivered via a phone call to the specified phone number //@length Length of the code authenticationCodeTypeCall length:int32 = AuthenticationCodeType; @@ -45,17 +53,17 @@ authenticationCodeTypeFlashCall pattern:string = AuthenticationCodeType; //@length Number of digits in the code, excluding the prefix authenticationCodeTypeMissedCall phone_number_prefix:string length:int32 = AuthenticationCodeType; -//@description An authentication code is delivered to https://fragment.com. The user must be logged in there via a wallet owning the phone number's NFT +//@description A digit-only authentication code is delivered to https://fragment.com. The user must be logged in there via a wallet owning the phone number's NFT //@url URL to open to receive the code //@length Length of the code authenticationCodeTypeFragment url:string length:int32 = AuthenticationCodeType; -//@description An authentication code is delivered via Firebase Authentication to the official Android application -//@nonce Nonce to pass to the SafetyNet Attestation API +//@description A digit-only authentication code is delivered via Firebase Authentication to the official Android application +//@device_verification_parameters Parameters to be used for device verification //@length Length of the code -authenticationCodeTypeFirebaseAndroid nonce:bytes length:int32 = AuthenticationCodeType; +authenticationCodeTypeFirebaseAndroid device_verification_parameters:FirebaseDeviceVerificationParameters length:int32 = AuthenticationCodeType; -//@description An authentication code is delivered via Firebase Authentication to the official iOS application +//@description A digit-only authentication code is delivered via Firebase Authentication to the official iOS application //@receipt Receipt of successful application token validation to compare with receipt from push notification //@push_timeout Time after the next authentication method is supposed to be used if verification push notification isn't received, in seconds //@length Length of the code @@ -75,7 +83,7 @@ authenticationCodeInfo phone_number:string type:AuthenticationCodeType next_type emailAddressAuthenticationCodeInfo email_address_pattern:string length:int32 = EmailAddressAuthenticationCodeInfo; -//@class EmailAddressAuthentication @description Contains authentication data for a email address +//@class EmailAddressAuthentication @description Contains authentication data for an email address //@description An authentication code delivered to a user's email address @code The code emailAddressAuthenticationCode code:string = EmailAddressAuthentication; @@ -87,7 +95,7 @@ emailAddressAuthenticationAppleId token:string = EmailAddressAuthentication; emailAddressAuthenticationGoogleId token:string = EmailAddressAuthentication; -//@class EmailAddressResetState @description Describes reset state of a email address +//@class EmailAddressResetState @description Describes reset state of an email address //@description Email address can be reset after the given period. Call resetAuthenticationEmailAddress to reset it and allow the user to authorize with a code sent to the user's phone number //@wait_period Time required to wait before the email address can be reset; 0 if the user is subscribed to Telegram Premium @@ -105,7 +113,7 @@ textEntity offset:int32 length:int32 type:TextEntityType = TextEntity; textEntities entities:vector<textEntity> = TextEntities; //@description A text with some entities @text The text @entities Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. -//-Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other +//-Pre, Code and PreCode entities can't contain other entities. BlockQuote entities can't contain other BlockQuote entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other formattedText text:string entities:vector<textEntity> = FormattedText; @@ -164,6 +172,17 @@ authorizationStateClosing = AuthorizationState; authorizationStateClosed = AuthorizationState; +//@class FirebaseDeviceVerificationParameters @description Describes parameters to be used for device verification + +//@description Device verification must be performed with the SafetyNet Attestation API @nonce Nonce to pass to the SafetyNet Attestation API +firebaseDeviceVerificationParametersSafetyNet nonce:bytes = FirebaseDeviceVerificationParameters; + +//@description Device verification must be performed with the classic Play Integrity verification (https://developer.android.com/google/play/integrity/classic) +//@nonce Base64url-encoded nonce to pass to the Play Integrity API +//@cloud_project_number Cloud project number to pass to the Play Integrity API +firebaseDeviceVerificationParametersPlayIntegrity nonce:string cloud_project_number:int64 = FirebaseDeviceVerificationParameters; + + //@description Represents the current state of 2-step verification //@has_password True, if a 2-step verification password is set //@password_hint Hint for the password; may be empty @@ -195,7 +214,7 @@ localFile path:string can_be_downloaded:Bool can_be_deleted:Bool is_downloading_ //@description Represents a remote file //@id Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. -//-If the ID starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. +//-If the identifier starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. //-If downloadFile/addFileToDownloads is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. //-Application must generate the file by downloading it to the specified location //@unique_id Unique file identifier; may be empty if unknown. The unique file identifier which is the same for the same file even for different users and is persistent over time @@ -215,10 +234,10 @@ file id:int32 size:int53 expected_size:int53 local:localFile remote:remoteFile = //@class InputFile @description Points to a file -//@description A file defined by its unique ID @id Unique file identifier +//@description A file defined by its unique identifier @id Unique file identifier inputFileId id:int32 = InputFile; -//@description A file defined by its remote ID. The remote ID is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. +//@description A file defined by its remote identifier. The remote identifier is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. //-For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application //@id Remote file identifier inputFileRemote id:string = InputFile; @@ -250,7 +269,7 @@ minithumbnail width:int32 height:int32 data:bytes = Minithumbnail; //@description The thumbnail is in JPEG format thumbnailFormatJpeg = ThumbnailFormat; -//@description The thumbnail is in static GIF format. It will be used only for some bot inline results +//@description The thumbnail is in static GIF format. It will be used only for some bot inline query results thumbnailFormatGif = ThumbnailFormat; //@description The thumbnail is in MPEG4 format. It will be used only for some animations and videos @@ -259,13 +278,13 @@ thumbnailFormatMpeg4 = ThumbnailFormat; //@description The thumbnail is in PNG format. It will be used only for background patterns thumbnailFormatPng = ThumbnailFormat; -//@description The thumbnail is in TGS format. It will be used only for TGS sticker sets +//@description The thumbnail is in TGS format. It will be used only for sticker sets thumbnailFormatTgs = ThumbnailFormat; -//@description The thumbnail is in WEBM format. It will be used only for WEBM sticker sets +//@description The thumbnail is in WEBM format. It will be used only for sticker sets thumbnailFormatWebm = ThumbnailFormat; -//@description The thumbnail is in WEBP format. It will be used only for some stickers +//@description The thumbnail is in WEBP format. It will be used only for some stickers and sticker sets thumbnailFormatWebp = ThumbnailFormat; @@ -311,7 +330,7 @@ stickerFormatTgs = StickerFormat; stickerFormatWebm = StickerFormat; -//@class StickerType @description Describes type of a sticker +//@class StickerType @description Describes type of sticker //@description The sticker is a regular sticker stickerTypeRegular = StickerType; @@ -342,15 +361,15 @@ closedVectorPath commands:vector<VectorPathCommand> = ClosedVectorPath; //@description Describes one answer option of a poll -//@text Option text; 1-100 characters +//@text Option text; 1-100 characters. Only custom emoji entities are allowed //@voter_count Number of voters for this option, available only for closed or voted polls //@vote_percentage The percentage of votes for this option; 0-100 //@is_chosen True, if the option was chosen by the user //@is_being_chosen True, if the option is being chosen by a pending setPollAnswer request -pollOption text:string voter_count:int32 vote_percentage:int32 is_chosen:Bool is_being_chosen:Bool = PollOption; +pollOption text:formattedText voter_count:int32 vote_percentage:int32 is_chosen:Bool is_being_chosen:Bool = PollOption; -//@class PollType @description Describes the type of a poll +//@class PollType @description Describes the type of poll //@description A regular poll @allow_multiple_answers True, if multiple answer options can be chosen simultaneously pollTypeRegular allow_multiple_answers:Bool = PollType; @@ -435,16 +454,16 @@ video duration:int32 width:int32 height:int32 file_name:string mime_type:string //@video File containing the video videoNote duration:int32 waveform:bytes length:int32 minithumbnail:minithumbnail thumbnail:thumbnail speech_recognition_result:SpeechRecognitionResult video:file = VideoNote; -//@description Describes a voice note. The voice note must be encoded with the Opus codec, and stored inside an OGG container. Voice notes can have only a single audio channel +//@description Describes a voice note //@duration Duration of the voice note, in seconds; as defined by the sender //@waveform A waveform representation of the voice note in 5-bit format -//@mime_type MIME type of the file; as defined by the sender +//@mime_type MIME type of the file; as defined by the sender. Usually, one of "audio/ogg" for Opus in an OGG container, "audio/mpeg" for an MP3 audio, or "audio/mp4" for an M4A audio //@speech_recognition_result Result of speech recognition in the voice note; may be null //@voice File containing the voice note voiceNote duration:int32 waveform:bytes mime_type:string speech_recognition_result:SpeechRecognitionResult voice:file = VoiceNote; //@description Describes an animated or custom representation of an emoji -//@sticker Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, it can have arbitrary format different from stickerFormatTgs +//@sticker Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, then it can have arbitrary format //@sticker_width Expected width of the sticker, which can be used if the sticker is null //@sticker_height Expected height of the sticker, which can be used if the sticker is null //@fitzpatrick_type Emoji modifier fitzpatrick type; 0-6; 0 if none @@ -494,16 +513,16 @@ webApp short_name:string title:string description:string photo:photo animation:a //@description Describes a poll //@id Unique poll identifier -//@question Poll question; 1-300 characters +//@question Poll question; 1-300 characters. Only custom emoji entities are allowed //@options List of poll answer options //@total_voter_count Total number of voters, participating in the poll -//@recent_voter_user_ids User identifiers of recent voters, if the poll is non-anonymous +//@recent_voter_ids Identifiers of recent voters, if the poll is non-anonymous //@is_anonymous True, if the poll is anonymous //@type Type of the poll //@open_period Amount of time the poll will be active after creation, in seconds //@close_date Point in time (Unix timestamp) when the poll will automatically be closed //@is_closed True, if the poll is closed -poll id:int64 question:string options:vector<pollOption> total_voter_count:int32 recent_voter_user_ids:vector<int53> is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = Poll; +poll id:int64 question:formattedText options:vector<pollOption> total_voter_count:int32 recent_voter_ids:vector<MessageSender> is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = Poll; //@description Describes a chat background @@ -511,14 +530,14 @@ poll id:int64 question:string options:vector<pollOption> total_voter_count:int32 //@is_default True, if this is one of default backgrounds //@is_dark True, if the background is dark and is recommended to be used with dark theme //@name Unique background name -//@document Document with the background; may be null. Null only for filled backgrounds +//@document Document with the background; may be null. Null only for filled and chat theme backgrounds //@type Type of the background background id:int64 is_default:Bool is_dark:Bool name:string document:document type:BackgroundType = Background; //@description Contains a list of backgrounds @backgrounds A list of backgrounds backgrounds backgrounds:vector<background> = Backgrounds; -//@description Describes a background set for a specific chat @background The background @dark_theme_dimming Dimming of the background in dark themes, as a percentage; 0-100 +//@description Describes a background set for a specific chat @background The background @dark_theme_dimming Dimming of the background in dark themes, as a percentage; 0-100. Applied only to Wallpaper and Fill types of background chatBackground background:background dark_theme_dimming:int32 = ChatBackground; @@ -540,7 +559,7 @@ profilePhoto id:int64 small:file big:file minithumbnail:minithumbnail has_animat chatPhotoInfo small:file big:file minithumbnail:minithumbnail has_animation:Bool is_personal:Bool = ChatPhotoInfo; -//@class UserType @description Represents the type of a user. The following types are possible: regular users, deleted users and bots +//@class UserType @description Represents the type of user. The following types are possible: regular users, deleted users and bots //@description A regular user userTypeRegular = UserType; @@ -552,11 +571,14 @@ userTypeDeleted = UserType; //@can_be_edited True, if the bot is owned by the current user and can be edited using the methods toggleBotUsernameIsActive, reorderBotActiveUsernames, setBotProfilePhoto, setBotName, setBotInfoDescription, and setBotInfoShortDescription //@can_join_groups True, if the bot can be invited to basic group and supergroup chats //@can_read_all_group_messages True, if the bot can read all messages in basic group or supergroup chats and not just those addressed to the bot. In private and channel chats a bot can always read all messages +//@has_main_web_app True, if the bot has the main Web App //@is_inline True, if the bot supports inline queries //@inline_query_placeholder Placeholder for inline queries (displayed on the application input field) //@need_location True, if the location of the user is expected to be sent with every inline query to this bot -//@can_be_added_to_attachment_menu True, if the bot can be added to attachment menu -userTypeBot can_be_edited:Bool can_join_groups:Bool can_read_all_group_messages:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool can_be_added_to_attachment_menu:Bool = UserType; +//@can_connect_to_business True, if the bot supports connection to Telegram Business accounts +//@can_be_added_to_attachment_menu True, if the bot can be added to attachment or side menu +//@active_user_count The number of recently active users of the bot +userTypeBot can_be_edited:Bool can_join_groups:Bool can_read_all_group_messages:Bool has_main_web_app:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool can_connect_to_business:Bool can_be_added_to_attachment_menu:Bool active_user_count:int32 = UserType; //@description No information on the user besides the user identifier is available, yet this user has not been deleted. This object is extremely rare and must be handled like a deleted user. It is not possible to perform any actions on users of this type userTypeUnknown = UserType; @@ -568,7 +590,9 @@ botCommand command:string description:string = BotCommand; //@description Contains a list of bot commands @bot_user_id Bot's user identifier @commands List of bot commands botCommands bot_user_id:int53 commands:vector<botCommand> = BotCommands; -//@description Describes a button to be shown instead of bot commands menu button @text Text of the button @url URL to be passed to openWebApp +//@description Describes a button to be shown instead of bot commands menu button +//@text Text of the button +//@url URL of a Web App to open when the button is pressed. If the link is of the type internalLinkTypeWebApp, then it must be processed accordingly. Otherwise, the link must be passed to openWebApp botMenuButton text:string url:string = BotMenuButton; @@ -576,7 +600,114 @@ botMenuButton text:string url:string = BotMenuButton; chatLocation location:location address:string = ChatLocation; -//@class ChatPhotoStickerType @description Describes type of a sticker, which was used to create a chat photo +//@description Represents a birthdate of a user @day Day of the month; 1-31 @month Month of the year; 1-12 @year Birth year; 0 if unknown +birthdate day:int32 month:int32 year:int32 = Birthdate; + +//@description Describes a user that had or will have a birthday soon @user_id User identifier @birthdate Birthdate of the user +closeBirthdayUser user_id:int53 birthdate:birthdate = CloseBirthdayUser; + + +//@class BusinessAwayMessageSchedule @description Describes conditions for sending of away messages by a Telegram Business account + +//@description Send away messages always +businessAwayMessageScheduleAlways = BusinessAwayMessageSchedule; + +//@description Send away messages outside of the business opening hours +businessAwayMessageScheduleOutsideOfOpeningHours = BusinessAwayMessageSchedule; + +//@description Send away messages only in the specified time span +//@start_date Point in time (Unix timestamp) when the away messages will start to be sent +//@end_date Point in time (Unix timestamp) when the away messages will stop to be sent +businessAwayMessageScheduleCustom start_date:int32 end_date:int32 = BusinessAwayMessageSchedule; + + +//@description Represents a location of a business @location The location; may be null if not specified @address Location address; 1-96 characters +businessLocation location:location address:string = BusinessLocation; + +//@description Describes private chats chosen for automatic interaction with a business +//@chat_ids Identifiers of selected private chats +//@excluded_chat_ids Identifiers of private chats that are always excluded; for businessConnectedBot only +//@select_existing_chats True, if all existing private chats are selected +//@select_new_chats True, if all new private chats are selected +//@select_contacts True, if all private chats with contacts are selected +//@select_non_contacts True, if all private chats with non-contacts are selected +//@exclude_selected If true, then all private chats except the selected are chosen. Otherwise, only the selected chats are chosen +businessRecipients chat_ids:vector<int53> excluded_chat_ids:vector<int53> select_existing_chats:Bool select_new_chats:Bool select_contacts:Bool select_non_contacts:Bool exclude_selected:Bool = BusinessRecipients; + +//@description Describes settings for messages that are automatically sent by a Telegram Business account when it is away +//@shortcut_id Unique quick reply shortcut identifier for the away messages +//@recipients Chosen recipients of the away messages +//@schedule Settings used to check whether the current user is away +//@offline_only True, if the messages must not be sent if the account was online in the last 10 minutes +businessAwayMessageSettings shortcut_id:int32 recipients:businessRecipients schedule:BusinessAwayMessageSchedule offline_only:Bool = BusinessAwayMessageSettings; + +//@description Describes settings for greeting messages that are automatically sent by a Telegram Business account as response to incoming messages in an inactive private chat +//@shortcut_id Unique quick reply shortcut identifier for the greeting messages +//@recipients Chosen recipients of the greeting messages +//@inactivity_days The number of days after which a chat will be considered as inactive; currently, must be on of 7, 14, 21, or 28 +businessGreetingMessageSettings shortcut_id:int32 recipients:businessRecipients inactivity_days:int32 = BusinessGreetingMessageSettings; + +//@description Describes a bot connected to a business account +//@bot_user_id User identifier of the bot +//@recipients Private chats that will be accessible to the bot +//@can_reply True, if the bot can send messages to the private chats; false otherwise +businessConnectedBot bot_user_id:int53 recipients:businessRecipients can_reply:Bool = BusinessConnectedBot; + +//@description Describes settings for a business account start page +//@title Title text of the start page +//@message Message text of the start page +//@sticker Greeting sticker of the start page; may be null if none +businessStartPage title:string message:string sticker:sticker = BusinessStartPage; + +//@description Describes settings for a business account start page to set +//@title Title text of the start page; 0-getOption("business_start_page_title_length_max") characters +//@message Message text of the start page; 0-getOption("business_start_page_message_length_max") characters +//@sticker Greeting sticker of the start page; pass null if none. The sticker must belong to a sticker set and must not be a custom emoji +inputBusinessStartPage title:string message:string sticker:InputFile = InputBusinessStartPage; + +//@description Describes an interval of time when the business is open +//@start_minute The minute's sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0-7*24*60 +//@end_minute The minute's sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 1-8*24*60 +businessOpeningHoursInterval start_minute:int32 end_minute:int32 = BusinessOpeningHoursInterval; + +//@description Describes opening hours of a business @time_zone_id Unique time zone identifier @opening_hours Intervals of the time when the business is open +businessOpeningHours time_zone_id:string opening_hours:vector<businessOpeningHoursInterval> = BusinessOpeningHours; + +//@description Contains information about a Telegram Business account +//@location Location of the business; may be null if none +//@opening_hours Opening hours of the business; may be null if none. The hours are guaranteed to be valid and has already been split by week days +//@local_opening_hours Opening hours of the business in the local time; may be null if none. The hours are guaranteed to be valid and has already been split by week days. +//-Local time zone identifier will be empty. An updateUserFullInfo update is not triggered when value of this field changes +//@next_open_in Time left before the business will open the next time, in seconds; 0 if unknown. An updateUserFullInfo update is not triggered when value of this field changes +//@next_close_in Time left before the business will close the next time, in seconds; 0 if unknown. An updateUserFullInfo update is not triggered when value of this field changes +//@greeting_message_settings The greeting message; may be null if none or the Business account is not of the current user +//@away_message_settings The away message; may be null if none or the Business account is not of the current user +//@start_page Information about start page of the account; may be null if none +businessInfo location:businessLocation opening_hours:businessOpeningHours local_opening_hours:businessOpeningHours next_open_in:int32 next_close_in:int32 greeting_message_settings:businessGreetingMessageSettings away_message_settings:businessAwayMessageSettings start_page:businessStartPage = BusinessInfo; + + +//@description Contains information about a business chat link +//@link The HTTPS link +//@text Message draft text that will be added to the input field +//@title Link title +//@view_count Number of times the link was used +businessChatLink link:string text:formattedText title:string view_count:int32 = BusinessChatLink; + +//@description Contains a list of business chat links created by the user @links List of links +businessChatLinks links:vector<businessChatLink> = BusinessChatLinks; + +//@description Describes a business chat link to create or edit +//@text Message draft text that will be added to the input field +//@title Link title +inputBusinessChatLink text:formattedText title:string = InputBusinessChatLink; + +//@description Contains information about a business chat link +//@chat_id Identifier of the private chat that created the link +//@text Message draft text that must be added to the input field +businessChatLinkInfo chat_id:int53 text:formattedText = BusinessChatLinkInfo; + + +//@class ChatPhotoStickerType @description Describes type of sticker, which was used to create a chat photo //@description Information about the sticker, which was used to create the chat photo //@sticker_set_id Sticker set identifier @@ -632,43 +763,77 @@ inputChatPhotoSticker sticker:chatPhotoSticker = InputChatPhoto; //@description Describes actions that a user is allowed to take in a chat -//@can_send_basic_messages True, if the user can send text messages, contacts, invoices, locations, and venues +//@can_send_basic_messages True, if the user can send text messages, contacts, giveaways, giveaway winners, invoices, locations, and venues //@can_send_audios True, if the user can send music files //@can_send_documents True, if the user can send documents -//@can_send_photos True, if the user can send audio photos -//@can_send_videos True, if the user can send audio videos +//@can_send_photos True, if the user can send photos +//@can_send_videos True, if the user can send videos //@can_send_video_notes True, if the user can send video notes //@can_send_voice_notes True, if the user can send voice notes //@can_send_polls True, if the user can send polls //@can_send_other_messages True, if the user can send animations, games, stickers, and dice and use inline bots -//@can_add_web_page_previews True, if the user may add a web page preview to their messages +//@can_add_link_previews True, if the user may add a link preview to their messages //@can_change_info True, if the user can change the chat title, photo, and other settings //@can_invite_users True, if the user can invite new users to the chat //@can_pin_messages True, if the user can pin messages -//@can_manage_topics True, if the user can manage topics -chatPermissions can_send_basic_messages:Bool can_send_audios:Bool can_send_documents:Bool can_send_photos:Bool can_send_videos:Bool can_send_video_notes:Bool can_send_voice_notes:Bool can_send_polls:Bool can_send_other_messages:Bool can_add_web_page_previews:Bool can_change_info:Bool can_invite_users:Bool can_pin_messages:Bool can_manage_topics:Bool = ChatPermissions; +//@can_create_topics True, if the user can create topics +chatPermissions can_send_basic_messages:Bool can_send_audios:Bool can_send_documents:Bool can_send_photos:Bool can_send_videos:Bool can_send_video_notes:Bool can_send_voice_notes:Bool can_send_polls:Bool can_send_other_messages:Bool can_add_link_previews:Bool can_change_info:Bool can_invite_users:Bool can_pin_messages:Bool can_create_topics:Bool = ChatPermissions; //@description Describes rights of the administrator -//@can_manage_chat True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only +//@can_manage_chat True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report supergroup spam messages and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only //@can_change_info True, if the administrator can change the chat title, photo, and other settings -//@can_post_messages True, if the administrator can create channel posts; applicable to channels only +//@can_post_messages True, if the administrator can create channel posts or view channel statistics; applicable to channels only //@can_edit_messages True, if the administrator can edit messages of other users and pin messages; applicable to channels only //@can_delete_messages True, if the administrator can delete messages of other users //@can_invite_users True, if the administrator can invite new users to the chat -//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members; always true for channels +//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members or view supergroup statistics; always true for channels //@can_pin_messages True, if the administrator can pin messages; applicable to basic groups and supergroups only -//@can_manage_topics True, if the administrator can manage topics; applicable to forum supergroups only +//@can_manage_topics True, if the administrator can create, rename, close, reopen, hide, and unhide forum topics; applicable to forum supergroups only //@can_promote_members True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them //@can_manage_video_chats True, if the administrator can manage video chats +//@can_post_stories True, if the administrator can create new chat stories, or edit and delete posted stories; applicable to supergroups and channels only +//@can_edit_stories True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access story archive; applicable to supergroups and channels only +//@can_delete_stories True, if the administrator can delete stories posted by other users; applicable to supergroups and channels only //@is_anonymous True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only -chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_manage_topics:Bool can_promote_members:Bool can_manage_video_chats:Bool is_anonymous:Bool = ChatAdministratorRights; +chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_manage_topics:Bool can_promote_members:Bool can_manage_video_chats:Bool can_post_stories:Bool can_edit_stories:Bool can_delete_stories:Bool is_anonymous:Bool = ChatAdministratorRights; + + +//@description Describes subscription plan paid in Telegram Stars +//@period The number of seconds between consecutive Telegram Star debiting +//@star_count The amount of Telegram Stars that must be paid for each period +starSubscriptionPricing period:int32 star_count:int53 = StarSubscriptionPricing; + +//@description Contains information about subscription to a channel chat paid in Telegram Stars +//@id Unique identifier of the subscription +//@chat_id Identifier of the channel chat that is subscribed +//@expiration_date Point in time (Unix timestamp) when the subscription will expire or expired +//@can_reuse True, if the subscription is active and the user can use the method reuseStarSubscription to join the subscribed chat again +//@is_canceled True, if the subscription was canceled +//@is_expiring True, if the subscription expires soon and there are no enough Telegram Stars on the user's balance to extend it +//@invite_link The invite link that can be used to renew the subscription if it has been expired; may be empty, if the link isn't available anymore +//@pricing The subscription plan +starSubscription id:string chat_id:int53 expiration_date:int32 can_reuse:Bool is_canceled:Bool is_expiring:Bool invite_link:string pricing:starSubscriptionPricing = StarSubscription; + +//@description Represents a list of Telegram Star subscriptions +//@star_count The amount of owned Telegram Stars +//@subscriptions List of subbscriptions for Telegram Stars +//@required_star_count The number of Telegram Stars required to buy to extend subscriptions expiring soon +//@next_offset The offset for the next request. If empty, then there are no more results +starSubscriptions star_count:int53 subscriptions:vector<starSubscription> required_star_count:int53 next_offset:string = StarSubscriptions; + + +//@description Contains information about a product that can be paid with invoice +//@title Product title +//@param_description Product description +//@photo Product photo; may be null +productInfo title:string description:formattedText photo:photo = ProductInfo; //@description Describes an option for buying Telegram Premium to a user //@currency ISO 4217 currency code for Telegram Premium subscription payment //@amount The amount to pay, in the smallest units of the currency //@discount_percentage The discount associated with this option, as a percentage -//@month_count Number of month the Telegram Premium subscription will be active +//@month_count Number of months the Telegram Premium subscription will be active //@store_product_id Identifier of the store product associated with the option //@payment_link An internal link to be opened for buying Telegram Premium to the user if store payment isn't possible; may be null if direct payment isn't available premiumPaymentOption currency:string amount:int53 discount_percentage:int32 month_count:int32 store_product_id:string payment_link:InternalLinkType = PremiumPaymentOption; @@ -680,18 +845,232 @@ premiumPaymentOption currency:string amount:int53 discount_percentage:int32 mont //@last_transaction_id Identifier of the last in-store transaction for the currently used option premiumStatePaymentOption payment_option:premiumPaymentOption is_current:Bool is_upgrade:Bool last_transaction_id:string = PremiumStatePaymentOption; +//@description Describes an option for creating Telegram Premium gift codes or Telegram Premium giveaway. Use telegramPaymentPurposePremiumGiftCodes or telegramPaymentPurposePremiumGiveaway for out-of-store payments +//@currency ISO 4217 currency code for Telegram Premium gift code payment +//@amount The amount to pay, in the smallest units of the currency +//@winner_count Number of users which will be able to activate the gift codes +//@month_count Number of months the Telegram Premium subscription will be active +//@store_product_id Identifier of the store product associated with the option; may be empty if none +//@store_product_quantity Number of times the store product must be paid +premiumGiftCodePaymentOption currency:string amount:int53 winner_count:int32 month_count:int32 store_product_id:string store_product_quantity:int32 = PremiumGiftCodePaymentOption; + +//@description Contains a list of options for creating Telegram Premium gift codes or Telegram Premium giveaway @options The list of options +premiumGiftCodePaymentOptions options:vector<premiumGiftCodePaymentOption> = PremiumGiftCodePaymentOptions; + +//@description Contains information about a Telegram Premium gift code +//@creator_id Identifier of a chat or a user that created the gift code; may be null if unknown. If null and the code is from messagePremiumGiftCode message, then creator_id from the message can be used +//@creation_date Point in time (Unix timestamp) when the code was created +//@is_from_giveaway True, if the gift code was created for a giveaway +//@giveaway_message_id Identifier of the corresponding giveaway message in the creator_id chat; can be 0 or an identifier of a deleted message +//@month_count Number of months the Telegram Premium subscription will be active after code activation +//@user_id Identifier of a user for which the code was created; 0 if none +//@use_date Point in time (Unix timestamp) when the code was activated; 0 if none +premiumGiftCodeInfo creator_id:MessageSender creation_date:int32 is_from_giveaway:Bool giveaway_message_id:int53 month_count:int32 user_id:int53 use_date:int32 = PremiumGiftCodeInfo; + +//@description Describes an option for buying Telegram Stars. Use telegramPaymentPurposeStars for out-of-store payments +//@currency ISO 4217 currency code for the payment +//@amount The amount to pay, in the smallest units of the currency +//@star_count Number of Telegram Stars that will be purchased +//@store_product_id Identifier of the store product associated with the option; may be empty if none +//@is_additional True, if the option must be shown only in the full list of payment options +starPaymentOption currency:string amount:int53 star_count:int53 store_product_id:string is_additional:Bool = StarPaymentOption; + +//@description Contains a list of options for buying Telegram Stars @options The list of options +starPaymentOptions options:vector<starPaymentOption> = StarPaymentOptions; + +//@description Describes an option for the number of winners of a Telegram Star giveaway +//@winner_count The number of users that will be chosen as winners +//@won_star_count The number of Telegram Stars that will be won by the winners of the giveaway +//@is_default True, if the option must be chosen by default +starGiveawayWinnerOption winner_count:int32 won_star_count:int53 is_default:Bool = StarGiveawayWinnerOption; + +//@description Describes an option for creating Telegram Star giveaway. Use telegramPaymentPurposeStarGiveaway for out-of-store payments +//@currency ISO 4217 currency code for the payment +//@amount The amount to pay, in the smallest units of the currency +//@star_count Number of Telegram Stars that will be distributed among winners +//@store_product_id Identifier of the store product associated with the option; may be empty if none +//@yearly_boost_count Number of times the chat will be boosted for one year if the option is chosen +//@winner_options Allowed options for the number of giveaway winners +//@is_default True, if the option must be chosen by default +//@is_additional True, if the option must be shown only in the full list of payment options +starGiveawayPaymentOption currency:string amount:int53 star_count:int53 store_product_id:string yearly_boost_count:int32 winner_options:vector<starGiveawayWinnerOption> is_default:Bool is_additional:Bool = StarGiveawayPaymentOption; + +//@description Contains a list of options for creating Telegram Star giveaway @options The list of options +starGiveawayPaymentOptions options:vector<starGiveawayPaymentOption> = StarGiveawayPaymentOptions; + + +//@class StarTransactionDirection @description Describes direction of a transaction with Telegram Stars + +//@description The transaction is incoming and increases the number of owned Telegram Stars +starTransactionDirectionIncoming = StarTransactionDirection; + +//@description The transaction is outgoing and decreases the number of owned Telegram Stars +starTransactionDirectionOutgoing = StarTransactionDirection; + + +//@class BotTransactionPurpose @description Describes purpose of a transaction with a bot + +//@description Paid media were bought @media The bought media if the trancastion wasn't refunded @payload Bot-provided payload; for bots only +botTransactionPurposePaidMedia media:vector<PaidMedia> payload:string = BotTransactionPurpose; + +//@description User bought a product from the bot +//@product_info Information about the bought product; may be null if not applicable +//@invoice_payload Invoice payload; for bots only +botTransactionPurposeInvoicePayment product_info:productInfo invoice_payload:bytes = BotTransactionPurpose; + + +//@class ChatTransactionPurpose @description Describes purpose of a transaction with a supergroup or a channel + +//@description Paid media were bought +//@message_id Identifier of the corresponding message with paid media; can be 0 or an identifier of a deleted message +//@media The bought media if the trancastion wasn't refunded +chatTransactionPurposePaidMedia message_id:int53 media:vector<PaidMedia> = ChatTransactionPurpose; + +//@description User joined the channel and subscribed to regular payments in Telegram Stars +//@period The number of seconds between consecutive Telegram Star debiting +chatTransactionPurposeJoin period:int32 = ChatTransactionPurpose; + +//@description User paid for a reaction +//@message_id Identifier of the reacted message; can be 0 or an identifier of a deleted message +chatTransactionPurposeReaction message_id:int53 = ChatTransactionPurpose; + +//@description User received Telegram Stars from a giveaway @giveaway_message_id Identifier of the message with giveaway; can be 0 or an identifier of a deleted message +chatTransactionPurposeGiveaway giveaway_message_id:int53 = ChatTransactionPurpose; + + +//@class StarTransactionPartner @description Describes source or recipient of a transaction with Telegram Stars + +//@description The transaction is a transaction with Telegram through a bot +starTransactionPartnerTelegram = StarTransactionPartner; + +//@description The transaction is a transaction with App Store +starTransactionPartnerAppStore = StarTransactionPartner; + +//@description The transaction is a transaction with Google Play +starTransactionPartnerGooglePlay = StarTransactionPartner; + +//@description The transaction is a transaction with Fragment @withdrawal_state State of the withdrawal; may be null for refunds from Fragment +starTransactionPartnerFragment withdrawal_state:RevenueWithdrawalState = StarTransactionPartner; + +//@description The transaction is a transaction with Telegram Ad platform +starTransactionPartnerTelegramAds = StarTransactionPartner; + +//@description The transaction is a transaction with a bot @user_id Identifier of the bot @purpose Purpose of the transaction +starTransactionPartnerBot user_id:int53 purpose:BotTransactionPurpose = StarTransactionPartner; + +//@description The transaction is a transaction with a business account @user_id Identifier of the business account user @media The bought media if the trancastion wasn't refunded +starTransactionPartnerBusiness user_id:int53 media:vector<PaidMedia> = StarTransactionPartner; + +//@description The transaction is a transaction with a supergroup or a channel chat @chat_id Identifier of the chat @purpose Purpose of the transaction +starTransactionPartnerChat chat_id:int53 purpose:ChatTransactionPurpose = StarTransactionPartner; + +//@description The transaction is a gift of Telegram Stars from another user +//@user_id Identifier of the user; 0 if the gift was anonymous +//@sticker A sticker to be shown in the transaction information; may be null if unknown +starTransactionPartnerUser user_id:int53 sticker:sticker = StarTransactionPartner; + +//@description The transaction is a transaction with unknown partner +starTransactionPartnerUnsupported = StarTransactionPartner; + + +//@description Represents a transaction changing the amount of owned Telegram Stars +//@id Unique identifier of the transaction +//@star_count The amount of added owned Telegram Stars; negative for outgoing transactions +//@is_refund True, if the transaction is a refund of a previous transaction +//@date Point in time (Unix timestamp) when the transaction was completed +//@partner Source of the incoming transaction, or its recipient for outgoing transactions +starTransaction id:string star_count:int53 is_refund:Bool date:int32 partner:StarTransactionPartner = StarTransaction; -//@description Describes a custom emoji to be shown instead of the Telegram Premium badge @custom_emoji_id Identifier of the custom emoji in stickerFormatTgs format -emojiStatus custom_emoji_id:int64 = EmojiStatus; +//@description Represents a list of Telegram Star transactions +//@star_count The amount of owned Telegram Stars +//@transactions List of transactions with Telegram Stars +//@next_offset The offset for the next request. If empty, then there are no more results +starTransactions star_count:int53 transactions:vector<starTransaction> next_offset:string = StarTransactions; -//@description Contains a list of emoji statuses @emoji_statuses The list of emoji statuses -emojiStatuses emoji_statuses:vector<emojiStatus> = EmojiStatuses; + +//@class GiveawayParticipantStatus @description Contains information about status of a user in a giveaway + +//@description The user is eligible for the giveaway +giveawayParticipantStatusEligible = GiveawayParticipantStatus; + +//@description The user participates in the giveaway +giveawayParticipantStatusParticipating = GiveawayParticipantStatus; + +//@description The user can't participate in the giveaway, because they have already been member of the chat +//@joined_chat_date Point in time (Unix timestamp) when the user joined the chat +giveawayParticipantStatusAlreadyWasMember joined_chat_date:int32 = GiveawayParticipantStatus; + +//@description The user can't participate in the giveaway, because they are an administrator in one of the chats that created the giveaway @chat_id Identifier of the chat administered by the user +giveawayParticipantStatusAdministrator chat_id:int53 = GiveawayParticipantStatus; + +//@description The user can't participate in the giveaway, because they phone number is from a disallowed country @user_country_code A two-letter ISO 3166-1 alpha-2 country code of the user's country +giveawayParticipantStatusDisallowedCountry user_country_code:string = GiveawayParticipantStatus; + + +//@class GiveawayInfo @description Contains information about a giveaway + +//@description Describes an ongoing giveaway +//@creation_date Point in time (Unix timestamp) when the giveaway was created +//@status Status of the current user in the giveaway +//@is_ended True, if the giveaway has ended and results are being prepared +giveawayInfoOngoing creation_date:int32 status:GiveawayParticipantStatus is_ended:Bool = GiveawayInfo; + +//@description Describes a completed giveaway +//@creation_date Point in time (Unix timestamp) when the giveaway was created +//@actual_winners_selection_date Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway +//@was_refunded True, if the giveaway was canceled and was fully refunded +//@is_winner True, if the cuurent user is a winner of the giveaway +//@winner_count Number of winners in the giveaway +//@activation_count Number of winners, which activated their gift codes; for Telegram Premium giveaways only +//@gift_code Telegram Premium gift code that was received by the current user; empty if the user isn't a winner in the giveaway or the giveaway isn't a Telegram Premium giveaway +//@won_star_count The amount of Telegram Stars won by the current user; 0 if the user isn't a winner in the giveaway or the giveaway isn't a Telegram Star giveaway +giveawayInfoCompleted creation_date:int32 actual_winners_selection_date:int32 was_refunded:Bool is_winner:Bool winner_count:int32 activation_count:int32 gift_code:string won_star_count:int53 = GiveawayInfo; + + +//@class GiveawayPrize @description Contains information about a giveaway prize + +//@description The giveaway sends Telegram Premium subscriptions to the winners @month_count Number of months the Telegram Premium subscription will be active after code activation +giveawayPrizePremium month_count:int32 = GiveawayPrize; + +//@description The giveaway sends Telegram Stars to the winners @star_count Number of Telegram Stars that will be shared by all winners +giveawayPrizeStars star_count:int53 = GiveawayPrize; + + +//@description Contains information about supported accent color for user/chat name, background of empty chat photo, replies to messages and link previews +//@id Accent color identifier +//@built_in_accent_color_id Identifier of a built-in color to use in places, where only one color is needed; 0-6 +//@light_theme_colors The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in light themes +//@dark_theme_colors The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in dark themes +//@min_channel_chat_boost_level The minimum chat boost level required to use the color in a channel chat +accentColor id:int32 built_in_accent_color_id:int32 light_theme_colors:vector<int32> dark_theme_colors:vector<int32> min_channel_chat_boost_level:int32 = AccentColor; + +//@description Contains information about supported accent colors for user profile photo background in RGB format +//@palette_colors The list of 1-2 colors in RGB format, describing the colors, as expected to be shown in the color palette settings +//@background_colors The list of 1-2 colors in RGB format, describing the colors, as expected to be used for the profile photo background +//@story_colors The list of 2 colors in RGB format, describing the colors of the gradient to be used for the unread active story indicator around profile photo +profileAccentColors palette_colors:vector<int32> background_colors:vector<int32> story_colors:vector<int32> = ProfileAccentColors; + +//@description Contains information about supported accent color for user profile photo background +//@id Profile accent color identifier +//@light_theme_colors Accent colors expected to be used in light themes +//@dark_theme_colors Accent colors expected to be used in dark themes +//@min_supergroup_chat_boost_level The minimum chat boost level required to use the color in a supergroup chat +//@min_channel_chat_boost_level The minimum chat boost level required to use the color in a channel chat +profileAccentColor id:int32 light_theme_colors:profileAccentColors dark_theme_colors:profileAccentColors min_supergroup_chat_boost_level:int32 min_channel_chat_boost_level:int32 = ProfileAccentColor; + +//@description Describes a custom emoji to be shown instead of the Telegram Premium badge +//@custom_emoji_id Identifier of the custom emoji in stickerFormatTgs format +//@expiration_date Point in time (Unix timestamp) when the status will expire; 0 if never +emojiStatus custom_emoji_id:int64 expiration_date:int32 = EmojiStatus; + +//@description Contains a list of custom emoji identifiers for emoji statuses @custom_emoji_ids The list of custom emoji identifiers +emojiStatuses custom_emoji_ids:vector<int64> = EmojiStatuses; //@description Describes usernames assigned to a user, a supergroup, or a channel //@active_usernames List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames, reorderBotActiveUsernames or reorderSupergroupActiveUsernames //@disabled_usernames List of currently disabled usernames; the username can be activated with toggleUsernameIsActive, toggleBotUsernameIsActive, or toggleSupergroupUsernameIsActive -//@editable_username The active username, which can be changed with setUsername or setSupergroupUsername +//@editable_username The active username, which can be changed with setUsername or setSupergroupUsername. Information about other active usernames can be received using getCollectibleItemInfo usernames active_usernames:vector<string> disabled_usernames:vector<string> editable_username:string = Usernames; @@ -703,20 +1082,28 @@ usernames active_usernames:vector<string> disabled_usernames:vector<string> edit //@phone_number Phone number of the user //@status Current online status of the user //@profile_photo Profile photo of the user; may be null +//@accent_color_id Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview. For Telegram Premium users only +//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none. For Telegram Premium users only +//@profile_accent_color_id Identifier of the accent color for the user's profile; -1 if none. For Telegram Premium users only +//@profile_background_custom_emoji_id Identifier of a custom emoji to be shown on the background of the user's profile; 0 if none. For Telegram Premium users only //@emoji_status Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only //@is_contact The user is a contact of the current user //@is_mutual_contact The user is a contact of the current user and the current user is a contact of the user +//@is_close_friend The user is a close friend of the current user; implies that the user is a contact //@is_verified True, if the user is verified //@is_premium True, if the user is a Telegram Premium user //@is_support True, if the user is Telegram support account //@restriction_reason If non-empty, it contains a human-readable description of the reason why access to this user must be restricted //@is_scam True, if many users reported this user as a scam //@is_fake True, if many users reported this user as a fake account +//@has_active_stories True, if the user has non-expired stories available to the current user +//@has_unread_active_stories True, if the user has unread non-expired stories available to the current user +//@restricts_new_chats True, if the user may restrict new chats with non-contacts. Use canSendMessageToUser to check whether the current user can message the user or try to create a chat with them //@have_access If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method //@type Type of the user //@language_code IETF language tag of the user's language; only available to bots //@added_to_attachment_menu True, if the user added the current bot to attachment menu; only available to bots -user id:int53 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_verified:Bool is_premium:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User; +user id:int53 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto accent_color_id:int32 background_custom_emoji_id:int64 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_close_friend:Bool is_verified:Bool is_premium:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool has_active_stories:Bool has_unread_active_stories:Bool restricts_new_chats:Bool have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User; //@description Contains information about a bot @@ -726,13 +1113,15 @@ user id:int53 first_name:string last_name:string usernames:usernames phone_numbe //@animation Animation shown in the chat with the bot if the chat is empty; may be null //@menu_button Information about a button to show instead of the bot commands menu button; may be null if ordinary bot commands menu must be shown //@commands List of the bot commands +//@privacy_policy_url The HTTP link to the privacy policy of the bot. If empty, then /privacy command must be used if supported by the bot. If the command isn't supported, then https://telegram.org/privacy-tpa must be opened //@default_group_administrator_rights Default administrator rights for adding the bot to basic group and supergroup chats; may be null //@default_channel_administrator_rights Default administrator rights for adding the bot to channels; may be null +//@has_media_previews True, if the bot has media previews //@edit_commands_link The internal link, which can be used to edit bot commands; may be null //@edit_description_link The internal link, which can be used to edit bot description; may be null //@edit_description_media_link The internal link, which can be used to edit the photo or animation shown in the chat with the bot if the chat is empty; may be null //@edit_settings_link The internal link, which can be used to edit bot settings; may be null -botInfo short_description:string description:string photo:photo animation:animation menu_button:botMenuButton commands:vector<botCommand> default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights edit_commands_link:InternalLinkType edit_description_link:InternalLinkType edit_description_media_link:InternalLinkType edit_settings_link:InternalLinkType = BotInfo; +botInfo short_description:string description:string photo:photo animation:animation menu_button:botMenuButton commands:vector<botCommand> privacy_policy_url:string default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights has_media_previews:Bool edit_commands_link:InternalLinkType edit_description_link:InternalLinkType edit_description_media_link:InternalLinkType edit_settings_link:InternalLinkType = BotInfo; //@description Contains full information about a user //@personal_photo User profile photo set by the current user for the contact; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. @@ -741,22 +1130,31 @@ botInfo short_description:string description:string photo:photo animation:animat //-If non-null and personal_photo is null, then it is the same photo as in user.profile_photo and chat.photo //@public_photo User profile photo visible if the main photo is hidden by privacy settings; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. //-If non-null and both photo and personal_photo are null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos -//@is_blocked True, if the user is blocked by the current user +//@block_list Block list to which the user is added; may be null if none //@can_be_called True, if the user can be called //@supports_video_calls True, if a video call can be created with the user //@has_private_calls True, if the user can't be called due to their privacy settings //@has_private_forwards True, if the user can't be linked in forwarded messages due to their privacy settings //@has_restricted_voice_and_video_note_messages True, if voice and video notes can't be sent or forwarded to the user +//@has_posted_to_profile_stories True, if the user has posted to profile stories +//@has_sponsored_messages_enabled True, if the user always enabled sponsored messages; known only for the current user //@need_phone_number_privacy_exception True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used +//@set_chat_background True, if the user set chat background for both chat users and it wasn't reverted yet //@bio A short user bio; may be null for bots +//@birthdate Birthdate of the user; may be null if unknown +//@personal_chat_id Identifier of the personal chat of the user; 0 if none //@premium_gift_options The list of available options for gifting Telegram Premium to the user //@group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user -//@bot_info For bots, information about the bot; may be null -userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto is_blocked:Bool can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool need_phone_number_privacy_exception:Bool bio:formattedText premium_gift_options:vector<premiumPaymentOption> group_in_common_count:int32 bot_info:botInfo = UserFullInfo; +//@business_info Information about business settings for Telegram Business accounts; may be null if none +//@bot_info For bots, information about the bot; may be null if the user isn't a bot +userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto block_list:BlockList can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool has_posted_to_profile_stories:Bool has_sponsored_messages_enabled:Bool need_phone_number_privacy_exception:Bool set_chat_background:Bool bio:formattedText birthdate:birthdate personal_chat_id:int53 premium_gift_options:vector<premiumPaymentOption> group_in_common_count:int32 business_info:businessInfo bot_info:botInfo = UserFullInfo; //@description Represents a list of users @total_count Approximate total number of users found @user_ids A list of user identifiers users total_count:int32 user_ids:vector<int53> = Users; +//@description Represents a list of found users @user_ids Identifiers of the found users @next_offset The offset for the next request. If empty, then there are no more results +foundUsers user_ids:vector<int53> next_offset:string = FoundUsers; + //@description Contains information about a chat administrator @user_id User identifier of the administrator @custom_title Custom title of the administrator @is_owner True, if the user is the owner of the chat chatAdministrator user_id:int53 custom_title:string is_owner:Bool = ChatAdministrator; @@ -768,20 +1166,21 @@ chatAdministrators administrators:vector<chatAdministrator> = ChatAdministrators //@class ChatMemberStatus @description Provides information about the status of a member in a chat //@description The user is the owner of the chat and has all the administrator privileges -//@custom_title A custom title of the owner; 0-16 characters without emojis; applicable to supergroups only +//@custom_title A custom title of the owner; 0-16 characters without emoji; applicable to supergroups only //@is_anonymous True, if the creator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only //@is_member True, if the user is a member of the chat chatMemberStatusCreator custom_title:string is_anonymous:Bool is_member:Bool = ChatMemberStatus; //@description The user is a member of the chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, ban unprivileged members, and manage video chats. //-In supergroups and channels, there are more detailed options for administrator privileges -//@custom_title A custom title of the administrator; 0-16 characters without emojis; applicable to supergroups only +//@custom_title A custom title of the administrator; 0-16 characters without emoji; applicable to supergroups only //@can_be_edited True, if the current user can edit the administrator privileges for the called user //@rights Rights of the administrator chatMemberStatusAdministrator custom_title:string can_be_edited:Bool rights:chatAdministratorRights = ChatMemberStatus; //@description The user is a member of the chat, without any additional privileges or restrictions -chatMemberStatusMember = ChatMemberStatus; +//@member_until_date Point in time (Unix timestamp) when the user will be removed from the chat because of the expired subscription; 0 if never. Ignored in setChatMemberStatus +chatMemberStatusMember member_until_date:int32 = ChatMemberStatus; //@description The user is under certain restrictions in the chat. Not supported in basic groups and channels //@is_member True, if the user is a member of the chat @@ -866,13 +1265,15 @@ supergroupMembersFilterBots = SupergroupMembersFilter; //@date Point in time (Unix timestamp) when the link was created //@edit_date Point in time (Unix timestamp) when the link was last edited; 0 if never or unknown //@expiration_date Point in time (Unix timestamp) when the link will expire; 0 if never +//@subscription_pricing Information about subscription plan that is applied to the users joining the chat by the link; may be null if the link doesn't require subscription //@member_limit The maximum number of members, which can join the chat using the link simultaneously; 0 if not limited. Always 0 if the link requires approval //@member_count Number of chat members, which joined the chat using the link +//@expired_member_count Number of chat members, which joined the chat using the link, but have already left because of expired subscription; for subscription links only //@pending_join_request_count Number of pending join requests created using this link //@creates_join_request True, if the link only creates join request. If true, total number of joining members will be unlimited //@is_primary True, if the link is primary. Primary invite link can't have name, expiration date, or usage limit. There is exactly one primary invite link for each administrator with can_invite_users right at a given time //@is_revoked True, if the link was revoked -chatInviteLink invite_link:string name:string creator_user_id:int53 date:int32 edit_date:int32 expiration_date:int32 member_limit:int32 member_count:int32 pending_join_request_count:int32 creates_join_request:Bool is_primary:Bool is_revoked:Bool = ChatInviteLink; +chatInviteLink invite_link:string name:string creator_user_id:int53 date:int32 edit_date:int32 expiration_date:int32 subscription_pricing:starSubscriptionPricing member_limit:int32 member_count:int32 expired_member_count:int32 pending_join_request_count:int32 creates_join_request:Bool is_primary:Bool is_revoked:Bool = ChatInviteLink; //@description Contains a list of chat invite links @total_count Approximate total number of chat invite links found @invite_links List of invite links chatInviteLinks total_count:int32 invite_links:vector<chatInviteLink> = ChatInviteLinks; @@ -896,18 +1297,43 @@ chatInviteLinkMember user_id:int53 joined_chat_date:int32 via_chat_folder_invite //@description Contains a list of chat members joined a chat via an invite link @total_count Approximate total number of chat members found @members List of chat members, joined a chat via an invite link chatInviteLinkMembers total_count:int32 members:vector<chatInviteLinkMember> = ChatInviteLinkMembers; + +//@class InviteLinkChatType @description Describes the type of chat to which points an invite link + +//@description The link is an invite link for a basic group +inviteLinkChatTypeBasicGroup = InviteLinkChatType; + +//@description The link is an invite link for a supergroup +inviteLinkChatTypeSupergroup = InviteLinkChatType; + +//@description The link is an invite link for a channel +inviteLinkChatTypeChannel = InviteLinkChatType; + + +//@description Contains information about subscription plan that must be paid by the user to use a chat invite link +//@pricing Information about subscription plan that must be paid by the user to use the link +//@can_reuse True, if the user has already paid for the subscription and can use joinChatByInviteLink to join the subscribed chat again +//@form_id Identifier of the payment form to use for subscription payment; 0 if the subscription can't be paid +chatInviteLinkSubscriptionInfo pricing:starSubscriptionPricing can_reuse:Bool form_id:int64 = ChatInviteLinkSubscriptionInfo; + //@description Contains information about a chat invite link //@chat_id Chat identifier of the invite link; 0 if the user has no access to the chat before joining //@accessible_for If non-zero, the amount of time for which read access to the chat will remain available, in seconds //@type Type of the chat //@title Title of the chat //@photo Chat photo; may be null +//@accent_color_id Identifier of the accent color for chat title and background of chat photo //@param_description Chat description //@member_count Number of members in the chat //@member_user_ids User identifiers of some chat members that may be known to the current user +//@subscription_info Information about subscription plan that must be paid by the user to use the link; may be null if the link doesn't require subscription //@creates_join_request True, if the link only creates join request //@is_public True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup -chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:ChatType title:string photo:chatPhotoInfo description:string member_count:int32 member_user_ids:vector<int53> creates_join_request:Bool is_public:Bool = ChatInviteLinkInfo; +//@is_verified True, if the chat is verified +//@is_scam True, if many users reported this chat as a scam +//@is_fake True, if many users reported this chat as a fake account +chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:InviteLinkChatType title:string photo:chatPhotoInfo accent_color_id:int32 description:string member_count:int32 member_user_ids:vector<int53> subscription_info:chatInviteLinkSubscriptionInfo creates_join_request:Bool is_public:Bool is_verified:Bool is_scam:Bool is_fake:Bool = ChatInviteLinkInfo; + //@description Describes a user that sent a join request and waits for administrator approval @user_id User identifier @date Point in time (Unix timestamp) when the user sent the join request @bio A short bio of the user chatJoinRequest user_id:int53 date:int32 bio:string = ChatJoinRequest; @@ -946,22 +1372,29 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 memb //@usernames Usernames of the supergroup or channel; may be null //@date Point in time (Unix timestamp) when the current user joined, or the point in time when the supergroup or channel was created, in case the user is not a member //@status Status of the current user in the supergroup or channel; custom title will always be empty -//@member_count Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received -//-through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, getUserPrivacySettingRules, or in chatFolderInviteLinkInfo.missing_chat_ids +//@member_count Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through +//-getChatSimilarChats, getChatsToSendStories, getCreatedPublicChats, getGroupsInCommon, getInactiveSupergroupChats, getRecommendedChats, getSuitableDiscussionChats, +//-getUserPrivacySettingRules, getVideoChatAvailableParticipants, searchChatsNearby, searchPublicChats, or in chatFolderInviteLinkInfo.missing_chat_ids, or in userFullInfo.personal_chat_id, +//-or for chats with messages or stories from publicForwards and foundStories +//@boost_level Approximate boost level for the chat //@has_linked_chat True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel //@has_location True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup -//@sign_messages True, if messages sent to the channel need to contain information about the sender. This field is only applicable to channels +//@sign_messages True, if messages sent to the channel contains name of the sender. This field is only applicable to channels +//@show_message_sender True, if messages sent to the channel have information about the sender user. This field is only applicable to channels //@join_to_send_messages True, if users need to join the supergroup before they can send messages. Always true for channels and non-discussion supergroups //@join_by_request True, if all users directly joining the supergroup need to be approved by supergroup administrators. Always false for channels and supergroups without username, location, or a linked chat //@is_slow_mode_enabled True, if the slow mode is enabled in the supergroup //@is_channel True, if the supergroup is a channel //@is_broadcast_group True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members -//@is_forum True, if the supergroup must be shown as a forum by default +//@is_forum True, if the supergroup is a forum with topics //@is_verified True, if the supergroup or channel is verified +//@has_sensitive_content True, if content of media messages in the supergroup or channel chat must be hidden with 18+ spoiler //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted //@is_scam True, if many users reported this supergroup or channel as a scam //@is_fake True, if many users reported this supergroup or channel as a fake account -supergroup id:int53 usernames:usernames date:int32 status:ChatMemberStatus member_count:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_forum:Bool is_verified:Bool restriction_reason:string is_scam:Bool is_fake:Bool = Supergroup; +//@has_active_stories True, if the supergroup or channel has non-expired stories available to the current user +//@has_unread_active_stories True, if the supergroup or channel has unread non-expired stories available to the current user +supergroup id:int53 usernames:usernames date:int32 status:ChatMemberStatus member_count:int32 boost_level:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool show_message_sender:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_forum:Bool is_verified:Bool has_sensitive_content:Bool restriction_reason:string is_scam:Bool is_fake:Bool has_active_stories:Bool has_unread_active_stories:Bool = Supergroup; //@description Contains full information about a supergroup or channel //@photo Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo @@ -973,24 +1406,32 @@ supergroup id:int53 usernames:usernames date:int32 status:ChatMemberStatus membe //@linked_chat_id Chat identifier of a discussion group for the channel, or a channel, for which the supergroup is the designated discussion group; 0 if none or unknown //@slow_mode_delay Delay between consecutive sent messages for non-administrator supergroup members, in seconds //@slow_mode_delay_expires_in Time left before next message can be sent in the supergroup, in seconds. An updateSupergroupFullInfo update is not triggered when value of this field changes, but both new and old values are non-zero +//@can_enable_paid_reaction True, if paid reaction can be enabled in the channel chat; for channels only //@can_get_members True, if members of the chat can be retrieved via getSupergroupMembers or searchChatMembers //@has_hidden_members True, if non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers //@can_hide_members True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators -//@can_set_username True, if the chat username can be changed //@can_set_sticker_set True, if the supergroup sticker set can be changed //@can_set_location True, if the supergroup location can be changed //@can_get_statistics True, if the supergroup or channel statistics are available +//@can_get_revenue_statistics True, if the supergroup or channel revenue statistics are available +//@can_get_star_revenue_statistics True, if the supergroup or channel Telegram Star revenue statistics are available //@can_toggle_aggressive_anti_spam True, if aggressive anti-spam checks can be enabled or disabled in the supergroup //@is_all_history_available True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, //-so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators +//@can_have_sponsored_messages True, if the chat can have sponsored messages. The value of this field is only available to the owner of the chat //@has_aggressive_anti_spam_enabled True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators -//@sticker_set_id Identifier of the supergroup sticker set; 0 if none -//@location Location to which the supergroup is connected; may be null +//@has_paid_media_allowed True, if paid media can be sent and forwarded to the channel chat; for channels only +//@has_pinned_stories True, if the supergroup or channel has pinned stories +//@my_boost_count Number of times the current user boosted the supergroup or channel +//@unrestrict_boost_count Number of times the supergroup must be boosted by a user to ignore slow mode and chat permission restrictions; 0 if unspecified +//@sticker_set_id Identifier of the supergroup sticker set that must be shown before user sticker sets; 0 if none +//@custom_emoji_sticker_set_id Identifier of the custom emoji sticker set that can be used in the supergroup without Telegram Premium subscription; 0 if none +//@location Location to which the supergroup is connected; may be null if none //@invite_link Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only //@bot_commands List of commands of bots in the group //@upgraded_from_basic_group_id Identifier of the basic group from which supergroup was upgraded; 0 if none //@upgraded_from_max_message_id Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none -supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_username:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool has_aggressive_anti_spam_enabled:Bool sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector<botCommands> upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; +supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_enable_paid_reaction:Bool can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_get_revenue_statistics:Bool can_get_star_revenue_statistics:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool can_have_sponsored_messages:Bool has_aggressive_anti_spam_enabled:Bool has_paid_media_allowed:Bool has_pinned_stories:Bool my_boost_count:int32 unrestrict_boost_count:int32 sticker_set_id:int64 custom_emoji_sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector<botCommands> upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; //@class SecretChatState @description Describes the current secret chat state @@ -1030,13 +1471,31 @@ messageSenderChat chat_id:int53 = MessageSender; messageSenders total_count:int32 senders:vector<MessageSender> = MessageSenders; -//@description Represents a message sender, which can be used to send messages in a chat @sender Available message senders @needs_premium True, if Telegram Premium is needed to use the message sender +//@description Represents a message sender, which can be used to send messages in a chat @sender The message sender @needs_premium True, if Telegram Premium is needed to use the message sender chatMessageSender sender:MessageSender needs_premium:Bool = ChatMessageSender; //@description Represents a list of message senders, which can be used to send messages in a chat @senders List of available message senders chatMessageSenders senders:vector<chatMessageSender> = ChatMessageSenders; +//@class MessageReadDate @description Describes read date of a recent outgoing message in a private chat + +//@description Contains read date of the message @read_date Point in time (Unix timestamp) when the message was read by the other user +messageReadDateRead read_date:int32 = MessageReadDate; + +//@description The message is unread yet +messageReadDateUnread = MessageReadDate; + +//@description The message is too old to get read date +messageReadDateTooOld = MessageReadDate; + +//@description The read date is unknown due to privacy settings of the other user +messageReadDateUserPrivacyRestricted = MessageReadDate; + +//@description The read date is unknown due to privacy settings of the current user, but will be known if the user subscribes to Telegram Premium +messageReadDateMyPrivacyRestricted = MessageReadDate; + + //@description Represents a viewer of a message @user_id User identifier of the viewer @view_date Approximate point in time (Unix timestamp) when the message was viewed messageViewer user_id:int53 view_date:int32 = MessageViewer; @@ -1044,27 +1503,34 @@ messageViewer user_id:int53 view_date:int32 = MessageViewer; messageViewers viewers:vector<messageViewer> = MessageViewers; -//@class MessageForwardOrigin @description Contains information about the origin of a forwarded message +//@class MessageOrigin @description Contains information about the origin of a message //@description The message was originally sent by a known user @sender_user_id Identifier of the user that originally sent the message -messageForwardOriginUser sender_user_id:int53 = MessageForwardOrigin; +messageOriginUser sender_user_id:int53 = MessageOrigin; + +//@description The message was originally sent by a user, which is hidden by their privacy settings @sender_name Name of the sender +messageOriginHiddenUser sender_name:string = MessageOrigin; //@description The message was originally sent on behalf of a chat //@sender_chat_id Identifier of the chat that originally sent the message //@author_signature For messages originally sent by an anonymous chat administrator, original message author signature -messageForwardOriginChat sender_chat_id:int53 author_signature:string = MessageForwardOrigin; - -//@description The message was originally sent by a user, which is hidden by their privacy settings @sender_name Name of the sender -messageForwardOriginHiddenUser sender_name:string = MessageForwardOrigin; +messageOriginChat sender_chat_id:int53 author_signature:string = MessageOrigin; //@description The message was originally a post in a channel -//@chat_id Identifier of the chat from which the message was originally forwarded +//@chat_id Identifier of the channel chat to which the message was originally sent //@message_id Message identifier of the original message //@author_signature Original post author signature -messageForwardOriginChannel chat_id:int53 message_id:int53 author_signature:string = MessageForwardOrigin; +messageOriginChannel chat_id:int53 message_id:int53 author_signature:string = MessageOrigin; + -//@description The message was imported from an exported message history @sender_name Name of the sender -messageForwardOriginMessageImport sender_name:string = MessageForwardOrigin; +//@description Contains information about the last message from which a new message was forwarded last time +//@chat_id Identifier of the chat to which the message that was forwarded belonged; may be 0 if unknown +//@message_id Identifier of the message; may be 0 if unknown +//@sender_id Identifier of the sender of the message; may be null if unknown or the new message was forwarded not to Saved Messages +//@sender_name Name of the sender of the message if the sender is hidden by their privacy settings +//@date Point in time (Unix timestamp) when the message is sent; 0 if unknown +//@is_outgoing True, if the message that was forwarded is outgoing; always false if sender is unknown +forwardSource chat_id:int53 message_id:int53 sender_id:MessageSender sender_name:string date:int32 is_outgoing:Bool = ForwardSource; //@class ReactionType @description Describes type of message reaction @@ -1075,14 +1541,29 @@ reactionTypeEmoji emoji:string = ReactionType; //@description A reaction with a custom emoji @custom_emoji_id Unique identifier of the custom emoji reactionTypeCustomEmoji custom_emoji_id:int64 = ReactionType; +//@description The paid reaction in a channel chat +reactionTypePaid = ReactionType; + + +//@description Contains information about a user that added paid reactions +//@sender_id Identifier of the user or chat that added the reactions; may be null for anonymous reactors that aren't the current user +//@star_count Number of Telegram Stars added +//@is_top True, if the reactor is one of the most active reactors; can be false if the reactor is the current user +//@is_me True, if the paid reaction was added by the current user +//@is_anonymous True, if the reactor is anonymous +paidReactor sender_id:MessageSender star_count:int32 is_top:Bool is_me:Bool is_anonymous:Bool = PaidReactor; //@description Contains information about a forwarded message -//@origin Origin of a forwarded message +//@origin Origin of the forwarded message //@date Point in time (Unix timestamp) when the message was originally sent -//@public_service_announcement_type The type of a public service announcement for the forwarded message -//@from_chat_id For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the chat from which the message was forwarded last time; 0 if unknown -//@from_message_id For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the original message from which the new message was forwarded last time; 0 if unknown -messageForwardInfo origin:MessageForwardOrigin date:int32 public_service_announcement_type:string from_chat_id:int53 from_message_id:int53 = MessageForwardInfo; +//@source For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, information about the source message from which the message was forwarded last time; may be null for other forwards or if unknown +//@public_service_announcement_type The type of public service announcement for the forwarded message +messageForwardInfo origin:MessageOrigin date:int32 source:forwardSource public_service_announcement_type:string = MessageForwardInfo; + +//@description Contains information about a message created with importMessages +//@sender_name Name of the original sender +//@date Point in time (Unix timestamp) when the message was originally sent +messageImportInfo sender_name:string date:int32 = MessageImportInfo; //@description Contains information about replies to a message //@reply_count Number of times the message was directly or indirectly replied @@ -1096,15 +1577,23 @@ messageReplyInfo reply_count:int32 recent_replier_ids:vector<MessageSender> last //@type Type of the reaction //@total_count Number of times the reaction was added //@is_chosen True, if the reaction is chosen by the current user +//@used_sender_id Identifier of the message sender used by the current user to add the reaction; may be null if unknown or the reaction isn't chosen //@recent_sender_ids Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats -messageReaction type:ReactionType total_count:int32 is_chosen:Bool recent_sender_ids:vector<MessageSender> = MessageReaction; +messageReaction type:ReactionType total_count:int32 is_chosen:Bool used_sender_id:MessageSender recent_sender_ids:vector<MessageSender> = MessageReaction; + +//@description Contains a list of reactions added to a message +//@reactions List of added reactions +//@are_tags True, if the reactions are tags and Telegram Premium users can filter messages by them +//@paid_reactors Information about top users that added the paid reaction +//@can_get_added_reactions True, if the list of added reactions is available using getMessageAddedReactions +messageReactions reactions:vector<messageReaction> are_tags:Bool paid_reactors:vector<paidReactor> can_get_added_reactions:Bool = MessageReactions; //@description Contains information about interactions with a message //@view_count Number of times the message was viewed //@forward_count Number of times the message was forwarded //@reply_info Information about direct or indirect replies to the message; may be null. Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which are not replies itself -//@reactions The list of reactions added to the message -messageInteractionInfo view_count:int32 forward_count:int32 reply_info:messageReplyInfo reactions:vector<messageReaction> = MessageInteractionInfo; +//@reactions The list of reactions or tags added to the message; may be null +messageInteractionInfo view_count:int32 forward_count:int32 reply_info:messageReplyInfo reactions:messageReactions = MessageInteractionInfo; //@description Contains information about an unread reaction to a message //@type Type of the reaction @@ -1113,66 +1602,138 @@ messageInteractionInfo view_count:int32 forward_count:int32 reply_info:messageRe unreadReaction type:ReactionType sender_id:MessageSender is_big:Bool = UnreadReaction; +//@class MessageEffectType @description Describes type of emoji effect + +//@description An effect from an emoji reaction @select_animation Select animation for the effect in TGS format @effect_animation Effect animation for the effect in TGS format +messageEffectTypeEmojiReaction select_animation:sticker effect_animation:sticker = MessageEffectType; + +//@description An effect from a premium sticker @sticker The premium sticker. The effect can be found at sticker.full_type.premium_animation +messageEffectTypePremiumSticker sticker:sticker = MessageEffectType; + + +//@description Contains information about an effect added to a message +//@id Unique identifier of the effect +//@static_icon Static icon for the effect in WEBP format; may be null if none +//@emoji Emoji corresponding to the effect that can be used if static icon isn't available +//@is_premium True, if Telegram Premium subscription is required to use the effect +//@type Type of the effect +messageEffect id:int64 static_icon:sticker emoji:string is_premium:Bool type:MessageEffectType = MessageEffect; + + //@class MessageSendingState @description Contains information about the sending state of the message //@description The message is being sent now, but has not yet been delivered to the server @sending_id Non-persistent message sending identifier, specified by the application messageSendingStatePending sending_id:int32 = MessageSendingState; //@description The message failed to be sent -//@error_code An error code; 0 if unknown -//@error_message Error message -//@can_retry True, if the message can be re-sent +//@error The cause of the message sending failure +//@can_retry True, if the message can be re-sent using resendMessages or readdQuickReplyShortcutMessages //@need_another_sender True, if the message can be re-sent only on behalf of a different sender +//@need_another_reply_quote True, if the message can be re-sent only if another quote is chosen in the message that is replied by the given message +//@need_drop_reply True, if the message can be re-sent only if the message to be replied is removed. This will be done automatically by resendMessages //@retry_after Time left before the message can be re-sent, in seconds. No update is sent when this field changes -messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool need_another_sender:Bool retry_after:double = MessageSendingState; +messageSendingStateFailed error:error can_retry:Bool need_another_sender:Bool need_another_reply_quote:Bool need_drop_reply:Bool retry_after:double = MessageSendingState; + + +//@description Describes manually or automatically chosen quote from another message +//@text Text of the quote. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be present in the text +//@position Approximate quote position in the original message in UTF-16 code units as specified by the message sender +//@is_manual True, if the quote was manually chosen by the message sender +textQuote text:formattedText position:int32 is_manual:Bool = TextQuote; + +//@description Describes manually chosen quote from another message +//@text Text of the quote; 0-getOption("message_reply_quote_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed to be kept and must be kept in the quote +//@position Quote position in the original message in UTF-16 code units +inputTextQuote text:formattedText position:int32 = InputTextQuote; + + +//@class MessageReplyTo @description Contains information about the message or the story a message is replying to + +//@description Describes a message replied by a given message +//@chat_id The identifier of the chat to which the message belongs; may be 0 if the replied message is in unknown chat +//@message_id The identifier of the message; may be 0 if the replied message is in unknown chat +//@quote Chosen quote from the replied message; may be null if none +//@origin Information about origin of the message if the message was from another chat or topic; may be null for messages from the same chat +//@origin_send_date Point in time (Unix timestamp) when the message was sent if the message was from another chat or topic; 0 for messages from the same chat +//@content Media content of the message if the message was from another chat or topic; may be null for messages from the same chat and messages without media. +//-Can be only one of the following types: messageAnimation, messageAudio, messageContact, messageDice, messageDocument, messageGame, messageGiveaway, messageGiveawayWinners, +//-messageInvoice, messageLocation, messagePaidMedia, messagePhoto, messagePoll, messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, +//-messageVideoNote, or messageVoiceNote +messageReplyToMessage chat_id:int53 message_id:int53 quote:textQuote origin:MessageOrigin origin_send_date:int32 content:MessageContent = MessageReplyTo; + +//@description Describes a story replied by a given message @story_sender_chat_id The identifier of the sender of the story @story_id The identifier of the story +messageReplyToStory story_sender_chat_id:int53 story_id:int32 = MessageReplyTo; + + +//@class InputMessageReplyTo @description Contains information about the message or the story to be replied + +//@description Describes a message to be replied in the same chat and forum topic +//@message_id The identifier of the message to be replied in the same chat and forum topic. A message can be replied in the same chat and forum topic only if messageProperties.can_be_replied +//@quote Quote from the message to be replied; pass null if none. Must always be null for replies in secret chats +inputMessageReplyToMessage message_id:int53 quote:inputTextQuote = InputMessageReplyTo; + +//@description Describes a message to be replied that is from a different chat or a forum topic; not supported in secret chats +//@chat_id The identifier of the chat to which the message to be replied belongs +//@message_id The identifier of the message to be replied in the specified chat. A message can be replied in another chat or forum topic only if messageProperties.can_be_replied_in_another_chat +//@quote Quote from the message to be replied; pass null if none +inputMessageReplyToExternalMessage chat_id:int53 message_id:int53 quote:inputTextQuote = InputMessageReplyTo; + +//@description Describes a story to be replied +//@story_sender_chat_id The identifier of the sender of the story. Currently, stories can be replied only in the sender's chat and channel stories can't be replied +//@story_id The identifier of the story +inputMessageReplyToStory story_sender_chat_id:int53 story_id:int32 = InputMessageReplyTo; + + +//@description Describes a fact-check added to the message by an independent checker +//@text Text of the fact-check +//@country_code A two-letter ISO 3166-1 alpha-2 country code of the country for which the fact-check is shown +factCheck text:formattedText country_code:string = FactCheck; //@description Describes a message //@id Message identifier; unique for the chat to which the message belongs //@sender_id Identifier of the sender of the message //@chat_id Chat identifier -//@sending_state The sending state of the message; may be null -//@scheduling_state The scheduling state of the message; may be null +//@sending_state The sending state of the message; may be null if the message isn't being sent and didn't fail to be sent +//@scheduling_state The scheduling state of the message; may be null if the message isn't scheduled //@is_outgoing True, if the message is outgoing //@is_pinned True, if the message is pinned -//@can_be_edited True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the application -//@can_be_forwarded True, if the message can be forwarded +//@is_from_offline True, if the message was sent because of a scheduled action by the message sender, for example, as away, or greeting service message //@can_be_saved True, if content of the message can be saved locally or copied -//@can_be_deleted_only_for_self True, if the message can be deleted only for the current user while other users will continue to see it -//@can_be_deleted_for_all_users True, if the message can be deleted for all users -//@can_get_added_reactions True, if the list of added reactions is available through getMessageAddedReactions -//@can_get_statistics True, if the message statistics are available through getMessageStatistics -//@can_get_message_thread True, if information about the message thread is available through getMessageThread and getMessageThreadHistory -//@can_get_viewers True, if chat members already viewed the message can be received through getMessageViewers -//@can_get_media_timestamp_links True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description through getMessageLink -//@can_report_reactions True, if reactions on the message can be reported through reportMessageReactions //@has_timestamped_media True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message //@is_channel_post True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts //@is_topic_message True, if the message is a forum topic message //@contains_unread_mention True, if the message contains an unread mention for the current user //@date Point in time (Unix timestamp) when the message was sent //@edit_date Point in time (Unix timestamp) when the message was last edited -//@forward_info Information about the initial message sender; may be null -//@interaction_info Information about interactions with the message; may be null +//@forward_info Information about the initial message sender; may be null if none or unknown +//@import_info Information about the initial message for messages created with importMessages; may be null if the message isn't imported +//@interaction_info Information about interactions with the message; may be null if none //@unread_reactions Information about unread reactions added to the message -//@reply_in_chat_id If non-zero, the identifier of the chat to which the replied message belongs; Currently, only messages in the Replies chat can have different reply_in_chat_id and chat_id -//@reply_to_message_id If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message +//@fact_check Information about fact-check added to the message; may be null if none +//@reply_to Information about the message or the story this message is replying to; may be null if none //@message_thread_id If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs -//@self_destruct_time The message's self-destruct time, in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the time expires -//@self_destruct_in Time left before the message self-destruct timer expires, in seconds. If the self-destruct timer isn't started yet, equals to the value of the self_destruct_time field -//@auto_delete_in Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never. TDLib will send updateDeleteMessages or updateMessageContent once the time expires -//@via_bot_user_id If non-zero, the user identifier of the bot through which this message was sent +//@saved_messages_topic_id Identifier of the Saved Messages topic for the message; 0 for messages not from Saved Messages +//@self_destruct_type The message's self-destruct type; may be null if none +//@self_destruct_in Time left before the message self-destruct timer expires, in seconds; 0 if self-destruction isn't scheduled yet +//@auto_delete_in Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never +//@via_bot_user_id If non-zero, the user identifier of the inline bot through which this message was sent +//@sender_business_bot_user_id If non-zero, the user identifier of the business bot that sent this message +//@sender_boost_count Number of times the sender of the message boosted the supergroup at the time the message was sent; 0 if none or unknown. For messages sent by the current user, supergroupFullInfo.my_boost_count must be used instead //@author_signature For channel posts and anonymous group messages, optional author signature -//@media_album_id Unique identifier of an album this message belongs to. Only audios, documents, photos and videos can be grouped together in albums +//@media_album_id Unique identifier of an album this message belongs to; 0 if none. Only audios, documents, photos and videos can be grouped together in albums +//@effect_id Unique identifier of the effect added to the message; 0 if none +//@has_sensitive_content True, if media content of the message must be hidden with 18+ spoiler //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this message must be restricted //@content Content of the message -//@reply_markup Reply markup for the message; may be null -message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_added_reactions:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool can_report_reactions:Bool has_timestamped_media:Bool is_channel_post:Bool is_topic_message:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo interaction_info:messageInteractionInfo unread_reactions:vector<unreadReaction> reply_in_chat_id:int53 reply_to_message_id:int53 message_thread_id:int53 self_destruct_time:int32 self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; +//@reply_markup Reply markup for the message; may be null if none +message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool is_from_offline:Bool can_be_saved:Bool has_timestamped_media:Bool is_channel_post:Bool is_topic_message:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo import_info:messageImportInfo interaction_info:messageInteractionInfo unread_reactions:vector<unreadReaction> fact_check:factCheck reply_to:MessageReplyTo message_thread_id:int53 saved_messages_topic_id:int53 self_destruct_type:MessageSelfDestructType self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 sender_business_bot_user_id:int53 sender_boost_count:int32 author_signature:string media_album_id:int64 effect_id:int64 has_sensitive_content:Bool restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; + //@description Contains a list of messages @total_count Approximate total number of messages found @messages List of messages; messages may be null messages total_count:int32 messages:vector<message> = Messages; -//@description Contains a list of messages found by a search @total_count Approximate total number of messages found; -1 if unknown @messages List of messages @next_offset The offset for the next request. If empty, there are no more results +//@description Contains a list of messages found by a search @total_count Approximate total number of messages found; -1 if unknown @messages List of messages @next_offset The offset for the next request. If empty, then there are no more results foundMessages total_count:int32 messages:vector<message> next_offset:string = FoundMessages; //@description Contains a list of messages found by a search in a given chat @total_count Approximate total number of messages found; -1 if unknown @messages List of messages @next_from_message_id The offset for the next request. If 0, there are no more results @@ -1191,6 +1752,13 @@ messageCalendarDay total_count:int32 message:message = MessageCalendarDay; messageCalendar total_count:int32 days:vector<messageCalendarDay> = MessageCalendar; +//@description Describes a message from a business account as received by a bot @message The message @reply_to_message Message that is replied by the message in the same chat; may be null if none +businessMessage message:message reply_to_message:message = BusinessMessage; + +//@description Contains a list of messages from a business account as received by a bot @messages List of business messages +businessMessages messages:vector<businessMessage> = BusinessMessages; + + //@class MessageSource @description Describes source of a message //@description The message is from a chat history @@ -1217,25 +1785,56 @@ messageSourceChatEventLog = MessageSource; //@description The message is from a notification messageSourceNotification = MessageSource; +//@description The message was screenshotted; the source must be used only if the message content was visible during the screenshot +messageSourceScreenshot = MessageSource; + //@description The message is from some other source messageSourceOther = MessageSource; +//@description Information about the sponsor of a message +//@url URL of the sponsor to be opened when the message is clicked +//@photo Photo of the sponsor; may be null if must not be shown +//@info Additional optional information about the sponsor to be shown along with the message +messageSponsor url:string photo:photo info:string = MessageSponsor; + //@description Describes a sponsored message //@message_id Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages //@is_recommended True, if the message needs to be labeled as "recommended" instead of "sponsored" -//@sponsor_chat_id Sponsor chat identifier; 0 if the sponsor chat is accessible through an invite link -//@sponsor_chat_info Information about the sponsor chat; may be null unless sponsor_chat_id == 0 -//@show_chat_photo True, if the sponsor's chat photo must be shown -//@link An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead -//@content Content of the message. Currently, can be only of the type messageText -//@sponsor_info If non-empty, information about the sponsor to be shown along with the message +//@can_be_reported True, if the message can be reported to Telegram moderators through reportChatSponsoredMessage +//@content Content of the message. Currently, can be only of the types messageText, messageAnimation, messagePhoto, or messageVideo +//@sponsor Information about the sponsor of the message +//@title Title of the sponsored message +//@button_text Text for the message action button +//@accent_color_id Identifier of the accent color for title, button text and message background +//@background_custom_emoji_id Identifier of a custom emoji to be shown on the message background; 0 if none //@additional_info If non-empty, additional information about the sponsored message to be shown along with the message -sponsoredMessage message_id:int53 is_recommended:Bool sponsor_chat_id:int53 sponsor_chat_info:chatInviteLinkInfo show_chat_photo:Bool link:InternalLinkType content:MessageContent sponsor_info:string additional_info:string = SponsoredMessage; +sponsoredMessage message_id:int53 is_recommended:Bool can_be_reported:Bool content:MessageContent sponsor:messageSponsor title:string button_text:string accent_color_id:int32 background_custom_emoji_id:int64 additional_info:string = SponsoredMessage; //@description Contains a list of sponsored messages @messages List of sponsored messages @messages_between The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages sponsoredMessages messages:vector<sponsoredMessage> messages_between:int32 = SponsoredMessages; +//@description Describes an option to report a sponsored message @id Unique identifier of the option @text Text of the option +reportChatSponsoredMessageOption id:bytes text:string = ReportChatSponsoredMessageOption; + + +//@class ReportChatSponsoredMessageResult @description Describes result of sponsored message report + +//@description The message was reported successfully +reportChatSponsoredMessageResultOk = ReportChatSponsoredMessageResult; + +//@description The sponsored message is too old or not found +reportChatSponsoredMessageResultFailed = ReportChatSponsoredMessageResult; + +//@description The user must choose an option to report the message and repeat request with the chosen option @title Title for the option choice @options List of available options +reportChatSponsoredMessageResultOptionRequired title:string options:vector<reportChatSponsoredMessageOption> = ReportChatSponsoredMessageResult; + +//@description Sponsored messages were hidden for the user in all chats +reportChatSponsoredMessageResultAdsHidden = ReportChatSponsoredMessageResult; + +//@description The user asked to hide sponsored messages, but Telegram Premium is required for this +reportChatSponsoredMessageResultPremiumRequired = ReportChatSponsoredMessageResult; + //@description Describes a file added to file download list //@file_id File identifier @@ -1254,7 +1853,7 @@ downloadedFileCounts active_count:int32 paused_count:int32 completed_count:int32 //@description Contains a list of downloaded files, found by a search //@total_counts Total number of suitable files, ignoring offset //@files The list of files -//@next_offset The offset for the next request. If empty, there are no more results +//@next_offset The offset for the next request. If empty, then there are no more results foundFileDownloads total_counts:downloadedFileCounts files:vector<fileDownload> next_offset:string = FoundFileDownloads; @@ -1271,35 +1870,66 @@ notificationSettingsScopeChannelChats = NotificationSettingsScope; //@description Contains information about notification settings for a chat or a forum topic -//@use_default_mute_for If true, mute_for is ignored and the value for the relevant type of chat or the forum chat is used instead +//@use_default_mute_for If true, the value for the relevant type of chat or the forum chat is used instead of mute_for //@mute_for Time left before notifications will be unmuted, in seconds //@use_default_sound If true, the value for the relevant type of chat or the forum chat is used instead of sound_id -//@sound_id Identifier of the notification sound to be played; 0 if sound is disabled -//@use_default_show_preview If true, show_preview is ignored and the value for the relevant type of chat or the forum chat is used instead +//@sound_id Identifier of the notification sound to be played for messages; 0 if sound is disabled +//@use_default_show_preview If true, the value for the relevant type of chat or the forum chat is used instead of show_preview //@show_preview True, if message content must be displayed in notifications -//@use_default_disable_pinned_message_notifications If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead +//@use_default_mute_stories If true, the value for the relevant type of chat is used instead of mute_stories +//@mute_stories True, if story notifications are disabled for the chat +//@use_default_story_sound If true, the value for the relevant type of chat is used instead of story_sound_id +//@story_sound_id Identifier of the notification sound to be played for stories; 0 if sound is disabled +//@use_default_show_story_sender If true, the value for the relevant type of chat is used instead of show_story_sender +//@show_story_sender True, if the sender of stories must be displayed in notifications +//@use_default_disable_pinned_message_notifications If true, the value for the relevant type of chat or the forum chat is used instead of disable_pinned_message_notifications //@disable_pinned_message_notifications If true, notifications for incoming pinned messages will be created as for an ordinary unread message -//@use_default_disable_mention_notifications If true, disable_mention_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead +//@use_default_disable_mention_notifications If true, the value for the relevant type of chat or the forum chat is used instead of disable_mention_notifications //@disable_mention_notifications If true, notifications for messages with mentions will be created as for an ordinary unread message -chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_sound:Bool sound_id:int64 use_default_show_preview:Bool show_preview:Bool use_default_disable_pinned_message_notifications:Bool disable_pinned_message_notifications:Bool use_default_disable_mention_notifications:Bool disable_mention_notifications:Bool = ChatNotificationSettings; +chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_sound:Bool sound_id:int64 use_default_show_preview:Bool show_preview:Bool use_default_mute_stories:Bool mute_stories:Bool use_default_story_sound:Bool story_sound_id:int64 use_default_show_story_sender:Bool show_story_sender:Bool use_default_disable_pinned_message_notifications:Bool disable_pinned_message_notifications:Bool use_default_disable_mention_notifications:Bool disable_mention_notifications:Bool = ChatNotificationSettings; //@description Contains information about notification settings for several chats //@mute_for Time left before notifications will be unmuted, in seconds //@sound_id Identifier of the notification sound to be played; 0 if sound is disabled //@show_preview True, if message content must be displayed in notifications +//@use_default_mute_stories If true, story notifications are received only for the first 5 chats from topChatCategoryUsers regardless of the value of mute_stories +//@mute_stories True, if story notifications are disabled +//@story_sound_id Identifier of the notification sound to be played for stories; 0 if sound is disabled +//@show_story_sender True, if the sender of stories must be displayed in notifications //@disable_pinned_message_notifications True, if notifications for incoming pinned messages will be created as for an ordinary unread message //@disable_mention_notifications True, if notifications for messages with mentions will be created as for an ordinary unread message -scopeNotificationSettings mute_for:int32 sound_id:int64 show_preview:Bool disable_pinned_message_notifications:Bool disable_mention_notifications:Bool = ScopeNotificationSettings; +scopeNotificationSettings mute_for:int32 sound_id:int64 show_preview:Bool use_default_mute_stories:Bool mute_stories:Bool story_sound_id:int64 show_story_sender:Bool disable_pinned_message_notifications:Bool disable_mention_notifications:Bool = ScopeNotificationSettings; + + +//@class ReactionNotificationSource @description Describes sources of reactions for which notifications will be shown + +//@description Notifications for reactions are disabled +reactionNotificationSourceNone = ReactionNotificationSource; + +//@description Notifications for reactions are shown only for reactions from contacts +reactionNotificationSourceContacts = ReactionNotificationSource; + +//@description Notifications for reactions are shown for all reactions +reactionNotificationSourceAll = ReactionNotificationSource; + + +//@description Contains information about notification settings for reactions +//@message_reaction_source Source of message reactions for which notifications are shown +//@story_reaction_source Source of story reactions for which notifications are shown +//@sound_id Identifier of the notification sound to be played; 0 if sound is disabled +//@show_preview True, if reaction sender and emoji must be displayed in notifications +reactionNotificationSettings message_reaction_source:ReactionNotificationSource story_reaction_source:ReactionNotificationSource sound_id:int64 show_preview:Bool = ReactionNotificationSettings; //@description Contains information about a message draft -//@reply_to_message_id Identifier of the replied message; 0 if none +//@reply_to Information about the message to be replied; must be of the type inputMessageReplyToMessage; may be null if none //@date Point in time (Unix timestamp) when the draft was created -//@input_message_text Content of the message draft; must be of the type inputMessageText -draftMessage reply_to_message_id:int53 date:int32 input_message_text:InputMessageContent = DraftMessage; +//@input_message_text Content of the message draft; must be of the type inputMessageText, inputMessageVideoNote, or inputMessageVoiceNote +//@effect_id Identifier of the effect to apply to the message when it is sent; 0 if none +draftMessage reply_to:InputMessageReplyTo date:int32 input_message_text:InputMessageContent effect_id:int64 = DraftMessage; -//@class ChatType @description Describes the type of a chat +//@class ChatType @description Describes the type of chat //@description An ordinary chat with a user @user_id User identifier chatTypePrivate user_id:int53 = ChatType; @@ -1310,7 +1940,7 @@ chatTypeBasicGroup basic_group_id:int53 = ChatType; //@description A supergroup or channel (with unlimited members) @supergroup_id Supergroup or channel identifier @is_channel True, if the supergroup is a channel chatTypeSupergroup supergroup_id:int53 is_channel:Bool = ChatType; -//@description A secret chat with a user @secret_chat_id Secret chat identifier @user_id User identifier of the secret chat peer +//@description A secret chat with a user @secret_chat_id Secret chat identifier @user_id User identifier of the other user in the secret chat chatTypeSecret secret_chat_id:int32 user_id:int53 = ChatType; @@ -1321,6 +1951,7 @@ chatFolderIcon name:string = ChatFolderIcon; //@description Represents a folder for user chats //@title The title of the folder; 1-12 characters without line feeds //@icon The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder +//@color_id The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is disabled. Can't be changed if folder tags are disabled or the current user doesn't have Telegram Premium subscription //@is_shareable True, if at least one link has been created for the folder //@pinned_chat_ids The chat identifiers of pinned chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium //@included_chat_ids The chat identifiers of always included chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium @@ -1333,14 +1964,16 @@ chatFolderIcon name:string = ChatFolderIcon; //@include_bots True, if bots need to be included //@include_groups True, if basic groups and supergroups need to be included //@include_channels True, if channels need to be included -chatFolder title:string icon:chatFolderIcon is_shareable:Bool pinned_chat_ids:vector<int53> included_chat_ids:vector<int53> excluded_chat_ids:vector<int53> exclude_muted:Bool exclude_read:Bool exclude_archived:Bool include_contacts:Bool include_non_contacts:Bool include_bots:Bool include_groups:Bool include_channels:Bool = ChatFolder; +chatFolder title:string icon:chatFolderIcon color_id:int32 is_shareable:Bool pinned_chat_ids:vector<int53> included_chat_ids:vector<int53> excluded_chat_ids:vector<int53> exclude_muted:Bool exclude_read:Bool exclude_archived:Bool include_contacts:Bool include_non_contacts:Bool include_bots:Bool include_groups:Bool include_channels:Bool = ChatFolder; //@description Contains basic information about a chat folder //@id Unique chat folder identifier //@title The title of the folder; 1-12 characters without line feeds //@icon The chosen or default icon for the chat folder +//@color_id The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is disabled +//@is_shareable True, if at least one link has been created for the folder //@has_my_invite_links True, if the chat folder has invite links created by the current user -chatFolderInfo id:int32 title:string icon:chatFolderIcon has_my_invite_links:Bool = ChatFolderInfo; +chatFolderInfo id:int32 title:string icon:chatFolderIcon color_id:int32 is_shareable:Bool has_my_invite_links:Bool = ChatFolderInfo; //@description Contains a chat folder invite link //@invite_link The chat folder invite link @@ -1363,6 +1996,12 @@ recommendedChatFolder folder:chatFolder description:string = RecommendedChatFold //@description Contains a list of recommended chat folders @chat_folders List of recommended chat folders recommendedChatFolders chat_folders:vector<recommendedChatFolder> = RecommendedChatFolders; +//@description Contains settings for automatic moving of chats to and from the Archive chat lists +//@archive_and_mute_new_chats_from_unknown_users True, if new chats from non-contacts will be automatically archived and muted. Can be set to true only if the option "can_archive_and_mute_new_chats_from_unknown_users" is true +//@keep_unmuted_chats_archived True, if unmuted chats will be kept in the Archive chat list when they get a new message +//@keep_chats_from_folders_archived True, if unmuted chats, that are always included or pinned in a folder, will be kept in the Archive chat list when they get a new message. Ignored if keep_unmuted_chats_archived == true +archiveChatListSettings archive_and_mute_new_chats_from_unknown_users:Bool keep_unmuted_chats_archived:Bool keep_chats_from_folders_archived:Bool = ArchiveChatListSettings; + //@class ChatList @description Describes a list of chats @@ -1398,11 +2037,30 @@ chatPosition list:ChatList order:int64 is_pinned:Bool source:ChatSource = ChatPo //@class ChatAvailableReactions @description Describes reactions available in the chat -//@description All reactions are available in the chat -chatAvailableReactionsAll = ChatAvailableReactions; +//@description All reactions are available in the chat, excluding the paid reaction and custom reactions in channel chats +//@max_reaction_count The maximum allowed number of reactions per message; 1-11 +chatAvailableReactionsAll max_reaction_count:int32 = ChatAvailableReactions; -//@description Only specific reactions are available in the chat @reactions The list of reactions -chatAvailableReactionsSome reactions:vector<ReactionType> = ChatAvailableReactions; +//@description Only specific reactions are available in the chat @reactions The list of reactions @max_reaction_count The maximum allowed number of reactions per message; 1-11 +chatAvailableReactionsSome reactions:vector<ReactionType> max_reaction_count:int32 = ChatAvailableReactions; + + +//@description Represents a tag used in Saved Messages or a Saved Messages topic +//@tag The tag +//@label Label of the tag; 0-12 characters. Always empty if the tag is returned for a Saved Messages topic +//@count Number of times the tag was used; may be 0 if the tag has non-empty label +savedMessagesTag tag:ReactionType label:string count:int32 = SavedMessagesTag; + +//@description Contains a list of tags used in Saved Messages @tags List of tags +savedMessagesTags tags:vector<savedMessagesTag> = SavedMessagesTags; + + +//@description Contains information about a business bot that manages the chat +//@bot_user_id User identifier of the bot +//@manage_url URL to be opened to manage the bot +//@is_bot_paused True, if the bot is paused. Use toggleBusinessConnectedBotChatIsPaused to change the value of the field +//@can_bot_reply True, if the bot can reply +businessBotManageBar bot_user_id:int53 manage_url:string is_bot_paused:Bool can_bot_reply:Bool = BusinessBotManageBar; //@description Describes a video chat @@ -1417,14 +2075,20 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@type Type of the chat //@title Chat title //@photo Chat photo; may be null +//@accent_color_id Identifier of the accent color for message sender name, and backgrounds of chat photo, reply header, and link preview +//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header and link preview background for messages sent by the chat; 0 if none +//@profile_accent_color_id Identifier of the profile accent color for the chat's profile; -1 if none +//@profile_background_custom_emoji_id Identifier of a custom emoji to be shown on the background of the chat's profile; 0 if none //@permissions Actions that non-administrator chat members are allowed to take in the chat -//@last_message Last message in the chat; may be null +//@last_message Last message in the chat; may be null if none or unknown //@positions Positions of the chat in chat lists +//@chat_lists Chat lists to which the chat belongs. A chat can have a non-zero position in a chat list even it doesn't belong to the chat list and have no position in a chat list even it belongs to the chat list //@message_sender_id Identifier of a user or chat that is selected to send messages in the chat; may be null if the user can't change message sender +//@block_list Block list to which the chat is added; may be null if none //@has_protected_content True, if chat content can't be saved locally, forwarded, or copied //@is_translatable True, if translation of all messages in the chat must be suggested to the user //@is_marked_as_unread True, if the chat is marked as unread -//@is_blocked True, if the chat is blocked by the current user and private messages from the chat can't be received +//@view_as_topics True, if the chat is a forum supergroup that must be shown in the "View as topics" mode, or Saved Messages chat that must be shown in the "View as chats" //@has_scheduled_messages True, if the chat has scheduled messages //@can_be_deleted_only_for_self True, if the chat messages can be deleted only for the current user while other users will continue to see the messages //@can_be_deleted_for_all_users True, if the chat messages can be deleted for all users @@ -1438,20 +2102,36 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@notification_settings Notification settings for the chat //@available_reactions Types of reaction, available in the chat //@message_auto_delete_time Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date +//@emoji_status Emoji status to be shown along with chat title; may be null //@background Background set for the chat; may be null if none //@theme_name If non-empty, name of a theme, set for the chat -//@action_bar Information about actions which must be possible to do through the chat action bar; may be null +//@action_bar Information about actions which must be possible to do through the chat action bar; may be null if none +//@business_bot_manage_bar Information about bar for managing a business bot in the chat; may be null if none //@video_chat Information about video chat of the chat -//@pending_join_requests Information about pending join requests; may be null +//@pending_join_requests Information about pending join requests; may be null if none //@reply_markup_message_id Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat -//@draft_message A draft of a message in the chat; may be null +//@draft_message A draft of a message in the chat; may be null if none //@client_data Application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used -chat id:int53 type:ChatType title:string photo:chatPhotoInfo permissions:chatPermissions last_message:message positions:vector<chatPosition> message_sender_id:MessageSender has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool is_blocked:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time:int32 background:chatBackground theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; +chat id:int53 type:ChatType title:string photo:chatPhotoInfo accent_color_id:int32 background_custom_emoji_id:int64 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 permissions:chatPermissions last_message:message positions:vector<chatPosition> chat_lists:vector<ChatList> message_sender_id:MessageSender block_list:BlockList has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool view_as_topics:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time:int32 emoji_status:emojiStatus background:chatBackground theme_name:string action_bar:ChatActionBar business_bot_manage_bar:businessBotManageBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; //@description Represents a list of chats @total_count Approximate total number of chats found @chat_ids List of chat identifiers chats total_count:int32 chat_ids:vector<int53> = Chats; +//@description Contains information about a user that has failed to be added to a chat +//@user_id User identifier +//@premium_would_allow_invite True, if subscription to Telegram Premium would have allowed to add the user to the chat +//@premium_required_to_send_messages True, if subscription to Telegram Premium is required to send the user chat invite link +failedToAddMember user_id:int53 premium_would_allow_invite:Bool premium_required_to_send_messages:Bool = FailedToAddMember; + +//@description Represents a list of users that has failed to be added to a chat @failed_to_add_members Information about users that weren't added to the chat +failedToAddMembers failed_to_add_members:vector<failedToAddMember> = FailedToAddMembers; + + +//@description Contains information about a newly created basic group chat @chat_id Chat identifier @failed_to_add_members Information about failed to add members +createdBasicGroupChat chat_id:int53 failed_to_add_members:failedToAddMembers = CreatedBasicGroupChat; + + //@description Describes a chat located nearby @chat_id Chat identifier @distance Distance to the chat location, in meters chatNearby chat_id:int53 distance:int32 = ChatNearby; @@ -1459,7 +2139,7 @@ chatNearby chat_id:int53 distance:int32 = ChatNearby; chatsNearby users_nearby:vector<chatNearby> supergroups_nearby:vector<chatNearby> = ChatsNearby; -//@class PublicChatType @description Describes a type of public chats +//@class PublicChatType @description Describes type of public chat //@description The chat is public, because it has an active username publicChatTypeHasUsername = PublicChatType; @@ -1470,20 +2150,20 @@ publicChatTypeIsLocationBased = PublicChatType; //@class ChatActionBar @description Describes actions which must be possible to do through a chat action bar -//@description The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown +//@description The chat can be reported as spam using the method reportChat with the reason reportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown //@can_unarchive If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings chatActionBarReportSpam can_unarchive:Bool = ChatActionBar; -//@description The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason chatReportReasonUnrelatedLocation +//@description The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason reportReasonUnrelatedLocation chatActionBarReportUnrelatedLocation = ChatActionBar; //@description The chat is a recently created group chat to which new members can be invited chatActionBarInviteMembers = ChatActionBar; -//@description The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method toggleMessageSenderIsBlocked, +//@description The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method setMessageSenderBlockList, //-or the other user can be added to the contact list using the method addContact. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown //@can_unarchive If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings -//@distance If non-negative, the current user was found by the peer through searchChatsNearby and this is the distance between the users +//@distance If non-negative, the current user was found by the other user through searchChatsNearby and this is the distance between the users chatActionBarReportAddBlock can_unarchive:Bool distance:int32 = ChatActionBar; //@description The chat is a private or secret chat and the other user can be added to the contact list using the method addContact @@ -1513,13 +2193,17 @@ keyboardButtonTypeRequestLocation = KeyboardButtonType; //@description A button that allows the user to create and send a poll when pressed; available only in private chats @force_regular If true, only regular polls must be allowed to create @force_quiz If true, only polls in quiz mode must be allowed to create keyboardButtonTypeRequestPoll force_regular:Bool force_quiz:Bool = KeyboardButtonType; -//@description A button that requests a user to be shared by the current user; available only in private chats. Use the method shareUserWithBot to complete the request +//@description A button that requests users to be shared by the current user; available only in private chats. Use the method shareUsersWithBot to complete the request //@id Unique button identifier -//@restrict_user_is_bot True, if the shared user must or must not be a bot -//@user_is_bot True, if the shared user must be a bot; otherwise, the shared user must no be a bot. Ignored if restrict_user_is_bot is false -//@restrict_user_is_premium True, if the shared user must or must not be a Telegram Premium user -//@user_is_premium True, if the shared user must be a Telegram Premium user; otherwise, the shared user must no be a Telegram Premium user. Ignored if restrict_user_is_premium is false -keyboardButtonTypeRequestUser id:int32 restrict_user_is_bot:Bool user_is_bot:Bool restrict_user_is_premium:Bool user_is_premium:Bool = KeyboardButtonType; +//@restrict_user_is_bot True, if the shared users must or must not be bots +//@user_is_bot True, if the shared users must be bots; otherwise, the shared users must not be bots. Ignored if restrict_user_is_bot is false +//@restrict_user_is_premium True, if the shared users must or must not be Telegram Premium users +//@user_is_premium True, if the shared users must be Telegram Premium users; otherwise, the shared users must not be Telegram Premium users. Ignored if restrict_user_is_premium is false +//@max_quantity The maximum number of users to share +//@request_name Pass true to request name of the users; bots only +//@request_username Pass true to request username of the users; bots only +//@request_photo Pass true to request photo of the users; bots only +keyboardButtonTypeRequestUsers id:int32 restrict_user_is_bot:Bool user_is_bot:Bool restrict_user_is_premium:Bool user_is_premium:Bool max_quantity:int32 request_name:Bool request_username:Bool request_photo:Bool = KeyboardButtonType; //@description A button that requests a chat to be shared by the current user; available only in private chats. Use the method shareChatWithBot to complete the request //@id Unique button identifier @@ -1532,7 +2216,10 @@ keyboardButtonTypeRequestUser id:int32 restrict_user_is_bot:Bool user_is_bot:Boo //@user_administrator_rights Expected user administrator rights in the chat; may be null if they aren't restricted //@bot_administrator_rights Expected bot administrator rights in the chat; may be null if they aren't restricted //@bot_is_member True, if the bot must be a member of the chat; for basic group and supergroup chats only -keyboardButtonTypeRequestChat id:int32 chat_is_channel:Bool restrict_chat_is_forum:Bool chat_is_forum:Bool restrict_chat_has_username:Bool chat_has_username:Bool chat_is_created:Bool user_administrator_rights:chatAdministratorRights bot_administrator_rights:chatAdministratorRights bot_is_member:Bool = KeyboardButtonType; +//@request_title Pass true to request title of the chat; bots only +//@request_username Pass true to request username of the chat; bots only +//@request_photo Pass true to request photo of the chat; bots only +keyboardButtonTypeRequestChat id:int32 chat_is_channel:Bool restrict_chat_is_forum:Bool chat_is_forum:Bool restrict_chat_has_username:Bool chat_has_username:Bool chat_is_created:Bool user_administrator_rights:chatAdministratorRights bot_administrator_rights:chatAdministratorRights bot_is_member:Bool request_title:Bool request_username:Bool request_photo:Bool = KeyboardButtonType; //@description A button that opens a Web App by calling getWebAppUrl @url An HTTP URL to pass to getWebAppUrl keyboardButtonTypeWebApp url:string = KeyboardButtonType; @@ -1542,9 +2229,9 @@ keyboardButtonTypeWebApp url:string = KeyboardButtonType; keyboardButton text:string type:KeyboardButtonType = KeyboardButton; -//@class InlineKeyboardButtonType @description Describes the type of an inline keyboard button +//@class InlineKeyboardButtonType @description Describes the type of inline keyboard button -//@description A button that opens a specified URL @url HTTP or tg:// URL to open +//@description A button that opens a specified URL @url HTTP or tg:// URL to open. If the link is of the type internalLinkTypeWebApp, then the button must be marked as a Web App button inlineKeyboardButtonTypeUrl url:string = InlineKeyboardButtonType; //@description A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo @url An HTTP URL to pass to getLoginUrlInfo @id Unique button identifier @forward_text If non-empty, new text of the button in forwarded messages @@ -1623,17 +2310,42 @@ foundWebApp web_app:webApp request_write_access:Bool skip_confirmation:Bool = Fo //@description Contains information about a Web App @launch_id Unique identifier for the Web App launch @url A Web App URL to open in a web view webAppInfo launch_id:int64 url:string = WebAppInfo; +//@description Contains information about the main Web App of a bot @url URL of the Web App to open @is_compact True, if the Web App must always be opened in the compact mode instead of the full-size mode +mainWebApp url:string is_compact:Bool = MainWebApp; + //@description Contains information about a message thread //@chat_id Identifier of the chat to which the message thread belongs //@message_thread_id Message thread identifier, unique within the chat //@reply_info Information about the message thread; may be null for forum topic threads //@unread_message_count Approximate number of unread messages in the message thread -//@messages The messages from which the thread starts. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) -//@draft_message A draft of a message in the message thread; may be null +//@messages The messages from which the thread starts. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id) +//@draft_message A draft of a message in the message thread; may be null if none messageThreadInfo chat_id:int53 message_thread_id:int53 reply_info:messageReplyInfo unread_message_count:int32 messages:vector<message> draft_message:draftMessage = MessageThreadInfo; +//@class SavedMessagesTopicType @description Describes type of Saved Messages topic + +//@description Topic containing messages sent by the current user of forwarded from an unknown chat +savedMessagesTopicTypeMyNotes = SavedMessagesTopicType; + +//@description Topic containing messages forwarded from a user with hidden privacy +savedMessagesTopicTypeAuthorHidden = SavedMessagesTopicType; + +//@description Topic containing messages forwarded from a specific chat @chat_id Identifier of the chat +savedMessagesTopicTypeSavedFromChat chat_id:int53 = SavedMessagesTopicType; + + +//@description Contains information about a Saved Messages topic +//@id Unique topic identifier +//@type Type of the topic +//@is_pinned True, if the topic is pinned +//@order A parameter used to determine order of the topic in the topic list. Topics must be sorted by the order in descending order +//@last_message Last message in the topic; may be null if none or unknown +//@draft_message A draft of a message in the topic; may be null if none +savedMessagesTopic id:int53 type:SavedMessagesTopicType is_pinned:Bool order:int64 last_message:message draft_message:draftMessage = SavedMessagesTopic; + + //@description Describes a forum topic icon @color Color of the topic icon in RGB format @custom_emoji_id Unique identifier of the custom emoji shown on the topic icon; 0 if none forumTopicIcon color:int32 custom_emoji_id:int64 = ForumTopicIcon; @@ -1641,7 +2353,7 @@ forumTopicIcon color:int32 custom_emoji_id:int64 = ForumTopicIcon; //@message_thread_id Message thread identifier of the topic //@name Name of the topic //@icon Icon of the topic -//@creation_date Date the topic was created +//@creation_date Point in time (Unix timestamp) when the topic was created //@creator_id Identifier of the creator of the topic //@is_general True, if the topic is the General topic list //@is_outgoing True, if the topic was created by the current user @@ -1659,7 +2371,7 @@ forumTopicInfo message_thread_id:int53 name:string icon:forumTopicIcon creation_ //@unread_mention_count Number of unread messages with a mention/reply in the topic //@unread_reaction_count Number of messages with unread reactions in the topic //@notification_settings Notification settings for the topic -//@draft_message A draft of a message in the topic; may be null +//@draft_message A draft of a message in the topic; may be null if none forumTopic info:forumTopicInfo last_message:message is_pinned:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings draft_message:draftMessage = ForumTopic; //@description Describes a list of forum topics @@ -1671,7 +2383,41 @@ forumTopic info:forumTopicInfo last_message:message is_pinned:Bool unread_count: forumTopics total_count:int32 topics:vector<forumTopic> next_offset_date:int32 next_offset_message_id:int53 next_offset_message_thread_id:int53 = ForumTopics; -//@class RichText @description Describes a text object inside an instant-view web page +//@description Options to be used for generation of a link preview +//@is_disabled True, if link preview must be disabled +//@url URL to use for link preview. If empty, then the first URL found in the message text will be used +//@force_small_media True, if shown media preview must be small; ignored in secret chats or if the URL isn't explicitly specified +//@force_large_media True, if shown media preview must be large; ignored in secret chats or if the URL isn't explicitly specified +//@show_above_text True, if link preview must be shown above message text; otherwise, the link preview will be shown below the message text; ignored in secret chats +linkPreviewOptions is_disabled:Bool url:string force_small_media:Bool force_large_media:Bool show_above_text:Bool = LinkPreviewOptions; + + +//@description Contains information about a user shared with a bot +//@user_id User identifier +//@first_name First name of the user; for bots only +//@last_name Last name of the user; for bots only +//@username Username of the user; for bots only +//@photo Profile photo of the user; for bots only; may be null +sharedUser user_id:int53 first_name:string last_name:string username:string photo:photo = SharedUser; + +//@description Contains information about a chat shared with a bot +//@chat_id Chat identifier +//@title Title of the chat; for bots only +//@username Username of the chat; for bots only +//@photo Photo of the chat; for bots only; may be null +sharedChat chat_id:int53 title:string username:string photo:photo = SharedChat; + + +//@description Describes theme settings +//@accent_color Theme accent color in ARGB format +//@background The background to be used in chats; may be null +//@outgoing_message_fill The fill to be used as a background for outgoing messages +//@animate_outgoing_message_fill If true, the freeform gradient fill needs to be animated on every sent message +//@outgoing_message_accent_color Accent color of outgoing messages in ARGB format +themeSettings accent_color:int32 background:background outgoing_message_fill:BackgroundFill animate_outgoing_message_fill:Bool outgoing_message_accent_color:int32 = ThemeSettings; + + +//@class RichText @description Describes a formatted text object //@description A plain text @text Text richTextPlain text:string = RichText; @@ -1715,20 +2461,20 @@ richTextPhoneNumber text:RichText phone_number:string = RichText; //@height Height of a bounding box in which the image must be shown; 0 if unknown richTextIcon document:document width:int32 height:int32 = RichText; -//@description A reference to a richTexts object on the same web page @text The text @anchor_name The name of a richTextAnchor object, which is the first element of the target richTexts object @url An HTTP URL, opening the reference +//@description A reference to a richTexts object on the same page @text The text @anchor_name The name of a richTextAnchor object, which is the first element of the target richTexts object @url An HTTP URL, opening the reference richTextReference text:RichText anchor_name:string url:string = RichText; //@description An anchor @name Anchor name richTextAnchor name:string = RichText; -//@description A link to an anchor on the same web page @text The link text @anchor_name The anchor name. If the name is empty, the link must bring back to top @url An HTTP URL, opening the anchor +//@description A link to an anchor on the same page @text The link text @anchor_name The anchor name. If the name is empty, the link must bring back to top @url An HTTP URL, opening the anchor richTextAnchorLink text:RichText anchor_name:string url:string = RichText; //@description A concatenation of rich texts @texts Texts richTexts texts:vector<RichText> = RichText; -//@description Contains a caption of an instant view web page block, consisting of a text and a trailing credit @text Content of the caption @credit Block credit (like HTML tag <cite>) +//@description Contains a caption of another block @text Content of the caption @credit Block credit (like HTML tag <cite>) pageBlockCaption text:RichText credit:RichText = PageBlockCaption; //@description Describes an item of a list page block @label Item label @page_blocks Item blocks @@ -1775,7 +2521,7 @@ pageBlockTableCell text:RichText is_header:Bool colspan:int32 rowspan:int32 alig pageBlockRelatedArticle url:string title:string description:string photo:photo author:string publish_date:int32 = PageBlockRelatedArticle; -//@class PageBlock @description Describes a block of an instant view web page +//@class PageBlock @description Describes a block of an instant view for a web page //@description The title of a page @title Title pageBlockTitle title:RichText = PageBlock; @@ -1857,7 +2603,7 @@ pageBlockVoiceNote voice_note:voiceNote caption:pageBlockCaption = PageBlock; pageBlockCover cover:PageBlock = PageBlock; //@description An embedded web page -//@url Web page URL, if available +//@url URL of the embedded page, if available //@html HTML-markup of the embedded page //@poster_photo Poster photo, if available; may be null //@width Block width; 0 if unknown @@ -1868,7 +2614,7 @@ pageBlockCover cover:PageBlock = PageBlock; pageBlockEmbedded url:string html:string poster_photo:photo width:int32 height:int32 caption:pageBlockCaption is_full_width:Bool allow_scrolling:Bool = PageBlock; //@description An embedded post -//@url Web page URL +//@url URL of the embedded post //@author Post author //@author_photo Post author photo; may be null //@date Point in time (Unix timestamp) when the post was created; 0 if unknown @@ -1889,8 +2635,9 @@ pageBlockSlideshow page_blocks:vector<PageBlock> caption:pageBlockCaption = Page //@description A link to a chat //@title Chat title //@photo Chat photo; may be null +//@accent_color_id Identifier of the accent color for chat title and background of chat photo //@username Chat username by which all other information about the chat can be resolved -pageBlockChatLink title:string photo:chatPhotoInfo username:string = PageBlock; +pageBlockChatLink title:string photo:chatPhotoInfo accent_color_id:int32 username:string = PageBlock; //@description A table //@caption Table caption @@ -1920,38 +2667,165 @@ pageBlockMap location:location zoom:int32 width:int32 height:int32 caption:pageB //@description Describes an instant view page for a web page -//@page_blocks Content of the web page +//@page_blocks Content of the instant view page //@view_count Number of the instant view views; 0 if unknown //@version Version of the instant view; currently, can be 1 or 2 //@is_rtl True, if the instant view must be shown from right to left -//@is_full True, if the instant view contains the full page. A network request might be needed to get the full web page instant view +//@is_full True, if the instant view contains the full page. A network request might be needed to get the full instant view //@feedback_link An internal link to be opened to leave feedback about the instant view webPageInstantView page_blocks:vector<PageBlock> view_count:int32 version:int32 is_rtl:Bool is_full:Bool feedback_link:InternalLinkType = WebPageInstantView; -//@description Describes a web page preview +//@class LinkPreviewAlbumMedia @description Describes a media from a link preview album + +//@description The media is a photo @photo Photo description +linkPreviewAlbumMediaPhoto photo:photo = LinkPreviewAlbumMedia; + +//@description The media is a video @video Video description +linkPreviewAlbumMediaVideo video:video = LinkPreviewAlbumMedia; + + +//@class LinkPreviewType @description Describes type of link preview + +//@description The link is a link to a media album consisting of photos and videos @media The list of album media @caption Album caption +linkPreviewTypeAlbum media:vector<LinkPreviewAlbumMedia> caption:string = LinkPreviewType; + +//@description The link is a link to an animation @animation The animation +linkPreviewTypeAnimation animation:animation = LinkPreviewType; + +//@description The link is a link to an app at App Store or Google Play @photo Photo for the app +linkPreviewTypeApp photo:photo = LinkPreviewType; + +//@description The link is a link to a web site @photo Article's main photo; may be null +linkPreviewTypeArticle photo:photo = LinkPreviewType; + +//@description The link is a link to an audio @audio The audio description +linkPreviewTypeAudio audio:audio = LinkPreviewType; + +//@description The link is a link to a background. Link preview title and description are available only for filled backgrounds +//@document Document with the background; may be null for filled backgrounds +//@background_type Type of the background; may be null if unknown +linkPreviewTypeBackground document:document background_type:BackgroundType = LinkPreviewType; + +//@description The link is a link to boost a channel chat @photo Photo of the chat; may be null +linkPreviewTypeChannelBoost photo:chatPhoto = LinkPreviewType; + +//@description The link is a link to a chat +//@type Type of the chat +//@photo Photo of the chat; may be null +//@creates_join_request True, if the link only creates join request +linkPreviewTypeChat type:InviteLinkChatType photo:chatPhoto creates_join_request:Bool = LinkPreviewType; + +//@description The link is a link to a general file @document The document description +linkPreviewTypeDocument document:document = LinkPreviewType; + +//@description The link is a link to an animation player +//@url URL of the external animation player +//@thumbnail Thumbnail of the animation; may be null if unknown +//@duration Duration of the animation, in seconds +//@width Expected width of the embedded player +//@height Expected height of the embedded player +linkPreviewTypeEmbeddedAnimationPlayer url:string thumbnail:photo duration:int32 width:int32 height:int32 = LinkPreviewType; + +//@description The link is a link to an audio player +//@url URL of the external audio player +//@thumbnail Thumbnail of the audio; may be null if unknown +//@duration Duration of the audio, in seconds +//@width Expected width of the embedded player +//@height Expected height of the embedded player +linkPreviewTypeEmbeddedAudioPlayer url:string thumbnail:photo duration:int32 width:int32 height:int32 = LinkPreviewType; + +//@description The link is a link to a video player +//@url URL of the external video player +//@thumbnail Thumbnail of the video; may be null if unknown +//@duration Duration of the video, in seconds +//@width Expected width of the embedded player +//@height Expected height of the embedded player +linkPreviewTypeEmbeddedVideoPlayer url:string thumbnail:photo duration:int32 width:int32 height:int32 = LinkPreviewType; + +//@description The link is a link to an audio file +//@url URL of the audio file +//@mime_type MIME type of the audio file +//@duration Duration of the audio, in seconds; 0 if unknown +linkPreviewTypeExternalAudio url:string mime_type:string duration:int32 = LinkPreviewType; + +//@description The link is a link to a video file +//@url URL of the video file +//@mime_type MIME type of the video file +//@width Expected width of the video preview; 0 if unknown +//@height Expected height of the video preview; 0 if unknown +//@duration Duration of the video, in seconds; 0 if unknown +linkPreviewTypeExternalVideo url:string mime_type:string width:int32 height:int32 duration:int32 = LinkPreviewType; + +//@description The link is a link to an invoice +linkPreviewTypeInvoice = LinkPreviewType; + +//@description The link is a link to a text or a poll Telegram message +linkPreviewTypeMessage = LinkPreviewType; + +//@description The link is a link to a photo @photo The photo +linkPreviewTypePhoto photo:photo = LinkPreviewType; + +//@description The link is a link to a Telegram Premium gift code +linkPreviewTypePremiumGiftCode = LinkPreviewType; + +//@description The link is a link to a shareable chat folder +linkPreviewTypeShareableChatFolder = LinkPreviewType; + +//@description The link is a link to a sticker @sticker The sticker. It can be an arbitrary WEBP image and can have dimensions bigger than 512 +linkPreviewTypeSticker sticker:sticker = LinkPreviewType; + +//@description The link is a link to a sticker set @stickers Up to 4 stickers from the sticker set +linkPreviewTypeStickerSet stickers:vector<sticker> = LinkPreviewType; + +//@description The link is a link to a story. Link preview description is unavailable @story_sender_chat_id The identifier of the chat that posted the story @story_id Story identifier +linkPreviewTypeStory story_sender_chat_id:int53 story_id:int32 = LinkPreviewType; + +//@description The link is a link to boost a supergroup chat @photo Photo of the chat; may be null +linkPreviewTypeSupergroupBoost photo:chatPhoto = LinkPreviewType; + +//@description The link is a link to a cloud theme. TDLib has no theme support yet @documents The list of files with theme description @settings Settings for the cloud theme +linkPreviewTypeTheme documents:vector<document> settings:themeSettings = LinkPreviewType; + +//@description The link preview type is unsupported yet +linkPreviewTypeUnsupported = LinkPreviewType; + +//@description The link is a link to a user @photo Photo of the user; may be null if none @is_bot True, if the user is a bot +linkPreviewTypeUser photo:chatPhoto is_bot:Bool = LinkPreviewType; + +//@description The link is a link to a video @video The video description +linkPreviewTypeVideo video:video = LinkPreviewType; + +//@description The link is a link to a video chat +//@photo Photo of the chat with the video chat; may be null if none +//@is_live_stream True, if the video chat is expected to be a live stream in a channel or a broadcast group +linkPreviewTypeVideoChat photo:chatPhoto is_live_stream:Bool = LinkPreviewType; + +//@description The link is a link to a video note message @video_note The video note +linkPreviewTypeVideoNote video_note:videoNote = LinkPreviewType; + +//@description The link is a link to a voice note message @voice_note The voice note +linkPreviewTypeVoiceNote voice_note:voiceNote = LinkPreviewType; + +//@description The link is a link to a Web App @photo Web App photo +linkPreviewTypeWebApp photo:photo = LinkPreviewType; + + +//@description Describes a link preview //@url Original URL of the link //@display_url URL to display -//@type Type of the web page. Can be: article, photo, audio, video, document, profile, app, or something else //@site_name Short name of the site (e.g., Google Docs, App Store) //@title Title of the content //@param_description Description of the content -//@photo Image representing the content; may be null -//@embed_url URL to show in the embedded preview -//@embed_type MIME type of the embedded preview, (e.g., text/html or video/mp4) -//@embed_width Width of the embedded preview -//@embed_height Height of the embedded preview -//@duration Duration of the content, in seconds //@author Author of the content -//@animation Preview of the content as an animation, if available; may be null -//@audio Preview of the content as an audio file, if available; may be null -//@document Preview of the content as a document, if available; may be null -//@sticker Preview of the content as a sticker for small WEBP files, if available; may be null -//@video Preview of the content as a video, if available; may be null -//@video_note Preview of the content as a video note, if available; may be null -//@voice_note Preview of the content as a voice note, if available; may be null -//@instant_view_version Version of web page instant view (currently, can be 1 or 2); 0 if none -webPage url:string display_url:string type:string site_name:string title:string description:formattedText photo:photo embed_url:string embed_type:string embed_width:int32 embed_height:int32 duration:int32 author:string animation:animation audio:audio document:document sticker:sticker video:video video_note:videoNote voice_note:voiceNote instant_view_version:int32 = WebPage; +//@type Type of the link preview +//@has_large_media True, if size of media in the preview can be changed +//@show_large_media True, if large media preview must be shown; otherwise, the media preview must be shown small and only the first frame must be shown for videos +//@show_media_above_description True, if media must be shown above link preview description; otherwise, the media must be shown below the description +//@skip_confirmation True, if there is no need to show an ordinary open URL confirmation, when opening the URL from the preview, because the URL is shown in the message text in clear +//@show_above_text True, if the link preview must be shown above message text; otherwise, the link preview must be shown below the message text +//@instant_view_version Version of instant view (currently, can be 1 or 2) for the web page; 0 if none +linkPreview url:string display_url:string site_name:string title:string description:formattedText author:string type:LinkPreviewType has_large_media:Bool show_large_media:Bool show_media_above_description:Bool skip_confirmation:Bool show_above_text:Bool instant_view_version:int32 = LinkPreview; //@description Contains information about a country @@ -1969,10 +2843,29 @@ countries countries:vector<countryInfo> = Countries; //@country Information about the country to which the phone number belongs; may be null //@country_calling_code The part of the phone number denoting country calling code or its part //@formatted_phone_number The phone number without country calling code formatted accordingly to local rules. Expected digits are returned as '-', but even more digits might be entered by the user -//@is_anonymous True, if the phone number was bought on Fragment and isn't tied to a SIM card +//@is_anonymous True, if the phone number was bought at https://fragment.com and isn't tied to a SIM card. Information about the phone number can be received using getCollectibleItemInfo phoneNumberInfo country:countryInfo country_calling_code:string formatted_phone_number:string is_anonymous:Bool = PhoneNumberInfo; +//@class CollectibleItemType @description Describes a collectible item that can be purchased at https://fragment.com + +//@description A username @username The username +collectibleItemTypeUsername username:string = CollectibleItemType; + +//@description A phone number @phone_number The phone number +collectibleItemTypePhoneNumber phone_number:string = CollectibleItemType; + + +//@description Contains information about a collectible item and its last purchase +//@purchase_date Point in time (Unix timestamp) when the item was purchased +//@currency Currency for the paid amount +//@amount The paid amount, in the smallest units of the currency +//@cryptocurrency Cryptocurrency used to pay for the item +//@cryptocurrency_amount The paid amount, in the smallest units of the cryptocurrency +//@url Individual URL for the item on https://fragment.com +collectibleItemInfo purchase_date:int32 currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 url:string = CollectibleItemInfo; + + //@description Describes an action associated with a bank card number @text Action text @url The URL to be opened bankCardActionOpenUrl text:string url:string = BankCardActionOpenUrl; @@ -1989,16 +2882,31 @@ bankCardInfo title:string actions:vector<bankCardActionOpenUrl> = BankCardInfo; //@postal_code Address postal code address country_code:string state:string city:string street_line1:string street_line2:string postal_code:string = Address; +//@description Describes an address of a location +//@country_code A two-letter ISO 3166-1 alpha-2 country code +//@state State, if applicable; empty if unknown +//@city City; empty if unknown +//@street The address; empty if unknown +locationAddress country_code:string state:string city:string street:string = LocationAddress; + //@description Contains parameters of the application theme //@background_color A color of the background in the RGB24 format //@secondary_background_color A secondary color for the background in the RGB24 format +//@header_background_color A color of the header background in the RGB24 format +//@bottom_bar_background_color A color of the bottom bar background in the RGB24 format +//@section_background_color A color of the section background in the RGB24 format +//@section_separator_color A color of the section separator in the RGB24 format //@text_color A color of text in the RGB24 format +//@accent_text_color An accent color of the text in the RGB24 format +//@section_header_text_color A color of text on the section headers in the RGB24 format +//@subtitle_text_color A color of the subtitle text in the RGB24 format +//@destructive_text_color A color of the text for destructive actions in the RGB24 format //@hint_color A color of hints in the RGB24 format //@link_color A color of links in the RGB24 format //@button_color A color of the buttons in the RGB24 format //@button_text_color A color of text on the buttons in the RGB24 format -themeParameters background_color:int32 secondary_background_color:int32 text_color:int32 hint_color:int32 link_color:int32 button_color:int32 button_text_color:int32 = ThemeParameters; +themeParameters background_color:int32 secondary_background_color:int32 header_background_color:int32 bottom_bar_background_color:int32 section_background_color:int32 section_separator_color:int32 text_color:int32 accent_text_color:int32 section_header_text_color:int32 subtitle_text_color:int32 destructive_text_color:int32 hint_color:int32 link_color:int32 button_color:int32 button_text_color:int32 = ThemeParameters; //@description Portion of the price of a product (e.g., "delivery cost", "tax amount") @label Label for this portion of the product price @amount Currency amount in the smallest units of the currency @@ -2010,6 +2918,7 @@ labeledPricePart label:string amount:int53 = LabeledPricePart; //@max_tip_amount The maximum allowed amount of tip in the smallest units of the currency //@suggested_tip_amounts Suggested amounts of tip in the smallest units of the currency //@recurring_payment_terms_of_service_url An HTTP URL with terms of service for recurring payments. If non-empty, the invoice payment will result in recurring payments and the user must accept the terms of service before allowed to pay +//@terms_of_service_url An HTTP URL with terms of service for non-recurring payments. If non-empty, then the user must accept the terms of service before allowed to pay //@is_test True, if the payment is a test payment //@need_name True, if the user's name is needed for payment //@need_phone_number True, if the user's phone number is needed for payment @@ -2018,7 +2927,7 @@ labeledPricePart label:string amount:int53 = LabeledPricePart; //@send_phone_number_to_provider True, if the user's phone number will be sent to the provider //@send_email_address_to_provider True, if the user's email address will be sent to the provider //@is_flexible True, if the total price depends on the shipping method -invoice currency:string price_parts:vector<labeledPricePart> max_tip_amount:int53 suggested_tip_amounts:vector<int53> recurring_payment_terms_of_service_url:string is_test:Bool need_name:Bool need_phone_number:Bool need_email_address:Bool need_shipping_address:Bool send_phone_number_to_provider:Bool send_email_address_to_provider:Bool is_flexible:Bool = Invoice; +invoice currency:string price_parts:vector<labeledPricePart> max_tip_amount:int53 suggested_tip_amounts:vector<int53> recurring_payment_terms_of_service_url:string terms_of_service_url:string is_test:Bool need_name:Bool need_phone_number:Bool need_email_address:Bool need_shipping_address:Bool send_phone_number_to_provider:Bool send_email_address_to_provider:Bool is_flexible:Bool = Invoice; //@description Order information //@name Name of the user @@ -2054,8 +2963,8 @@ inputCredentialsGooglePay data:string = InputCredentials; //@class PaymentProvider @description Contains information about a payment provider -//@description Smart Glocal payment provider @public_token Public payment token -paymentProviderSmartGlocal public_token:string = PaymentProvider; +//@description Smart Glocal payment provider @public_token Public payment token @tokenize_url URL for sending card tokenization requests +paymentProviderSmartGlocal public_token:string tokenize_url:string = PaymentProvider; //@description Stripe payment provider //@publishable_key Stripe API publishable key @@ -2072,10 +2981,10 @@ paymentProviderOther url:string = PaymentProvider; paymentOption title:string url:string = PaymentOption; -//@description Contains information about an invoice payment form -//@id The payment form identifier +//@class PaymentFormType @description Describes type of payment form + +//@description The payment form is for a regular payment //@invoice Full information about the invoice -//@seller_bot_user_id User identifier of the seller bot //@payment_provider_user_id User identifier of the payment provider bot //@payment_provider Information about the payment provider //@additional_payment_options The list of additional payment options @@ -2083,10 +2992,18 @@ paymentOption title:string url:string = PaymentOption; //@saved_credentials The list of saved payment credentials //@can_save_credentials True, if the user can choose to save credentials //@need_password True, if the user will be able to save credentials, if sets up a 2-step verification password -//@product_title Product title -//@product_description Product description -//@product_photo Product photo; may be null -paymentForm id:int64 invoice:invoice seller_bot_user_id:int53 payment_provider_user_id:int53 payment_provider:PaymentProvider additional_payment_options:vector<paymentOption> saved_order_info:orderInfo saved_credentials:vector<savedCredentials> can_save_credentials:Bool need_password:Bool product_title:string product_description:formattedText product_photo:photo = PaymentForm; +paymentFormTypeRegular invoice:invoice payment_provider_user_id:int53 payment_provider:PaymentProvider additional_payment_options:vector<paymentOption> saved_order_info:orderInfo saved_credentials:vector<savedCredentials> can_save_credentials:Bool need_password:Bool = PaymentFormType; + +//@description The payment form is for a payment in Telegram Stars @star_count Number of Telegram Stars that will be paid +paymentFormTypeStars star_count:int53 = PaymentFormType; + + +//@description Contains information about an invoice payment form +//@id The payment form identifier +//@type Type of the payment form +//@seller_bot_user_id User identifier of the seller bot +//@product_info Information about the product +paymentForm id:int64 type:PaymentFormType seller_bot_user_id:int53 product_info:productInfo = PaymentForm; //@description Contains a temporary identifier of validated order information, which is stored for one hour, and the available shipping options @order_info_id Temporary identifier of the order information @shipping_options Available shipping options validatedOrderInfo order_info_id:string shipping_options:vector<shippingOption> = ValidatedOrderInfo; @@ -2094,56 +3011,83 @@ validatedOrderInfo order_info_id:string shipping_options:vector<shippingOption> //@description Contains the result of a payment request @success True, if the payment request was successful; otherwise, the verification_url will be non-empty @verification_url URL for additional payment credentials verification paymentResult success:Bool verification_url:string = PaymentResult; -//@description Contains information about a successful payment -//@title Product title -//@param_description Product description -//@photo Product photo; may be null -//@date Point in time (Unix timestamp) when the payment was made -//@seller_bot_user_id User identifier of the seller bot + +//@class PaymentReceiptType @description Describes type of successful payment + +//@description The payment was done using a third-party payment provider //@payment_provider_user_id User identifier of the payment provider bot //@invoice Information about the invoice //@order_info Order information; may be null //@shipping_option Chosen shipping option; may be null //@credentials_title Title of the saved credentials chosen by the buyer //@tip_amount The amount of tip chosen by the buyer in the smallest units of the currency -paymentReceipt title:string description:formattedText photo:photo date:int32 seller_bot_user_id:int53 payment_provider_user_id:int53 invoice:invoice order_info:orderInfo shipping_option:shippingOption credentials_title:string tip_amount:int53 = PaymentReceipt; +paymentReceiptTypeRegular payment_provider_user_id:int53 invoice:invoice order_info:orderInfo shipping_option:shippingOption credentials_title:string tip_amount:int53 = PaymentReceiptType; + +//@description The payment was done using Telegram Stars +//@star_count Number of Telegram Stars that were paid +//@transaction_id Unique identifier of the transaction that can be used to dispute it +paymentReceiptTypeStars star_count:int53 transaction_id:string = PaymentReceiptType; + + +//@description Contains information about a successful payment +//@product_info Information about the product +//@date Point in time (Unix timestamp) when the payment was made +//@seller_bot_user_id User identifier of the seller bot +//@type Type of the payment receipt +paymentReceipt product_info:productInfo date:int32 seller_bot_user_id:int53 type:PaymentReceiptType = PaymentReceipt; //@class InputInvoice @description Describes an invoice to process -//@description An invoice from a message of the type messageInvoice @chat_id Chat identifier of the message @message_id Message identifier +//@description An invoice from a message of the type messageInvoice or paid media purchase from messagePaidMedia +//@chat_id Chat identifier of the message +//@message_id Message identifier inputInvoiceMessage chat_id:int53 message_id:int53 = InputInvoice; //@description An invoice from a link of the type internalLinkTypeInvoice @name Name of the invoice inputInvoiceName name:string = InputInvoice; +//@description An invoice for a payment toward Telegram; must not be used in the in-store apps @purpose Transaction purpose +inputInvoiceTelegram purpose:TelegramPaymentPurpose = InputInvoice; -//@class MessageExtendedMedia @description Describes a media, which is attached to an invoice + +//@class PaidMedia @description Describes a paid media //@description The media is hidden until the invoice is paid //@width Media width; 0 if unknown //@height Media height; 0 if unknown -//@duration Media duration; 0 if unknown +//@duration Media duration, in seconds; 0 if unknown //@minithumbnail Media minithumbnail; may be null -//@caption Media caption -messageExtendedMediaPreview width:int32 height:int32 duration:int32 minithumbnail:minithumbnail caption:formattedText = MessageExtendedMedia; +paidMediaPreview width:int32 height:int32 duration:int32 minithumbnail:minithumbnail = PaidMedia; -//@description The media is a photo @photo The photo @caption Photo caption -messageExtendedMediaPhoto photo:photo caption:formattedText = MessageExtendedMedia; +//@description The media is a photo @photo The photo +paidMediaPhoto photo:photo = PaidMedia; -//@description The media is a video @video The video @caption Photo caption -messageExtendedMediaVideo video:video caption:formattedText = MessageExtendedMedia; +//@description The media is a video @video The video +paidMediaVideo video:video = PaidMedia; -//@description The media is unsupported @caption Media caption -messageExtendedMediaUnsupported caption:formattedText = MessageExtendedMedia; +//@description The media is unsupported +paidMediaUnsupported = PaidMedia; +//@description Describes parameters of a giveaway +//@boosted_chat_id Identifier of the supergroup or channel chat, which will be automatically boosted by the winners of the giveaway for duration of the Telegram Premium subscription, +//-or for the specified time. If the chat is a channel, then can_post_messages right is required in the channel, otherwise, the user must be an administrator in the supergroup +//@additional_chat_ids Identifiers of other supergroup or channel chats that must be subscribed by the users to be eligible for the giveaway. There can be up to getOption("giveaway_additional_chat_count_max") additional chats +//@winners_selection_date Point in time (Unix timestamp) when the giveaway is expected to be performed; must be 60-getOption("giveaway_duration_max") seconds in the future in scheduled giveaways +//@only_new_members True, if only new members of the chats will be eligible for the giveaway +//@has_public_winners True, if the list of winners of the giveaway will be available to everyone +//@country_codes The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be eligible for the giveaway. If empty, then all users can participate in the giveaway. +//-There can be up to getOption("giveaway_country_count_max") chosen countries. Users with phone number that was bought at https://fragment.com can participate in any giveaway and the country code "FT" must not be specified in the list +//@prize_description Additional description of the giveaway prize; 0-128 characters +giveawayParameters boosted_chat_id:int53 additional_chat_ids:vector<int53> winners_selection_date:int32 only_new_members:Bool has_public_winners:Bool country_codes:vector<string> prize_description:string = GiveawayParameters; + //@description File with the date it was uploaded @file The file @date Point in time (Unix timestamp) when the file was uploaded datedFile file:file date:int32 = DatedFile; -//@class PassportElementType @description Contains the type of a Telegram Passport element +//@class PassportElementType @description Contains the type of Telegram Passport element //@description A Telegram Passport element containing the user's personal details passportElementTypePersonalDetails = PassportElementType; @@ -2203,21 +3147,21 @@ personalDetails first_name:string middle_name:string last_name:string native_fir //@description An identity document //@number Document number; 1-24 characters -//@expiry_date Document expiry date; may be null if not applicable +//@expiration_date Document expiration date; may be null if not applicable //@front_side Front side of the document //@reverse_side Reverse side of the document; only for driver license and identity card; may be null //@selfie Selfie with the document; may be null //@translation List of files containing a certified English translation of the document -identityDocument number:string expiry_date:date front_side:datedFile reverse_side:datedFile selfie:datedFile translation:vector<datedFile> = IdentityDocument; +identityDocument number:string expiration_date:date front_side:datedFile reverse_side:datedFile selfie:datedFile translation:vector<datedFile> = IdentityDocument; //@description An identity document to be saved to Telegram Passport //@number Document number; 1-24 characters -//@expiry_date Document expiry date; pass null if not applicable +//@expiration_date Document expiration date; pass null if not applicable //@front_side Front side of the document //@reverse_side Reverse side of the document; only for driver license and identity card; pass null otherwise //@selfie Selfie with the document; pass null if unavailable //@translation List of files containing a certified English translation of the document -inputIdentityDocument number:string expiry_date:date front_side:InputFile reverse_side:InputFile selfie:InputFile translation:vector<InputFile> = InputIdentityDocument; +inputIdentityDocument number:string expiration_date:date front_side:InputFile reverse_side:InputFile selfie:InputFile translation:vector<InputFile> = InputIdentityDocument; //@description A personal document, containing some information about a user @files List of files containing the pages of the document @translation List of files containing a certified English translation of the document personalDocument files:vector<datedFile> translation:vector<datedFile> = PersonalDocument; @@ -2421,15 +3365,19 @@ inputPassportElementError type:PassportElementType message:string source:InputPa //@class MessageContent @description Contains the content of a message -//@description A text message @text Text of the message @web_page A preview of the web page that's mentioned in the text; may be null -messageText text:formattedText web_page:webPage = MessageContent; +//@description A text message +//@text Text of the message +//@link_preview A link preview attached to the message; may be null +//@link_preview_options Options which were used for generation of the link preview; may be null if default options were used +messageText text:formattedText link_preview:linkPreview link_preview_options:linkPreviewOptions = MessageContent; //@description An animation message (GIF-style). //@animation The animation description //@caption Animation caption +//@show_caption_above_media True, if the caption must be shown above the animation; otherwise, the caption must be shown below the animation //@has_spoiler True, if the animation preview must be covered by a spoiler animation //@is_secret True, if the animation thumbnail must be blurred and the animation must be shown only while tapped -messageAnimation animation:animation caption:formattedText has_spoiler:Bool is_secret:Bool = MessageContent; +messageAnimation animation:animation caption:formattedText show_caption_above_media:Bool has_spoiler:Bool is_secret:Bool = MessageContent; //@description An audio message @audio The audio description @caption Audio caption messageAudio audio:audio caption:formattedText = MessageContent; @@ -2437,15 +3385,20 @@ messageAudio audio:audio caption:formattedText = MessageContent; //@description A document message (general file) @document The document description @caption Document caption messageDocument document:document caption:formattedText = MessageContent; +//@description A message with paid media +//@star_count Number of Telegram Stars needed to buy access to the media in the message +//@media Information about the media +//@caption Media caption +//@show_caption_above_media True, if the caption must be shown above the media; otherwise, the caption must be shown below the media +messagePaidMedia star_count:int53 media:vector<PaidMedia> caption:formattedText show_caption_above_media:Bool = MessageContent; + //@description A photo message //@photo The photo //@caption Photo caption +//@show_caption_above_media True, if the caption must be shown above the photo; otherwise, the caption must be shown below the photo //@has_spoiler True, if the photo preview must be covered by a spoiler animation //@is_secret True, if the photo must be blurred and must be shown only while tapped -messagePhoto photo:photo caption:formattedText has_spoiler:Bool is_secret:Bool = MessageContent; - -//@description A self-destructed photo message -messageExpiredPhoto = MessageContent; +messagePhoto photo:photo caption:formattedText show_caption_above_media:Bool has_spoiler:Bool is_secret:Bool = MessageContent; //@description A sticker message @sticker The sticker description @is_premium True, if premium animation of the sticker must be played messageSticker sticker:sticker is_premium:Bool = MessageContent; @@ -2453,12 +3406,10 @@ messageSticker sticker:sticker is_premium:Bool = MessageContent; //@description A video message //@video The video description //@caption Video caption +//@show_caption_above_media True, if the caption must be shown above the video; otherwise, the caption must be shown below the video //@has_spoiler True, if the video preview must be covered by a spoiler animation //@is_secret True, if the video thumbnail must be blurred and the video must be shown only while tapped -messageVideo video:video caption:formattedText has_spoiler:Bool is_secret:Bool = MessageContent; - -//@description A self-destructed video message -messageExpiredVideo = MessageContent; +messageVideo video:video caption:formattedText show_caption_above_media:Bool has_spoiler:Bool is_secret:Bool = MessageContent; //@description A video note message @video_note The video note description @is_viewed True, if at least one of the recipients has viewed the video note @is_secret True, if the video note thumbnail must be blurred and the video note must be shown only while tapped messageVideoNote video_note:videoNote is_viewed:Bool is_secret:Bool = MessageContent; @@ -2466,10 +3417,22 @@ messageVideoNote video_note:videoNote is_viewed:Bool is_secret:Bool = MessageCon //@description A voice note message @voice_note The voice note description @caption Voice note caption @is_listened True, if at least one of the recipients has listened to the voice note messageVoiceNote voice_note:voiceNote caption:formattedText is_listened:Bool = MessageContent; +//@description A self-destructed photo message +messageExpiredPhoto = MessageContent; + +//@description A self-destructed video message +messageExpiredVideo = MessageContent; + +//@description A self-destructed video note message +messageExpiredVideoNote = MessageContent; + +//@description A self-destructed voice note message +messageExpiredVoiceNote = MessageContent; + //@description A message with a location //@location The location description -//@live_period Time relative to the message send date, for which the location can be updated, in seconds -//@expires_in Left time for which the location can be updated, in seconds. updateMessageContent is not sent when this field changes +//@live_period Time relative to the message send date, for which the location can be updated, in seconds; if 0x7FFFFFFF, then location can be updated forever +//@expires_in Left time for which the location can be updated, in seconds. If 0, then the location can't be updated anymore. The update updateMessageContent is not sent when this field changes //@heading For live locations, a direction in which the location moves, in degrees; 1-360. If 0 the direction is unknown //@proximity_alert_radius For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). 0 if the notification is disabled. Available only to the message sender messageLocation location:location live_period:int32 expires_in:int32 heading:int32 proximity_alert_radius:int32 = MessageContent; @@ -2484,8 +3447,8 @@ messageContact contact:contact = MessageContent; messageAnimatedEmoji animated_emoji:animatedEmoji emoji:string = MessageContent; //@description A dice message. The dice value is randomly generated by the server -//@initial_state The animated stickers with the initial dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known -//@final_state The animated stickers with the final dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known +//@initial_state The animated stickers with the initial dice animation; may be null if unknown. The update updateMessageContent will be sent when the sticker became known +//@final_state The animated stickers with the final dice animation; may be null if unknown. The update updateMessageContent will be sent when the sticker became known //@emoji Emoji on which the dice throw animation is based //@value The dice value. If the value is 0, the dice don't have final state yet //@success_animation_frame_number Number of frame after which a success animation like a shower of confetti needs to be shown on updateMessageSendSucceeded @@ -2497,18 +3460,23 @@ messageGame game:game = MessageContent; //@description A message with a poll @poll The poll description messagePoll poll:poll = MessageContent; +//@description A message with a forwarded story +//@story_sender_chat_id Identifier of the chat that posted the story +//@story_id Story identifier +//@via_mention True, if the story was automatically forwarded because of a mention of the user +messageStory story_sender_chat_id:int53 story_id:int32 via_mention:Bool = MessageContent; + //@description A message with an invoice from a bot. Use getInternalLink with internalLinkTypeBotStart to share the invoice -//@title Product title -//@param_description Product description -//@photo Product photo; may be null +//@product_info Information about the product //@currency Currency for the product price //@total_amount Product total price in the smallest units of the currency //@start_parameter Unique invoice bot start_parameter to be passed to getInternalLink //@is_test True, if the invoice is a test invoice //@need_shipping_address True, if the shipping address must be specified //@receipt_message_id The identifier of the message with the receipt, after the product has been purchased -//@extended_media Extended media attached to the invoice; may be null -messageInvoice title:string description:formattedText photo:photo currency:string total_amount:int53 start_parameter:string is_test:Bool need_shipping_address:Bool receipt_message_id:int53 extended_media:MessageExtendedMedia = MessageContent; +//@paid_media Extended media attached to the invoice; may be null if none +//@paid_media_caption Extended media caption; may be null if none +messageInvoice product_info:productInfo currency:string total_amount:int53 start_parameter:string is_test:Bool need_shipping_address:Bool receipt_message_id:int53 paid_media:PaidMedia paid_media_caption:formattedText = MessageContent; //@description A message with information about an ended call @is_video True, if the call was a video call @discard_reason Reason why the call was discarded @duration Call duration, in seconds messageCall is_video:Bool discard_reason:CallDiscardReason duration:int32 = MessageContent; @@ -2522,7 +3490,7 @@ messageVideoChatStarted group_call_id:int32 = MessageContent; //@description A message with information about an ended video chat @duration Call duration, in seconds messageVideoChatEnded duration:int32 = MessageContent; -//@description A message with information about an invite to a video chat @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall @user_ids Invited user identifiers +//@description A message with information about an invitation to a video chat @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall @user_ids Invited user identifiers messageInviteVideoChatParticipants group_call_id:int32 user_ids:vector<int53> = MessageContent; //@description A newly created basic group @title Title of the basic group @member_user_ids User identifiers of members in the basic group @@ -2564,8 +3532,11 @@ messagePinMessage message_id:int53 = MessageContent; //@description A screenshot of a message in the chat has been taken messageScreenshotTaken = MessageContent; -//@description A new background was set in the chat @old_background_message_id Identifier of the message with a previously set same background; 0 if none. Can be an identifier of a deleted message @background The new background -messageChatSetBackground old_background_message_id:int53 background:chatBackground = MessageContent; +//@description A new background was set in the chat +//@old_background_message_id Identifier of the message with a previously set same background; 0 if none. Can be an identifier of a deleted message +//@background The new background +//@only_for_self True, if the background was set only for self +messageChatSetBackground old_background_message_id:int53 background:chatBackground only_for_self:Bool = MessageContent; //@description A theme in the chat has been changed @theme_name If non-empty, name of a new theme, set for the chat. Otherwise, chat theme was reset to the default one messageChatSetTheme theme_name:string = MessageContent; @@ -2573,6 +3544,9 @@ messageChatSetTheme theme_name:string = MessageContent; //@description The auto-delete or self-destruct timer for messages in the chat has been changed @message_auto_delete_time New value auto-delete or self-destruct time, in seconds; 0 if disabled @from_user_id If not 0, a user identifier, which default setting was automatically applied messageChatSetMessageAutoDeleteTime message_auto_delete_time:int32 from_user_id:int53 = MessageContent; +//@description The chat was boosted by the sender of the message @boost_count Number of times the chat was boosted +messageChatBoost boost_count:int32 = MessageContent; + //@description A forum topic has been created @name Name of the topic @icon Icon of the topic messageForumTopicCreated name:string icon:forumTopicIcon = MessageContent; @@ -2619,30 +3593,103 @@ messagePaymentSuccessful invoice_chat_id:int53 invoice_message_id:int53 currency //@provider_payment_charge_id Provider payment identifier messagePaymentSuccessfulBot currency:string total_amount:int53 is_recurring:Bool is_first_recurring:Bool invoice_payload:bytes shipping_option_id:string order_info:orderInfo telegram_payment_charge_id:string provider_payment_charge_id:string = MessageContent; -//@description Telegram Premium was gifted to the user -//@gifter_user_id The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous +//@description A payment has been refunded +//@owner_id Identifier of the previous owner of the Telegram Stars that refunds them +//@currency Currency for the price of the product +//@total_amount Total price for the product, in the smallest units of the currency +//@invoice_payload Invoice payload; only for bots +//@telegram_payment_charge_id Telegram payment identifier +//@provider_payment_charge_id Provider payment identifier +messagePaymentRefunded owner_id:MessageSender currency:string total_amount:int53 invoice_payload:bytes telegram_payment_charge_id:string provider_payment_charge_id:string = MessageContent; + +//@description Telegram Premium was gifted to a user +//@gifter_user_id The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous or is outgoing +//@receiver_user_id The identifier of a user that received Telegram Premium; 0 if the gift is incoming //@currency Currency for the paid amount //@amount The paid amount, in the smallest units of the currency //@cryptocurrency Cryptocurrency used to pay for the gift; may be empty if none -//@cryptocurrency_amount The paid amount, in the smallest units of the cryptocurrency -//@month_count Number of month the Telegram Premium subscription will be active +//@cryptocurrency_amount The paid amount, in the smallest units of the cryptocurrency; 0 if none +//@month_count Number of months the Telegram Premium subscription will be active +//@sticker A sticker to be shown in the message; may be null if unknown +messageGiftedPremium gifter_user_id:int53 receiver_user_id:int53 currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 month_count:int32 sticker:sticker = MessageContent; + +//@description A Telegram Premium gift code was created for the user +//@creator_id Identifier of a chat or a user that created the gift code; may be null if unknown +//@is_from_giveaway True, if the gift code was created for a giveaway +//@is_unclaimed True, if the winner for the corresponding Telegram Premium subscription wasn't chosen +//@currency Currency for the paid amount; empty if unknown +//@amount The paid amount, in the smallest units of the currency; 0 if unknown +//@cryptocurrency Cryptocurrency used to pay for the gift; may be empty if none or unknown +//@cryptocurrency_amount The paid amount, in the smallest units of the cryptocurrency; 0 if unknown +//@month_count Number of months the Telegram Premium subscription will be active after code activation //@sticker A sticker to be shown in the message; may be null if unknown -messageGiftedPremium gifter_user_id:int53 currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 month_count:int32 sticker:sticker = MessageContent; +//@code The gift code +messagePremiumGiftCode creator_id:MessageSender is_from_giveaway:Bool is_unclaimed:Bool currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 month_count:int32 sticker:sticker code:string = MessageContent; + +//@description A giveaway was created for the chat. Use telegramPaymentPurposePremiumGiveaway, storePaymentPurposePremiumGiveaway, telegramPaymentPurposeStarGiveaway, or storePaymentPurposeStarGiveaway to create a giveaway +//@star_count Number of Telegram Stars that will be shared by winners of the giveaway; 0 for Telegram Premium giveaways +messageGiveawayCreated star_count:int53 = MessageContent; + +//@description A giveaway +//@parameters Giveaway parameters +//@winner_count Number of users which will receive Telegram Premium subscription gift codes +//@prize Prize of the giveaway +//@sticker A sticker to be shown in the message; may be null if unknown +messageGiveaway parameters:giveawayParameters winner_count:int32 prize:GiveawayPrize sticker:sticker = MessageContent; + +//@description A giveaway without public winners has been completed for the chat +//@giveaway_message_id Identifier of the message with the giveaway; can be 0 if the message was deleted +//@winner_count Number of winners in the giveaway +//@is_star_giveaway True, if the giveaway is a Telegram Star giveaway +//@unclaimed_prize_count Number of undistributed prizes; for Telegram Premium giveaways only +messageGiveawayCompleted giveaway_message_id:int53 winner_count:int32 is_star_giveaway:Bool unclaimed_prize_count:int32 = MessageContent; + +//@description A giveaway with public winners has been completed for the chat +//@boosted_chat_id Identifier of the supergroup or channel chat, which was automatically boosted by the winners of the giveaway +//@giveaway_message_id Identifier of the message with the giveaway in the boosted chat +//@additional_chat_count Number of other chats that participated in the giveaway +//@actual_winners_selection_date Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway +//@only_new_members True, if only new members of the chats were eligible for the giveaway +//@was_refunded True, if the giveaway was canceled and was fully refunded +//@prize Prize of the giveaway +//@prize_description Additional description of the giveaway prize +//@winner_count Total number of winners in the giveaway +//@winner_user_ids Up to 100 user identifiers of the winners of the giveaway +//@unclaimed_prize_count Number of undistributed prizes; for Telegram Premium giveaways only +messageGiveawayWinners boosted_chat_id:int53 giveaway_message_id:int53 additional_chat_count:int32 actual_winners_selection_date:int32 only_new_members:Bool was_refunded:Bool prize:GiveawayPrize prize_description:string winner_count:int32 winner_user_ids:vector<int53> unclaimed_prize_count:int32 = MessageContent; + +//@description Telegram Stars were gifted to a user +//@gifter_user_id The identifier of a user that gifted Telegram Stars; 0 if the gift was anonymous or is outgoing +//@receiver_user_id The identifier of a user that received Telegram Stars; 0 if the gift is incoming +//@currency Currency for the paid amount +//@amount The paid amount, in the smallest units of the currency +//@cryptocurrency Cryptocurrency used to pay for the gift; may be empty if none +//@cryptocurrency_amount The paid amount, in the smallest units of the cryptocurrency; 0 if none +//@star_count Number of Telegram Stars that were gifted +//@transaction_id Identifier of the transaction for Telegram Stars purchase; for receiver only +//@sticker A sticker to be shown in the message; may be null if unknown +messageGiftedStars gifter_user_id:int53 receiver_user_id:int53 currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 star_count:int53 transaction_id:string sticker:sticker = MessageContent; + +//@description A Telegram Stars were received by the cuurent user from a giveaway +//@star_count Number of Telegram Stars that were received +//@transaction_id Identifier of the transaction for Telegram Stars credit +//@boosted_chat_id Identifier of the supergroup or channel chat, which was automatically boosted by the winners of the giveaway +//@giveaway_message_id Identifier of the message with the giveaway in the boosted chat; can be 0 if the message was deleted +//@is_unclaimed True, if the corresponding winner wasn't chosen and the Telegram Stars were received by the owner of the boosted chat +//@sticker A sticker to be shown in the message; may be null if unknown +messageGiveawayPrizeStars star_count:int53 transaction_id:string boosted_chat_id:int53 giveaway_message_id:int53 is_unclaimed:Bool sticker:sticker = MessageContent; //@description A contact has registered with Telegram messageContactRegistered = MessageContent; -//@description The current user shared a user, which was requested by the bot @user_id Identifier of the shared user @button_id Identifier of the keyboard button with the request -messageUserShared user_id:int53 button_id:int32 = MessageContent; +//@description The current user shared users, which were requested by the bot @users The shared users @button_id Identifier of the keyboard button with the request +messageUsersShared users:vector<sharedUser> button_id:int32 = MessageContent; -//@description The current user shared a chat, which was requested by the bot @chat_id Identifier of the shared chat @button_id Identifier of the keyboard button with the request -messageChatShared chat_id:int53 button_id:int32 = MessageContent; +//@description The current user shared a chat, which was requested by the bot @chat The shared chat @button_id Identifier of the keyboard button with the request +messageChatShared chat:sharedChat button_id:int32 = MessageContent; -//@description The current user has connected a website by logging in using Telegram Login Widget on it @domain_name Domain name of the connected website -messageWebsiteConnected domain_name:string = MessageContent; - -//@description The user allowed the bot to send messages @web_app Information about the Web App, which requested the access; may be null if none or the Web App was opened from the attachment menu -messageBotWriteAccessAllowed web_app:webApp = MessageContent; +//@description The user allowed the bot to send messages @reason The reason why the bot was allowed to write messages +messageBotWriteAccessAllowed reason:BotWriteAccessAllowReason = MessageContent; //@description Data from a Web App has been sent to a bot @button_text Text of the keyboardButtonTypeWebApp button, which opened the Web App messageWebAppDataSent button_text:string = MessageContent; @@ -2659,7 +3706,7 @@ messagePassportDataReceived elements:vector<encryptedPassportElement> credential //@description A user in the chat came within proximity alert range @traveler_id The identifier of a user or chat that triggered the proximity alert @watcher_id The identifier of a user or chat that subscribed for the proximity alert @distance The distance between the users messageProximityAlertTriggered traveler_id:MessageSender watcher_id:MessageSender distance:int32 = MessageContent; -//@description Message content that is not supported in the current TDLib version +//@description A message content that is not supported in the current TDLib version messageUnsupported = MessageContent; @@ -2713,6 +3760,12 @@ textEntityTypePre = TextEntityType; //@description Text that must be formatted as if inside pre, and code HTML tags @language Programming language of the code; as defined by the sender textEntityTypePreCode language:string = TextEntityType; +//@description Text that must be formatted as if inside a blockquote HTML tag; not supported in secret chats +textEntityTypeBlockQuote = TextEntityType; + +//@description Text that must be formatted as if inside a blockquote HTML tag and collapsed by default to 3 lines with the ability to show full text; not supported in secret chats +textEntityTypeExpandableBlockQuote = TextEntityType; + //@description A text description shown instead of a raw URL @url HTTP or tg:// URL to be opened when the link is clicked textEntityTypeTextUrl url:string = TextEntityType; @@ -2722,7 +3775,7 @@ textEntityTypeMentionName user_id:int53 = TextEntityType; //@description A custom emoji. The text behind a custom emoji must be an emoji. Only premium users can use premium custom emoji @custom_emoji_id Unique identifier of the custom emoji textEntityTypeCustomEmoji custom_emoji_id:int64 = TextEntityType; -//@description A media timestamp @media_timestamp Timestamp from which a video/audio/video note/voice note playing must start, in seconds. The media can be in the content or the web page preview of the current message, or in the same places in the replied message +//@description A media timestamp @media_timestamp Timestamp from which a video/audio/video note/voice note/story playing must start, in seconds. The media can be in the content or the link preview of the current message, or in the same places in the replied message textEntityTypeMediaTimestamp media_timestamp:int32 = TextEntityType; @@ -2733,38 +3786,72 @@ textEntityTypeMediaTimestamp media_timestamp:int32 = TextEntityType; inputThumbnail thumbnail:InputFile width:int32 height:int32 = InputThumbnail; +//@class InputPaidMediaType @description Describes type of paid media to sent + +//@description The media is a photo. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20 +inputPaidMediaTypePhoto = InputPaidMediaType; + +//@description The media is a video +//@duration Duration of the video, in seconds +//@supports_streaming True, if the video is supposed to be streamed +inputPaidMediaTypeVideo duration:int32 supports_streaming:Bool = InputPaidMediaType; + + +//@description Describes a paid media to be sent +//@type Type of the media +//@media Photo or video to be sent +//@thumbnail Media thumbnail; pass null to skip thumbnail uploading +//@added_sticker_file_ids File identifiers of the stickers added to the media, if applicable +//@width Media width +//@height Media height +inputPaidMedia type:InputPaidMediaType media:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector<int32> width:int32 height:int32 = InputPaidMedia; + + //@class MessageSchedulingState @description Contains information about the time when a scheduled message will be sent -//@description The message will be sent at the specified date @send_date Date the message will be sent. The date must be within 367 days in the future +//@description The message will be sent at the specified date @send_date Point in time (Unix timestamp) when the message will be sent. The date must be within 367 days in the future messageSchedulingStateSendAtDate send_date:int32 = MessageSchedulingState; -//@description The message will be sent when the peer will be online. Applicable to private chats only and when the exact online status of the peer is known +//@description The message will be sent when the other user is online. Applicable to private chats only and when the exact online status of the other user is known messageSchedulingStateSendWhenOnline = MessageSchedulingState; +//@class MessageSelfDestructType @description Describes when a message will be self-destructed + +//@description The message will be self-destructed in the specified time after its content was opened @self_destruct_time The message's self-destruct time, in seconds; must be between 0 and 60 in private chats +messageSelfDestructTypeTimer self_destruct_time:int32 = MessageSelfDestructType; + +//@description The message can be opened only once and will be self-destructed once closed +messageSelfDestructTypeImmediately = MessageSelfDestructType; + + //@description Options to be used when a message is sent //@disable_notification Pass true to disable notification for the message //@from_background Pass true if the message is sent from the background //@protect_content Pass true if the content of the message must be protected from forwarding and saving; for bots only //@update_order_of_installed_sticker_sets Pass true if the user explicitly chosen a sticker or a custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum //@scheduling_state Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled +//@effect_id Identifier of the effect to apply to the message; pass 0 if none; applicable only to sendMessage and sendMessageAlbum in private chats //@sending_id Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates -messageSendOptions disable_notification:Bool from_background:Bool protect_content:Bool update_order_of_installed_sticker_sets:Bool scheduling_state:MessageSchedulingState sending_id:int32 = MessageSendOptions; +//@only_preview Pass true to get a fake message instead of actually sending them +messageSendOptions disable_notification:Bool from_background:Bool protect_content:Bool update_order_of_installed_sticker_sets:Bool scheduling_state:MessageSchedulingState effect_id:int64 sending_id:int32 only_preview:Bool = MessageSendOptions; -//@description Options to be used when a message content is copied without reference to the original sender. Service messages and messageInvoice can't be copied +//@description Options to be used when a message content is copied without reference to the original sender. Service messages, messages with messageInvoice, messagePaidMedia, messageGiveaway, or messageGiveawayWinners content can't be copied //@send_copy True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local //@replace_caption True, if media caption of the message copy needs to be replaced. Ignored if send_copy is false //@new_caption New message caption; pass null to copy message without caption. Ignored if replace_caption is false -messageCopyOptions send_copy:Bool replace_caption:Bool new_caption:formattedText = MessageCopyOptions; +//@new_show_caption_above_media True, if new caption must be shown above the animation; otherwise, new caption must be shown below the animation; not supported in secret chats. Ignored if replace_caption is false +messageCopyOptions send_copy:Bool replace_caption:Bool new_caption:formattedText new_show_caption_above_media:Bool = MessageCopyOptions; //@class InputMessageContent @description The content of a message to send //@description A text message -//@text Formatted text to be sent; 1-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually -//@disable_web_page_preview True, if rich web page previews for URLs in the message text must be disabled +//@text Formatted text to be sent; 0-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, ExpandableBlockQuote, +//-Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually +//@link_preview_options Options to be used for generation of a link preview; may be null if none; pass null to use default link preview options //@clear_draft True, if a chat message draft must be deleted -inputMessageText text:formattedText disable_web_page_preview:Bool clear_draft:Bool = InputMessageContent; +inputMessageText text:formattedText link_preview_options:linkPreviewOptions clear_draft:Bool = InputMessageContent; //@description An animation message (GIF-style). //@animation Animation file to be sent @@ -2774,8 +3861,9 @@ inputMessageText text:formattedText disable_web_page_preview:Bool clear_draft:Bo //@width Width of the animation; may be replaced by the server //@height Height of the animation; may be replaced by the server //@caption Animation caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters +//@show_caption_above_media True, if the caption must be shown above the animation; otherwise, the caption must be shown below the animation; not supported in secret chats //@has_spoiler True, if the animation preview must be covered by a spoiler animation; not supported in secret chats -inputMessageAnimation animation:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector<int32> duration:int32 width:int32 height:int32 caption:formattedText has_spoiler:Bool = InputMessageContent; +inputMessageAnimation animation:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector<int32> duration:int32 width:int32 height:int32 caption:formattedText show_caption_above_media:Bool has_spoiler:Bool = InputMessageContent; //@description An audio message //@audio Audio file to be sent @@ -2789,10 +3877,18 @@ inputMessageAudio audio:InputFile album_cover_thumbnail:inputThumbnail duration: //@description A document message (general file) //@document Document to be sent //@thumbnail Document thumbnail; pass null to skip thumbnail uploading -//@disable_content_type_detection If true, automatic file type detection will be disabled and the document will always be sent as file. Always true for files sent to secret chats +//@disable_content_type_detection Pass true to disable automatic file type detection and send the document as a file. Always true for files sent to secret chats //@caption Document caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters inputMessageDocument document:InputFile thumbnail:inputThumbnail disable_content_type_detection:Bool caption:formattedText = InputMessageContent; +//@description A message with paid media; can be used only in channel chats with supergroupFullInfo.has_paid_media_allowed +//@star_count The number of Telegram Stars that must be paid to see the media; 1-getOption("paid_media_message_star_count_max") +//@paid_media The content of the paid media +//@caption Message caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters +//@show_caption_above_media True, if the caption must be shown above the video; otherwise, the caption must be shown below the video; not supported in secret chats +//@payload Bot-provided data for the paid media; bots only +inputMessagePaidMedia star_count:int53 paid_media:vector<inputPaidMedia> caption:formattedText show_caption_above_media:Bool payload:string = InputMessageContent; + //@description A photo message //@photo Photo to send. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20 //@thumbnail Photo thumbnail to be sent; pass null to skip thumbnail uploading. The thumbnail is sent to the other party only in secret chats @@ -2800,9 +3896,10 @@ inputMessageDocument document:InputFile thumbnail:inputThumbnail disable_content //@width Photo width //@height Photo height //@caption Photo caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters -//@self_destruct_time Photo self-destruct time, in seconds (0-60). A non-zero self-destruct time can be specified only in private chats +//@show_caption_above_media True, if the caption must be shown above the photo; otherwise, the caption must be shown below the photo; not supported in secret chats +//@self_destruct_type Photo self-destruct type; pass null if none; private chats only //@has_spoiler True, if the photo preview must be covered by a spoiler animation; not supported in secret chats -inputMessagePhoto photo:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector<int32> width:int32 height:int32 caption:formattedText self_destruct_time:int32 has_spoiler:Bool = InputMessageContent; +inputMessagePhoto photo:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector<int32> width:int32 height:int32 caption:formattedText show_caption_above_media:Bool self_destruct_type:MessageSelfDestructType has_spoiler:Bool = InputMessageContent; //@description A sticker message //@sticker Sticker to be sent @@ -2821,27 +3918,30 @@ inputMessageSticker sticker:InputFile thumbnail:inputThumbnail width:int32 heigh //@height Video height //@supports_streaming True, if the video is supposed to be streamed //@caption Video caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters -//@self_destruct_time Video self-destruct time, in seconds (0-60). A non-zero self-destruct time can be specified only in private chats +//@show_caption_above_media True, if the caption must be shown above the video; otherwise, the caption must be shown below the video; not supported in secret chats +//@self_destruct_type Video self-destruct type; pass null if none; private chats only //@has_spoiler True, if the video preview must be covered by a spoiler animation; not supported in secret chats -inputMessageVideo video:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector<int32> duration:int32 width:int32 height:int32 supports_streaming:Bool caption:formattedText self_destruct_time:int32 has_spoiler:Bool = InputMessageContent; +inputMessageVideo video:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector<int32> duration:int32 width:int32 height:int32 supports_streaming:Bool caption:formattedText show_caption_above_media:Bool self_destruct_type:MessageSelfDestructType has_spoiler:Bool = InputMessageContent; //@description A video note message //@video_note Video note to be sent -//@thumbnail Video thumbnail; pass null to skip thumbnail uploading -//@duration Duration of the video, in seconds +//@thumbnail Video thumbnail; may be null if empty; pass null to skip thumbnail uploading +//@duration Duration of the video, in seconds; 0-60 //@length Video width and height; must be positive and not greater than 640 -inputMessageVideoNote video_note:InputFile thumbnail:inputThumbnail duration:int32 length:int32 = InputMessageContent; +//@self_destruct_type Video note self-destruct type; may be null if none; pass null if none; private chats only +inputMessageVideoNote video_note:InputFile thumbnail:inputThumbnail duration:int32 length:int32 self_destruct_type:MessageSelfDestructType = InputMessageContent; //@description A voice note message -//@voice_note Voice note to be sent +//@voice_note Voice note to be sent. The voice note must be encoded with the Opus codec and stored inside an OGG container with a single audio channel, or be in MP3 or M4A format as regular audio //@duration Duration of the voice note, in seconds //@waveform Waveform representation of the voice note in 5-bit format -//@caption Voice note caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters -inputMessageVoiceNote voice_note:InputFile duration:int32 waveform:bytes caption:formattedText = InputMessageContent; +//@caption Voice note caption; may be null if empty; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters +//@self_destruct_type Voice note self-destruct type; may be null if none; pass null if none; private chats only +inputMessageVoiceNote voice_note:InputFile duration:int32 waveform:bytes caption:formattedText self_destruct_type:MessageSelfDestructType = InputMessageContent; //@description A message with a location //@location Location to be sent -//@live_period Period for which the location can be updated, in seconds; must be between 60 and 86400 for a live location and 0 otherwise +//@live_period Period for which the location can be updated, in seconds; must be between 60 and 86400 for a temporary live location, 0x7FFFFFFF for permanent live location, and 0 otherwise //@heading For live locations, a direction in which the location moves, in degrees; 1-360. Pass 0 if unknown //@proximity_alert_radius For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled. Can't be enabled in channels and Saved Messages inputMessageLocation location:location live_period:int32 heading:int32 proximity_alert_radius:int32 = InputMessageContent; @@ -2867,30 +3967,66 @@ inputMessageGame bot_user_id:int53 game_short_name:string = InputMessageContent; //@photo_width Product photo width //@photo_height Product photo height //@payload The invoice payload -//@provider_token Payment provider token +//@provider_token Payment provider token; may be empty for payments in Telegram Stars //@provider_data JSON-encoded data about the invoice, which will be shared with the payment provider //@start_parameter Unique invoice bot deep link parameter for the generation of this invoice. If empty, it would be possible to pay directly from forwards of the invoice message -//@extended_media_content The content of extended media attached to the invoice. The content of the message to be sent. Must be one of the following types: inputMessagePhoto, inputMessageVideo -inputMessageInvoice invoice:invoice title:string description:string photo_url:string photo_size:int32 photo_width:int32 photo_height:int32 payload:bytes provider_token:string provider_data:string start_parameter:string extended_media_content:InputMessageContent = InputMessageContent; +//@paid_media The content of paid media attached to the invoice; pass null if none +//@paid_media_caption Paid media caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters +inputMessageInvoice invoice:invoice title:string description:string photo_url:string photo_size:int32 photo_width:int32 photo_height:int32 payload:bytes provider_token:string provider_data:string start_parameter:string paid_media:inputPaidMedia paid_media_caption:formattedText = InputMessageContent; //@description A message with a poll. Polls can't be sent to secret chats. Polls can be sent only to a private chat with a bot -//@question Poll question; 1-255 characters (up to 300 characters for bots) -//@options List of poll answer options, 2-10 strings 1-100 characters each +//@question Poll question; 1-255 characters (up to 300 characters for bots). Only custom emoji entities are allowed to be added and only by Premium users +//@options List of poll answer options, 2-10 strings 1-100 characters each. Only custom emoji entities are allowed to be added and only by Premium users //@is_anonymous True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels //@type Type of the poll //@open_period Amount of time the poll will be active after creation, in seconds; for bots only //@close_date Point in time (Unix timestamp) when the poll will automatically be closed; for bots only //@is_closed True, if the poll needs to be sent already closed; for bots only -inputMessagePoll question:string options:vector<string> is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = InputMessageContent; +inputMessagePoll question:formattedText options:vector<formattedText> is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = InputMessageContent; + +//@description A message with a forwarded story. Stories can't be sent to secret chats. A story can be forwarded only if story.can_be_forwarded +//@story_sender_chat_id Identifier of the chat that posted the story +//@story_id Story identifier +inputMessageStory story_sender_chat_id:int53 story_id:int32 = InputMessageContent; //@description A forwarded message //@from_chat_id Identifier for the chat this forwarded message came from -//@message_id Identifier of the message to forward +//@message_id Identifier of the message to forward. A message can be forwarded only if messageProperties.can_be_forwarded //@in_game_share True, if a game message is being shared from a launched game; applies only to game messages //@copy_options Options to be used to copy content of the message without reference to the original sender; pass null to forward the message as usual inputMessageForwarded from_chat_id:int53 message_id:int53 in_game_share:Bool copy_options:messageCopyOptions = InputMessageContent; +//@description Contains properties of a message and describes actions that can be done with the message right now +//@can_be_copied_to_secret_chat True, if content of the message can be copied to a secret chat using inputMessageForwarded or forwardMessages with copy options +//@can_be_deleted_only_for_self True, if the message can be deleted only for the current user while other users will continue to see it using the method deleteMessages with revoke == false +//@can_be_deleted_for_all_users True, if the message can be deleted for all users using the method deleteMessages with revoke == true +//@can_be_edited True, if the message can be edited using the methods editMessageText, editMessageMedia, editMessageCaption, or editMessageReplyMarkup. +//-For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message +//@can_be_forwarded True, if the message can be forwarded using inputMessageForwarded or forwardMessages +//@can_be_paid True, if the message can be paid using inputInvoiceMessage +//@can_be_pinned True, if the message can be pinned or unpinned in the chat using pinChatMessage or unpinChatMessage +//@can_be_replied True, if the message can be replied in the same chat and forum topic using inputMessageReplyToMessage +//@can_be_replied_in_another_chat True, if the message can be replied in another chat or forum topic using inputMessageReplyToExternalMessage +//@can_be_saved True, if content of the message can be saved locally or copied using inputMessageForwarded or forwardMessages with copy options +//@can_be_shared_in_story True, if the message can be shared in a story using inputStoryAreaTypeMessage +//@can_edit_scheduling_state True, if scheduling state of the message can be edited +//@can_get_embedding_code True, if code for message embedding can be received using getMessageEmbeddingCode +//@can_get_link True, if a link can be generated for the message using getMessageLink +//@can_get_media_timestamp_links True, if media timestamp links can be generated for media timestamp entities in the message text, caption or link preview description using getMessageLink +//@can_get_message_thread True, if information about the message thread is available through getMessageThread and getMessageThreadHistory +//@can_get_read_date True, if read date of the message can be received through getMessageReadDate +//@can_get_statistics True, if message statistics are available through getMessageStatistics and message forwards can be received using getMessagePublicForwards +//@can_get_viewers True, if chat members already viewed the message can be received through getMessageViewers +//@can_recognize_speech True, if speech can be recognized for the message through recognizeSpeech +//@can_report_chat True, if the message can be reported using reportChat +//@can_report_reactions True, if reactions on the message can be reported through reportMessageReactions +//@can_report_supergroup_spam True, if the message can be reported using reportSupergroupSpam +//@can_set_fact_check True, if fact check for the message can be changed through setMessageFactCheck +//@need_show_statistics True, if message statistics must be available from context menu of the message +messageProperties can_be_copied_to_secret_chat:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_paid:Bool can_be_pinned:Bool can_be_replied:Bool can_be_replied_in_another_chat:Bool can_be_saved:Bool can_be_shared_in_story:Bool can_edit_scheduling_state:Bool can_get_embedding_code:Bool can_get_link:Bool can_get_media_timestamp_links:Bool can_get_message_thread:Bool can_get_read_date:Bool can_get_statistics:Bool can_get_viewers:Bool can_recognize_speech:Bool can_report_chat:Bool can_report_reactions:Bool can_report_supergroup_spam:Bool can_set_fact_check:Bool need_show_statistics:Bool = MessageProperties; + + //@class SearchMessagesFilter @description Represents a filter for message search results //@description Returns all found messages, no filter is applied @@ -2995,7 +4131,7 @@ chatActionCancel = ChatAction; //@class UserStatus @description Describes the last time the user was online -//@description The user status was never changed +//@description The user's status has never been changed userStatusEmpty = UserStatus; //@description The user is online @expires Point in time (Unix timestamp) when the user's online status will expire @@ -3004,20 +4140,26 @@ userStatusOnline expires:int32 = UserStatus; //@description The user is offline @was_online Point in time (Unix timestamp) when the user was last online userStatusOffline was_online:int32 = UserStatus; -//@description The user was online recently -userStatusRecently = UserStatus; +//@description The user was online recently @by_my_privacy_settings Exact user's status is hidden because the current user enabled userPrivacySettingShowStatus privacy setting for the user and has no Telegram Premium +userStatusRecently by_my_privacy_settings:Bool = UserStatus; + +//@description The user is offline, but was online last week @by_my_privacy_settings Exact user's status is hidden because the current user enabled userPrivacySettingShowStatus privacy setting for the user and has no Telegram Premium +userStatusLastWeek by_my_privacy_settings:Bool = UserStatus; + +//@description The user is offline, but was online last month @by_my_privacy_settings Exact user's status is hidden because the current user enabled userPrivacySettingShowStatus privacy setting for the user and has no Telegram Premium +userStatusLastMonth by_my_privacy_settings:Bool = UserStatus; -//@description The user is offline, but was online last week -userStatusLastWeek = UserStatus; -//@description The user is offline, but was online last month -userStatusLastMonth = UserStatus; +//@description Represents an emoji with its keyword @emoji The emoji @keyword The keyword +emojiKeyword emoji:string keyword:string = EmojiKeyword; +//@description Represents a list of emojis with their keywords @emoji_keywords List of emojis with their keywords +emojiKeywords emoji_keywords:vector<emojiKeyword> = EmojiKeywords; //@description Represents a list of stickers @stickers List of stickers stickers stickers:vector<sticker> = Stickers; -//@description Represents a list of emoji @emojis List of emojis +//@description Represents a list of emojis @emojis List of emojis emojis emojis:vector<string> = Emojis; //@description Represents a sticker set @@ -3026,31 +4168,35 @@ emojis emojis:vector<string> = Emojis; //@name Name of the sticker set //@thumbnail Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed //@thumbnail_outline Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner +//@is_owned True, if the sticker set is owned by the current user //@is_installed True, if the sticker set has been installed by the current user //@is_archived True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously //@is_official True, if the sticker set is official -//@sticker_format Format of the stickers in the set //@sticker_type Type of the stickers in the set +//@needs_repainting True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only +//@is_allowed_as_chat_emoji_status True, if stickers in the sticker set are custom emoji that can be used as chat emoji status; for custom emoji sticker sets only //@is_viewed True for already viewed trending sticker sets //@stickers List of stickers in this set -//@emojis A list of emoji corresponding to the stickers in the same order. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object -stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector<closedVectorPath> is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat sticker_type:StickerType is_viewed:Bool stickers:vector<sticker> emojis:vector<emojis> = StickerSet; +//@emojis A list of emojis corresponding to the stickers in the same order. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object +stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector<closedVectorPath> is_owned:Bool is_installed:Bool is_archived:Bool is_official:Bool sticker_type:StickerType needs_repainting:Bool is_allowed_as_chat_emoji_status:Bool is_viewed:Bool stickers:vector<sticker> emojis:vector<emojis> = StickerSet; //@description Represents short information about a sticker set //@id Identifier of the sticker set //@title Title of the sticker set //@name Name of the sticker set -//@thumbnail Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null +//@thumbnail Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed //@thumbnail_outline Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner +//@is_owned True, if the sticker set is owned by the current user //@is_installed True, if the sticker set has been installed by the current user //@is_archived True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously //@is_official True, if the sticker set is official -//@sticker_format Format of the stickers in the set //@sticker_type Type of the stickers in the set +//@needs_repainting True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only +//@is_allowed_as_chat_emoji_status True, if stickers in the sticker set are custom emoji that can be used as chat emoji status; for custom emoji sticker sets only //@is_viewed True for already viewed trending sticker sets //@size Total number of stickers in the set //@covers Up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full sticker set needs to be requested -stickerSetInfo id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector<closedVectorPath> is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat sticker_type:StickerType is_viewed:Bool size:int32 covers:vector<sticker> = StickerSetInfo; +stickerSetInfo id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector<closedVectorPath> is_owned:Bool is_installed:Bool is_archived:Bool is_official:Bool sticker_type:StickerType needs_repainting:Bool is_allowed_as_chat_emoji_status:Bool is_viewed:Bool size:int32 covers:vector<sticker> = StickerSetInfo; //@description Represents a list of sticker sets @total_count Approximate total number of sticker sets found @sets List of sticker sets stickerSets total_count:int32 sets:vector<stickerSetInfo> = StickerSets; @@ -3059,21 +4205,36 @@ stickerSets total_count:int32 sets:vector<stickerSetInfo> = StickerSets; trendingStickerSets total_count:int32 sets:vector<stickerSetInfo> is_premium:Bool = TrendingStickerSets; -//@description Contains a list of similar emoji to search for in getStickers and searchStickers +//@class EmojiCategorySource @description Describes source of stickers for an emoji category + +//@description The category contains a list of similar emoji to search for in getStickers and searchStickers for stickers, +//-or getInlineQueryResults with the bot getOption("animation_search_bot_username") for animations +//@emojis List of emojis to search for +emojiCategorySourceSearch emojis:vector<string> = EmojiCategorySource; + +//@description The category contains premium stickers that must be found by getPremiumStickers +emojiCategorySourcePremium = EmojiCategorySource; + + +//@description Describes an emoji category //@name Name of the category //@icon Custom emoji sticker, which represents icon of the category -//@emojis List of emojis in the category -emojiCategory name:string icon:sticker emojis:vector<string> = EmojiCategory; +//@source Source of stickers for the emoji category +//@is_greeting True, if the category must be shown first when choosing a sticker for the start page +emojiCategory name:string icon:sticker source:EmojiCategorySource is_greeting:Bool = EmojiCategory; //@description Represents a list of emoji categories @categories List of categories emojiCategories categories:vector<emojiCategory> = EmojiCategories; -//@class EmojiCategoryType @description Describes type of an emoji category +//@class EmojiCategoryType @description Describes type of emoji category -//@description The category must be used by default +//@description The category must be used by default (e.g., for custom emoji or animation search) emojiCategoryTypeDefault = EmojiCategoryType; +//@description The category must be used by default for regular sticker selection. It may contain greeting emoji category and premium stickers +emojiCategoryTypeRegularStickers = EmojiCategoryType; + //@description The category must be used for emoji status selection emojiCategoryTypeEmojiStatus = EmojiCategoryType; @@ -3081,6 +4242,418 @@ emojiCategoryTypeEmojiStatus = EmojiCategoryType; emojiCategoryTypeChatPhoto = EmojiCategoryType; +//@description Describes the current weather +//@temperature Temperature, in degree Celsius +//@emoji Emoji representing the weather +currentWeather temperature:double emoji:string = CurrentWeather; + + +//@description Describes position of a clickable rectangle area on a story media +//@x_percentage The abscissa of the rectangle's center, as a percentage of the media width +//@y_percentage The ordinate of the rectangle's center, as a percentage of the media height +//@width_percentage The width of the rectangle, as a percentage of the media width +//@height_percentage The height of the rectangle, as a percentage of the media height +//@rotation_angle Clockwise rotation angle of the rectangle, in degrees; 0-360 +//@corner_radius_percentage The radius of the rectangle corner rounding, as a percentage of the media width +storyAreaPosition x_percentage:double y_percentage:double width_percentage:double height_percentage:double rotation_angle:double corner_radius_percentage:double = StoryAreaPosition; + + +//@class StoryAreaType @description Describes type of clickable area on a story media + +//@description An area pointing to a location @location The location @address Address of the location; may be null if unknown +storyAreaTypeLocation location:location address:locationAddress = StoryAreaType; + +//@description An area pointing to a venue @venue Information about the venue +storyAreaTypeVenue venue:venue = StoryAreaType; + +//@description An area pointing to a suggested reaction. App needs to show a clickable reaction on the area and call setStoryReaction when the are is clicked +//@reaction_type Type of the reaction +//@total_count Number of times the reaction was added +//@is_dark True, if reaction has a dark background +//@is_flipped True, if reaction corner is flipped +storyAreaTypeSuggestedReaction reaction_type:ReactionType total_count:int32 is_dark:Bool is_flipped:Bool = StoryAreaType; + +//@description An area pointing to a message @chat_id Identifier of the chat with the message @message_id Identifier of the message +storyAreaTypeMessage chat_id:int53 message_id:int53 = StoryAreaType; + +//@description An area pointing to a HTTP or tg:// link @url HTTP or tg:// URL to be opened when the area is clicked +storyAreaTypeLink url:string = StoryAreaType; + +//@description An area with information about weather +//@temperature Temperature, in degree Celsius +//@emoji Emoji representing the weather +//@background_color A color of the area background in the ARGB format +storyAreaTypeWeather temperature:double emoji:string background_color:int32 = StoryAreaType; + + +//@description Describes a clickable rectangle area on a story media @position Position of the area @type Type of the area +storyArea position:storyAreaPosition type:StoryAreaType = StoryArea; + + +//@class InputStoryAreaType @description Describes type of clickable area on a story media to be added + +//@description An area pointing to a location @location The location @address Address of the location; pass null if unknown +inputStoryAreaTypeLocation location:location address:locationAddress = InputStoryAreaType; + +//@description An area pointing to a venue found by the bot getOption("venue_search_bot_username") +//@query_id Identifier of the inline query, used to found the venue +//@result_id Identifier of the inline query result +inputStoryAreaTypeFoundVenue query_id:int64 result_id:string = InputStoryAreaType; + +//@description An area pointing to a venue already added to the story +//@venue_provider Provider of the venue +//@venue_id Identifier of the venue in the provider database +inputStoryAreaTypePreviousVenue venue_provider:string venue_id:string = InputStoryAreaType; + +//@description An area pointing to a suggested reaction +//@reaction_type Type of the reaction +//@is_dark True, if reaction has a dark background +//@is_flipped True, if reaction corner is flipped +inputStoryAreaTypeSuggestedReaction reaction_type:ReactionType is_dark:Bool is_flipped:Bool = InputStoryAreaType; + +//@description An area pointing to a message +//@chat_id Identifier of the chat with the message. Currently, the chat must be a supergroup or a channel chat +//@message_id Identifier of the message. Use messageProperties.can_be_shared_in_story to check whether the message is suitable +inputStoryAreaTypeMessage chat_id:int53 message_id:int53 = InputStoryAreaType; + +//@description An area pointing to a HTTP or tg:// link +//@url HTTP or tg:// URL to be opened when the area is clicked +inputStoryAreaTypeLink url:string = InputStoryAreaType; + +//@description An area with information about weather +//@temperature Temperature, in degree Celsius +//@emoji Emoji representing the weather +//@background_color A color of the area background in the ARGB format +inputStoryAreaTypeWeather temperature:double emoji:string background_color:int32 = InputStoryAreaType; + + +//@description Describes a clickable rectangle area on a story media to be added @position Position of the area @type Type of the area +inputStoryArea position:storyAreaPosition type:InputStoryAreaType = InputStoryArea; + +//@description Contains a list of story areas to be added @areas List of input story areas. Currently, a story can have +//-up to 10 inputStoryAreaTypeLocation, inputStoryAreaTypeFoundVenue, and inputStoryAreaTypePreviousVenue areas, +//-up to getOption("story_suggested_reaction_area_count_max") inputStoryAreaTypeSuggestedReaction areas, +//-up to 1 inputStoryAreaTypeMessage area, +//-up to getOption("story_link_area_count_max") inputStoryAreaTypeLink areas if the current user is a Telegram Premium user, and +//-up to 3 inputStoryAreaTypeWeather areas +inputStoryAreas areas:vector<inputStoryArea> = InputStoryAreas; + + +//@description Describes a video file sent in a story +//@duration Duration of the video, in seconds +//@width Video width +//@height Video height +//@has_stickers True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets +//@is_animation True, if the video has no sound +//@minithumbnail Video minithumbnail; may be null +//@thumbnail Video thumbnail in JPEG or MPEG4 format; may be null +//@preload_prefix_size Size of file prefix, which is supposed to be preloaded, in bytes +//@cover_frame_timestamp Timestamp of the frame used as video thumbnail +//@video File containing the video +storyVideo duration:double width:int32 height:int32 has_stickers:Bool is_animation:Bool minithumbnail:minithumbnail thumbnail:thumbnail preload_prefix_size:int32 cover_frame_timestamp:double video:file = StoryVideo; + + +//@class StoryContent @description Contains the content of a story + +//@description A photo story @photo The photo +storyContentPhoto photo:photo = StoryContent; + +//@description A video story @video The video in MPEG4 format @alternative_video Alternative version of the video in MPEG4 format, encoded by x264 codec; may be null +storyContentVideo video:storyVideo alternative_video:storyVideo = StoryContent; + +//@description A story content that is not supported in the current TDLib version +storyContentUnsupported = StoryContent; + + +//@class InputStoryContent @description The content of a story to send + +//@description A photo story +//@photo Photo to send. The photo must be at most 10 MB in size. The photo size must be 1080x1920 +//@added_sticker_file_ids File identifiers of the stickers added to the photo, if applicable +inputStoryContentPhoto photo:InputFile added_sticker_file_ids:vector<int32> = InputStoryContent; + +//@description A video story +//@video Video to be sent. The video size must be 720x1280. The video must be streamable and stored in MPEG4 format, after encoding with x265 codec and key frames added each second +//@added_sticker_file_ids File identifiers of the stickers added to the video, if applicable +//@duration Precise duration of the video, in seconds; 0-60 +//@cover_frame_timestamp Timestamp of the frame, which will be used as video thumbnail +//@is_animation True, if the video has no sound +inputStoryContentVideo video:InputFile added_sticker_file_ids:vector<int32> duration:double cover_frame_timestamp:double is_animation:Bool = InputStoryContent; + + +//@class StoryList @description Describes a list of stories + +//@description The list of stories, shown in the main chat list and folder chat lists +storyListMain = StoryList; + +//@description The list of stories, shown in the Arvhive chat list +storyListArchive = StoryList; + + +//@class StoryOrigin @description Contains information about the origin of a story that was reposted + +//@description The original story was a public story with known sender @chat_id Identifier of the chat that posted original story @story_id Story identifier of the original story +storyOriginPublicStory chat_id:int53 story_id:int32 = StoryOrigin; + +//@description The original story was sent by an unknown user @sender_name Name of the story sender +storyOriginHiddenUser sender_name:string = StoryOrigin; + + +//@description Contains information about original story that was reposted +//@origin Origin of the story that was reposted +//@is_content_modified True, if story content was modified during reposting; otherwise, story wasn't modified +storyRepostInfo origin:StoryOrigin is_content_modified:Bool = StoryRepostInfo; + +//@description Contains information about interactions with a story +//@view_count Number of times the story was viewed +//@forward_count Number of times the story was forwarded; 0 if none or unknown +//@reaction_count Number of reactions added to the story; 0 if none or unknown +//@recent_viewer_user_ids Identifiers of at most 3 recent viewers of the story +storyInteractionInfo view_count:int32 forward_count:int32 reaction_count:int32 recent_viewer_user_ids:vector<int53> = StoryInteractionInfo; + +//@description Represents a story +//@id Unique story identifier among stories of the given sender +//@sender_chat_id Identifier of the chat that posted the story +//@sender_id Identifier of the sender of the story; may be null if the story is posted on behalf of the sender_chat_id +//@date Point in time (Unix timestamp) when the story was published +//@is_being_sent True, if the story is being sent by the current user +//@is_being_edited True, if the story is being edited by the current user +//@is_edited True, if the story was edited +//@is_posted_to_chat_page True, if the story is saved in the sender's profile and will be available there after expiration +//@is_visible_only_for_self True, if the story is visible only for the current user +//@can_be_deleted True, if the story can be deleted +//@can_be_edited True, if the story can be edited +//@can_be_forwarded True, if the story can be forwarded as a message. Otherwise, screenshots and saving of the story content must be also forbidden +//@can_be_replied True, if the story can be replied in the chat with the story sender +//@can_toggle_is_posted_to_chat_page True, if the story's is_posted_to_chat_page value can be changed +//@can_get_statistics True, if the story statistics are available through getStoryStatistics +//@can_get_interactions True, if interactions with the story can be received through getStoryInteractions +//@has_expired_viewers True, if users viewed the story can't be received, because the story has expired more than getOption("story_viewers_expiration_delay") seconds ago +//@repost_info Information about the original story; may be null if the story wasn't reposted +//@interaction_info Information about interactions with the story; may be null if the story isn't owned or there were no interactions +//@chosen_reaction_type Type of the chosen reaction; may be null if none +//@privacy_settings Privacy rules affecting story visibility; may be approximate for non-owned stories +//@content Content of the story +//@areas Clickable areas to be shown on the story content +//@caption Caption of the story +story id:int32 sender_chat_id:int53 sender_id:MessageSender date:int32 is_being_sent:Bool is_being_edited:Bool is_edited:Bool is_posted_to_chat_page:Bool is_visible_only_for_self:Bool can_be_deleted:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_replied:Bool can_toggle_is_posted_to_chat_page:Bool can_get_statistics:Bool can_get_interactions:Bool has_expired_viewers:Bool repost_info:storyRepostInfo interaction_info:storyInteractionInfo chosen_reaction_type:ReactionType privacy_settings:StoryPrivacySettings content:StoryContent areas:vector<storyArea> caption:formattedText = Story; + +//@description Represents a list of stories +//@total_count Approximate total number of stories found +//@stories The list of stories +//@pinned_story_ids Identifiers of the pinned stories; returned only in getChatPostedToChatPageStories with from_story_id == 0 +stories total_count:int32 stories:vector<story> pinned_story_ids:vector<int32> = Stories; + +//@description Contains a list of stories found by a search @total_count Approximate total number of stories found @stories List of stories @next_offset The offset for the next request. If empty, then there are no more results +foundStories total_count:int32 stories:vector<story> next_offset:string = FoundStories; + +//@description Contains identifier of a story along with identifier of its sender +//@sender_chat_id Identifier of the chat that posted the story +//@story_id Unique story identifier among stories of the given sender +storyFullId sender_chat_id:int53 story_id:int32 = StoryFullId; + +//@description Contains basic information about a story +//@story_id Unique story identifier among stories of the given sender +//@date Point in time (Unix timestamp) when the story was published +//@is_for_close_friends True, if the story is available only to close friends +storyInfo story_id:int32 date:int32 is_for_close_friends:Bool = StoryInfo; + +//@description Describes active stories posted by a chat +//@chat_id Identifier of the chat that posted the stories +//@list Identifier of the story list in which the stories are shown; may be null if the stories aren't shown in a story list +//@order A parameter used to determine order of the stories in the story list; 0 if the stories doesn't need to be shown in the story list. Stories must be sorted by the pair (order, story_sender_chat_id) in descending order +//@max_read_story_id Identifier of the last read active story +//@stories Basic information about the stories; use getStory to get full information about the stories. The stories are in chronological order (i.e., in order of increasing story identifiers) +chatActiveStories chat_id:int53 list:StoryList order:int53 max_read_story_id:int32 stories:vector<storyInfo> = ChatActiveStories; + + +//@class StoryInteractionType @description Describes type of interaction with a story + +//@description A view of the story @chosen_reaction_type Type of the reaction that was chosen by the viewer; may be null if none +storyInteractionTypeView chosen_reaction_type:ReactionType = StoryInteractionType; + +//@description A forward of the story as a message @message The message with story forward +storyInteractionTypeForward message:message = StoryInteractionType; + +//@description A repost of the story as a story @story The reposted story +storyInteractionTypeRepost story:story = StoryInteractionType; + + +//@description Represents interaction with a story +//@actor_id Identifier of the user or chat that made the interaction +//@interaction_date Approximate point in time (Unix timestamp) when the interaction happened +//@block_list Block list to which the actor is added; may be null if none or for chat stories +//@type Type of the interaction +storyInteraction actor_id:MessageSender interaction_date:int32 block_list:BlockList type:StoryInteractionType = StoryInteraction; + +//@description Represents a list of interactions with a story +//@total_count Approximate total number of interactions found +//@total_forward_count Approximate total number of found forwards and reposts; always 0 for chat stories +//@total_reaction_count Approximate total number of found reactions; always 0 for chat stories +//@interactions List of story interactions +//@next_offset The offset for the next request. If empty, then there are no more results +storyInteractions total_count:int32 total_forward_count:int32 total_reaction_count:int32 interactions:vector<storyInteraction> next_offset:string = StoryInteractions; + + +//@description Describes a message that can be used for quick reply +//@id Unique message identifier among all quick replies +//@sending_state The sending state of the message; may be null if the message isn't being sent and didn't fail to be sent +//@can_be_edited True, if the message can be edited +//@reply_to_message_id The identifier of the quick reply message to which the message replies; 0 if none +//@via_bot_user_id If non-zero, the user identifier of the bot through which this message was sent +//@media_album_id Unique identifier of an album this message belongs to; 0 if none. Only audios, documents, photos and videos can be grouped together in albums +//@content Content of the message +//@reply_markup Inline keyboard reply markup for the message; may be null if none +quickReplyMessage id:int53 sending_state:MessageSendingState can_be_edited:Bool reply_to_message_id:int53 via_bot_user_id:int53 media_album_id:int64 content:MessageContent reply_markup:ReplyMarkup = QuickReplyMessage; + +//@description Contains a list of quick reply messages @messages List of quick reply messages; messages may be null +quickReplyMessages messages:vector<quickReplyMessage> = QuickReplyMessages; + +//@description Describes a shortcut that can be used for a quick reply +//@id Unique shortcut identifier +//@name The name of the shortcut that can be used to use the shortcut +//@first_message The first shortcut message +//@message_count The total number of messages in the shortcut +quickReplyShortcut id:int32 name:string first_message:quickReplyMessage message_count:int32 = QuickReplyShortcut; + + +//@class PublicForward @description Describes a public forward or repost of a story + +//@description Contains a public forward as a message @message Information about the message +publicForwardMessage message:message = PublicForward; + +//@description Contains a public repost to a story @story Information about the story +publicForwardStory story:story = PublicForward; + + +//@description Represents a list of public forwards and reposts as a story of a message or a story +//@total_count Approximate total number of messages and stories found +//@forwards List of found public forwards and reposts +//@next_offset The offset for the next request. If empty, then there are no more results +publicForwards total_count:int32 forwards:vector<PublicForward> next_offset:string = PublicForwards; + + +//@description Describes media previews of a bot +//@date Point in time (Unix timestamp) when the preview was added or changed last time +//@content Content of the preview +botMediaPreview date:int32 content:StoryContent = BotMediaPreview; + +//@description Contains a list of media previews of a bot @previews List of media previews +botMediaPreviews previews:vector<botMediaPreview> = BotMediaPreviews; + +//@description Contains a list of media previews of a bot for the given language and the list of languages for which the bot has dedicated previews +//@previews List of media previews +//@language_codes List of language codes for which the bot has dedicated previews +botMediaPreviewInfo previews:vector<botMediaPreview> language_codes:vector<string> = BotMediaPreviewInfo; + + +//@description Contains a list of features available on a specific chat boost level +//@level Target chat boost level +//@story_per_day_count Number of stories that the chat can publish daily +//@custom_emoji_reaction_count Number of custom emoji reactions that can be added to the list of available reactions +//@title_color_count Number of custom colors for chat title +//@profile_accent_color_count Number of custom colors for profile photo background +//@can_set_profile_background_custom_emoji True, if custom emoji for profile background can be set +//@accent_color_count Number of custom colors for background of empty chat photo, replies to messages and link previews +//@can_set_background_custom_emoji True, if custom emoji for reply header and link preview background can be set +//@can_set_emoji_status True, if emoji status can be set +//@chat_theme_background_count Number of chat theme backgrounds that can be set as chat background +//@can_set_custom_background True, if custom background can be set in the chat for all users +//@can_set_custom_emoji_sticker_set True, if custom emoji sticker set can be set for the chat +//@can_recognize_speech True, if speech recognition can be used for video note and voice note messages by all users +//@can_disable_sponsored_messages True, if sponsored messages can be disabled in the chat +chatBoostLevelFeatures level:int32 story_per_day_count:int32 custom_emoji_reaction_count:int32 title_color_count:int32 profile_accent_color_count:int32 can_set_profile_background_custom_emoji:Bool accent_color_count:int32 can_set_background_custom_emoji:Bool can_set_emoji_status:Bool chat_theme_background_count:int32 can_set_custom_background:Bool can_set_custom_emoji_sticker_set:Bool can_recognize_speech:Bool can_disable_sponsored_messages:Bool = ChatBoostLevelFeatures; + +//@description Contains a list of features available on the first chat boost levels +//@features The list of features +//@min_profile_background_custom_emoji_boost_level The minimum boost level required to set custom emoji for profile background +//@min_background_custom_emoji_boost_level The minimum boost level required to set custom emoji for reply header and link preview background; for channel chats only +//@min_emoji_status_boost_level The minimum boost level required to set emoji status +//@min_chat_theme_background_boost_level The minimum boost level required to set a chat theme background as chat background +//@min_custom_background_boost_level The minimum boost level required to set custom chat background +//@min_custom_emoji_sticker_set_boost_level The minimum boost level required to set custom emoji sticker set for the chat; for supergroup chats only +//@min_speech_recognition_boost_level The minimum boost level allowing to recognize speech in video note and voice note messages for non-Premium users; for supergroup chats only +//@min_sponsored_message_disable_boost_level The minimum boost level allowing to disable sponsored messages in the chat; for channel chats only +chatBoostFeatures features:vector<chatBoostLevelFeatures> min_profile_background_custom_emoji_boost_level:int32 min_background_custom_emoji_boost_level:int32 min_emoji_status_boost_level:int32 min_chat_theme_background_boost_level:int32 min_custom_background_boost_level:int32 min_custom_emoji_sticker_set_boost_level:int32 min_speech_recognition_boost_level:int32 min_sponsored_message_disable_boost_level:int32 = ChatBoostFeatures; + + +//@class ChatBoostSource @description Describes source of a chat boost + +//@description The chat created a Telegram Premium gift code for a user +//@user_id Identifier of a user, for which the gift code was created +//@gift_code The created Telegram Premium gift code, which is known only if this is a gift code for the current user, or it has already been claimed +chatBoostSourceGiftCode user_id:int53 gift_code:string = ChatBoostSource; + +//@description The chat created a giveaway +//@user_id Identifier of a user that won in the giveaway; 0 if none +//@gift_code The created Telegram Premium gift code if it was used by the user or can be claimed by the current user; an empty string otherwise; for Telegram Premium giveways only +//@star_count Number of Telegram Stars distributed among winners of the giveaway +//@giveaway_message_id Identifier of the corresponding giveaway message; can be an identifier of a deleted message +//@is_unclaimed True, if the winner for the corresponding giveaway prize wasn't chosen, because there were not enough participants +chatBoostSourceGiveaway user_id:int53 gift_code:string star_count:int53 giveaway_message_id:int53 is_unclaimed:Bool = ChatBoostSource; + +//@description A user with Telegram Premium subscription or gifted Telegram Premium boosted the chat +//@user_id Identifier of the user +chatBoostSourcePremium user_id:int53 = ChatBoostSource; + + +//@description Describes a prepaid giveaway +//@id Unique identifier of the prepaid giveaway +//@winner_count Number of users which will receive giveaway prize +//@prize Prize of the giveaway +//@boost_count The number of boosts received by the chat from the giveaway; for Telegram Star giveaways only +//@payment_date Point in time (Unix timestamp) when the giveaway was paid +prepaidGiveaway id:int64 winner_count:int32 prize:GiveawayPrize boost_count:int32 payment_date:int32 = PrepaidGiveaway; + +//@description Describes current boost status of a chat +//@boost_url An HTTP URL, which can be used to boost the chat +//@applied_slot_ids Identifiers of boost slots of the current user applied to the chat +//@level Current boost level of the chat +//@gift_code_boost_count The number of boosts received by the chat from created Telegram Premium gift codes and giveaways; always 0 if the current user isn't an administrator in the chat +//@boost_count The number of boosts received by the chat +//@current_level_boost_count The number of boosts added to reach the current level +//@next_level_boost_count The number of boosts needed to reach the next level; 0 if the next level isn't available +//@premium_member_count Approximate number of Telegram Premium subscribers joined the chat; always 0 if the current user isn't an administrator in the chat +//@premium_member_percentage A percentage of Telegram Premium subscribers joined the chat; always 0 if the current user isn't an administrator in the chat +//@prepaid_giveaways The list of prepaid giveaways available for the chat; only for chat administrators +chatBoostStatus boost_url:string applied_slot_ids:vector<int32> level:int32 gift_code_boost_count:int32 boost_count:int32 current_level_boost_count:int32 next_level_boost_count:int32 premium_member_count:int32 premium_member_percentage:double prepaid_giveaways:vector<prepaidGiveaway> = ChatBoostStatus; + +//@description Describes a boost applied to a chat +//@id Unique identifier of the boost +//@count The number of identical boosts applied +//@source Source of the boost +//@start_date Point in time (Unix timestamp) when the chat was boosted +//@expiration_date Point in time (Unix timestamp) when the boost will expire +chatBoost id:string count:int32 source:ChatBoostSource start_date:int32 expiration_date:int32 = ChatBoost; + +//@description Contains a list of boosts applied to a chat +//@total_count Total number of boosts applied to the chat +//@boosts List of boosts +//@next_offset The offset for the next request. If empty, then there are no more results +foundChatBoosts total_count:int32 boosts:vector<chatBoost> next_offset:string = FoundChatBoosts; + +//@description Describes a slot for chat boost +//@slot_id Unique identifier of the slot +//@currently_boosted_chat_id Identifier of the currently boosted chat; 0 if none +//@start_date Point in time (Unix timestamp) when the chat was boosted; 0 if none +//@expiration_date Point in time (Unix timestamp) when the boost will expire +//@cooldown_until_date Point in time (Unix timestamp) after which the boost can be used for another chat +chatBoostSlot slot_id:int32 currently_boosted_chat_id:int53 start_date:int32 expiration_date:int32 cooldown_until_date:int32 = ChatBoostSlot; + +//@description Contains a list of chat boost slots @slots List of boost slots +chatBoostSlots slots:vector<chatBoostSlot> = ChatBoostSlots; + + +//@class ResendCodeReason @description Describes the reason why a code needs to be re-sent + +//@description The user requested to resend the code +resendCodeReasonUserRequest = ResendCodeReason; + +//@description The code is re-sent, because device verification has failed +//@error_message Cause of the verification failure, for example, PLAY_SERVICES_NOT_AVAILABLE, APNS_RECEIVE_TIMEOUT, or APNS_INIT_FAILED +resendCodeReasonVerificationFailed error_message:string = ResendCodeReason; + + //@class CallDiscardReason @description Describes the reason why a call was discarded //@description The call wasn't discarded, or the reason is unknown @@ -3103,12 +4676,12 @@ callDiscardReasonHungUp = CallDiscardReason; //@udp_p2p True, if UDP peer-to-peer connections are supported //@udp_reflector True, if connection through UDP reflectors is supported //@min_layer The minimum supported API layer; use 65 -//@max_layer The maximum supported API layer; use 65 +//@max_layer The maximum supported API layer; use 92 //@library_versions List of supported tgcalls versions callProtocol udp_p2p:Bool udp_reflector:Bool min_layer:int32 max_layer:int32 library_versions:vector<string> = CallProtocol; -//@class CallServerType @description Describes the type of a call server +//@class CallServerType @description Describes the type of call server //@description A Telegram call reflector @peer_tag A peer tag to be used with the reflector @is_tcp True, if the server uses TCP instead of UDP callServerTypeTelegramReflector peer_tag:bytes is_tcp:Bool = CallServerType; @@ -3146,19 +4719,20 @@ callStatePending is_created:Bool is_received:Bool = CallState; callStateExchangingKeys = CallState; //@description The call is ready to use -//@protocol Call protocols supported by the peer +//@protocol Call protocols supported by the other call participant //@servers List of available call servers //@config A JSON-encoded call config //@encryption_key Call encryption key -//@emojis Encryption key emojis fingerprint +//@emojis Encryption key fingerprint represented as 4 emoji //@allow_p2p True, if peer-to-peer connection is allowed by users privacy settings -callStateReady protocol:callProtocol servers:vector<callServer> config:string encryption_key:bytes emojis:vector<string> allow_p2p:Bool = CallState; +//@custom_parameters Custom JSON-encoded call parameters to be passed to tgcalls +callStateReady protocol:callProtocol servers:vector<callServer> config:string encryption_key:bytes emojis:vector<string> allow_p2p:Bool custom_parameters:string = CallState; //@description The call is hanging up after discardCall has been called callStateHangingUp = CallState; //@description The call has ended successfully -//@reason The reason, why the call has ended +//@reason The reason why the call has ended //@need_rating True, if the call rating must be sent to the server //@need_debug_information True, if the call debug information must be sent to the server //@need_log True, if the call log must be sent to the server @@ -3200,7 +4774,7 @@ groupCallRecentSpeaker participant_id:MessageSender is_speaking:Bool = GroupCall //@id Group call identifier //@title Group call title //@scheduled_start_date Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 if it is already active or was ended -//@enabled_start_notification True, if the group call is scheduled and the current user will receive a notification when the group call will start +//@enabled_start_notification True, if the group call is scheduled and the current user will receive a notification when the group call starts //@is_active True, if the call is active //@is_rtmp_stream True, if the chat is an RTMP stream instead of an ordinary video chat //@is_joined True, if the call is joined @@ -3251,7 +4825,7 @@ groupCallParticipantVideoInfo source_groups:vector<groupCallVideoSourceGroup> en groupCallParticipant participant_id:MessageSender audio_source_id:int32 screen_sharing_audio_source_id:int32 video_info:groupCallParticipantVideoInfo screen_sharing_video_info:groupCallParticipantVideoInfo bio:string is_current_user:Bool is_speaking:Bool is_hand_raised:Bool can_be_muted_for_all_users:Bool can_be_unmuted_for_all_users:Bool can_be_muted_for_current_user:Bool can_be_unmuted_for_current_user:Bool is_muted_for_all_users:Bool is_muted_for_current_user:Bool can_unmute_self:Bool volume_level:int32 order:string = GroupCallParticipant; -//@class CallProblem @description Describes the exact type of a problem with a call +//@class CallProblem @description Describes the exact type of problem with a call //@description The user heard their own voice callProblemEcho = CallProblem; @@ -3283,7 +4857,7 @@ callProblemPixelatedVideo = CallProblem; //@description Describes a call //@id Call identifier, not persistent -//@user_id Peer user identifier +//@user_id User identifier of the other call participant //@is_outgoing True, if the call is outgoing //@is_video True, if the call is a video call //@state Call state @@ -3303,16 +4877,21 @@ firebaseAuthenticationSettingsIos device_token:string is_app_sandbox:Bool = Fire //@allow_flash_call Pass true if the authentication code may be sent via a flash call to the specified phone number //@allow_missed_call Pass true if the authentication code may be sent via a missed call to the specified phone number //@is_current_phone_number Pass true if the authenticated phone number is used on the current device +//@has_unknown_phone_number Pass true if there is a SIM card in the current device, but it is not possible to check whether phone number matches //@allow_sms_retriever_api For official applications only. True, if the application can use Android SMS Retriever API (requires Google Play Services >= 10.2) to automatically receive the authentication code from the SMS. See https://developers.google.com/identity/sms-retriever/ for more details //@firebase_authentication_settings For official Android and iOS applications only; pass null otherwise. Settings for Firebase Authentication //@authentication_tokens List of up to 20 authentication tokens, recently received in updateOption("authentication_token") in previously logged out sessions -phoneNumberAuthenticationSettings allow_flash_call:Bool allow_missed_call:Bool is_current_phone_number:Bool allow_sms_retriever_api:Bool firebase_authentication_settings:FirebaseAuthenticationSettings authentication_tokens:vector<string> = PhoneNumberAuthenticationSettings; +phoneNumberAuthenticationSettings allow_flash_call:Bool allow_missed_call:Bool is_current_phone_number:Bool has_unknown_phone_number:Bool allow_sms_retriever_api:Bool firebase_authentication_settings:FirebaseAuthenticationSettings authentication_tokens:vector<string> = PhoneNumberAuthenticationSettings; -//@description Represents a reaction applied to a message @type Type of the reaction @sender_id Identifier of the chat member, applied the reaction @date Point in time (Unix timestamp) when the reaction was added -addedReaction type:ReactionType sender_id:MessageSender date:int32 = AddedReaction; +//@description Represents a reaction applied to a message +//@type Type of the reaction +//@sender_id Identifier of the chat member, applied the reaction +//@is_outgoing True, if the reaction was added by the current user +//@date Point in time (Unix timestamp) when the reaction was added +addedReaction type:ReactionType sender_id:MessageSender is_outgoing:Bool date:int32 = AddedReaction; -//@description Represents a list of reactions added to a message @total_count The total number of found reactions @reactions The list of added reactions @next_offset The offset for the next request. If empty, there are no more results +//@description Represents a list of reactions added to a message @total_count The total number of found reactions @reactions The list of added reactions @next_offset The offset for the next request. If empty, then there are no more results addedReactions total_count:int32 reactions:vector<addedReaction> next_offset:string = AddedReactions; //@description Represents an available reaction @type Type of the reaction @needs_premium True, if Telegram Premium is needed to send the reaction @@ -3322,10 +4901,12 @@ availableReaction type:ReactionType needs_premium:Bool = AvailableReaction; //@top_reactions List of reactions to be shown at the top //@recent_reactions List of recently used reactions //@popular_reactions List of popular reactions -//@allow_custom_emoji True, if custom emoji reactions could be added by Telegram Premium subscribers -availableReactions top_reactions:vector<availableReaction> recent_reactions:vector<availableReaction> popular_reactions:vector<availableReaction> allow_custom_emoji:Bool = AvailableReactions; +//@allow_custom_emoji True, if any custom emoji reaction can be added by Telegram Premium subscribers +//@are_tags True, if the reactions will be tags and the message can be found by them +//@unavailability_reason The reason why the current user can't add reactions to the message, despite some other users can; may be null if none +availableReactions top_reactions:vector<availableReaction> recent_reactions:vector<availableReaction> popular_reactions:vector<availableReaction> allow_custom_emoji:Bool are_tags:Bool unavailability_reason:ReactionUnavailabilityReason = AvailableReactions; -//@description Contains information about a emoji reaction +//@description Contains information about an emoji reaction //@emoji Text representation of the reaction //@title Reaction title //@is_active True, if the reaction can be added to new messages and enabled in chats @@ -3339,6 +4920,15 @@ availableReactions top_reactions:vector<availableReaction> recent_reactions:vect emojiReaction emoji:string title:string is_active:Bool static_icon:sticker appear_animation:sticker select_animation:sticker activate_animation:sticker effect_animation:sticker around_animation:sticker center_animation:sticker = EmojiReaction; +//@class ReactionUnavailabilityReason @description Describes why the current user can't add reactions to the message, despite some other users can + +//@description The user is an anonymous administrator in the supergroup, but isn't a creator of it, so they can't vote on behalf of the supergroup +reactionUnavailabilityReasonAnonymousAdministrator = ReactionUnavailabilityReason; + +//@description The user isn't a member of the supergroup and can't send messages and reactions there without joining +reactionUnavailabilityReasonGuest = ReactionUnavailabilityReason; + + //@description Represents a list of animations @animations List of animations animations animations:vector<animation> = Animations; @@ -3371,37 +4961,68 @@ speechRecognitionResultPending partial_text:string = SpeechRecognitionResult; //@description The speech recognition successfully finished @text Recognized text speechRecognitionResultText text:string = SpeechRecognitionResult; -//@description The speech recognition failed @error Recognition error +//@description The speech recognition failed @error Recognition error. An error with a message "MSG_VOICE_TOO_LONG" is returned when media duration is too big to be recognized speechRecognitionResultError error:error = SpeechRecognitionResult; +//@description Describes a connection of the bot with a business account +//@id Unique identifier of the connection +//@user_id Identifier of the business user that created the connection +//@user_chat_id Chat identifier of the private chat with the user +//@date Point in time (Unix timestamp) when the connection was established +//@can_reply True, if the bot can send messages to the connected user; false otherwise +//@is_enabled True, if the connection is enabled; false otherwise +businessConnection id:string user_id:int53 user_chat_id:int53 date:int32 can_reply:Bool is_enabled:Bool = BusinessConnection; + + //@description Describes a color to highlight a bot added to attachment menu @light_color Color in the RGB24 format for light themes @dark_color Color in the RGB24 format for dark themes attachmentMenuBotColor light_color:int32 dark_color:int32 = AttachmentMenuBotColor; -//@description Represents a bot, which can be added to attachment menu -//@bot_user_id User identifier of the bot added to attachment menu +//@description Represents a bot, which can be added to attachment or side menu +//@bot_user_id User identifier of the bot //@supports_self_chat True, if the bot supports opening from attachment menu in the chat with the bot //@supports_user_chats True, if the bot supports opening from attachment menu in private chats with ordinary users //@supports_bot_chats True, if the bot supports opening from attachment menu in private chats with other bots //@supports_group_chats True, if the bot supports opening from attachment menu in basic group and supergroup chats //@supports_channel_chats True, if the bot supports opening from attachment menu in channel chats -//@supports_settings True, if the bot supports "settings_button_pressed" event -//@request_write_access True, if the user must be asked for the permission to the bot to send them messages +//@request_write_access True, if the user must be asked for the permission to send messages to the bot +//@is_added True, if the bot was explicitly added by the user. If the bot isn't added, then on the first bot launch toggleBotIsAddedToAttachmentMenu must be called and the bot must be added or removed +//@show_in_attachment_menu True, if the bot must be shown in the attachment menu +//@show_in_side_menu True, if the bot must be shown in the side menu +//@show_disclaimer_in_side_menu True, if a disclaimer, why the bot is shown in the side menu, is needed //@name Name for the bot in attachment menu //@name_color Color to highlight selected name of the bot if appropriate; may be null -//@default_icon Default attachment menu icon for the bot in SVG format; may be null -//@ios_static_icon Attachment menu icon for the bot in SVG format for the official iOS app; may be null -//@ios_animated_icon Attachment menu icon for the bot in TGS format for the official iOS app; may be null -//@android_icon Attachment menu icon for the bot in TGS format for the official Android app; may be null -//@macos_icon Attachment menu icon for the bot in TGS format for the official native macOS app; may be null +//@default_icon Default icon for the bot in SVG format; may be null +//@ios_static_icon Icon for the bot in SVG format for the official iOS app; may be null +//@ios_animated_icon Icon for the bot in TGS format for the official iOS app; may be null +//@ios_side_menu_icon Icon for the bot in PNG format for the official iOS app side menu; may be null +//@android_icon Icon for the bot in TGS format for the official Android app; may be null +//@android_side_menu_icon Icon for the bot in SVG format for the official Android app side menu; may be null +//@macos_icon Icon for the bot in TGS format for the official native macOS app; may be null +//@macos_side_menu_icon Icon for the bot in PNG format for the official macOS app side menu; may be null //@icon_color Color to highlight selected icon of the bot if appropriate; may be null //@web_app_placeholder Default placeholder for opened Web Apps in SVG format; may be null -attachmentMenuBot bot_user_id:int53 supports_self_chat:Bool supports_user_chats:Bool supports_bot_chats:Bool supports_group_chats:Bool supports_channel_chats:Bool supports_settings:Bool request_write_access:Bool name:string name_color:attachmentMenuBotColor default_icon:file ios_static_icon:file ios_animated_icon:file android_icon:file macos_icon:file icon_color:attachmentMenuBotColor web_app_placeholder:file = AttachmentMenuBot; +attachmentMenuBot bot_user_id:int53 supports_self_chat:Bool supports_user_chats:Bool supports_bot_chats:Bool supports_group_chats:Bool supports_channel_chats:Bool request_write_access:Bool is_added:Bool show_in_attachment_menu:Bool show_in_side_menu:Bool show_disclaimer_in_side_menu:Bool name:string name_color:attachmentMenuBotColor default_icon:file ios_static_icon:file ios_animated_icon:file ios_side_menu_icon:file android_icon:file android_side_menu_icon:file macos_icon:file macos_side_menu_icon:file icon_color:attachmentMenuBotColor web_app_placeholder:file = AttachmentMenuBot; //@description Information about the message sent by answerWebAppQuery @inline_message_id Identifier of the sent inline message, if known sentWebAppMessage inline_message_id:string = SentWebAppMessage; +//@class BotWriteAccessAllowReason @description Describes a reason why a bot was allowed to write messages to the current user + +//@description The user connected a website by logging in using Telegram Login Widget on it @domain_name Domain name of the connected website +botWriteAccessAllowReasonConnectedWebsite domain_name:string = BotWriteAccessAllowReason; + +//@description The user added the bot to attachment or side menu using toggleBotIsAddedToAttachmentMenu +botWriteAccessAllowReasonAddedToAttachmentMenu = BotWriteAccessAllowReason; + +//@description The user launched a Web App using getWebAppLinkUrl @web_app Information about the Web App +botWriteAccessAllowReasonLaunchedWebApp web_app:webApp = BotWriteAccessAllowReason; + +//@description The user accepted bot's request to send messages with allowBotToSendMessages +botWriteAccessAllowReasonAcceptedRequest = BotWriteAccessAllowReason; + + //@description Contains an HTTP URL @url The URL httpUrl url:string = HttpUrl; @@ -3625,7 +5246,7 @@ inlineQueryResultVideo id:string video:video title:string description:string = I inlineQueryResultVoiceNote id:string voice_note:voiceNote title:string = InlineQueryResult; -//@class InlineQueryResultsButtonType @description Represents a type of a button in results of inline query +//@class InlineQueryResultsButtonType @description Represents type of button in results of inline query //@description Describes the button that opens a private chat with the bot and sends a start message to the bot with the given parameter @parameter The parameter for the bot start message inlineQueryResultsButtonTypeStartBot parameter:string = InlineQueryResultsButtonType; @@ -3642,7 +5263,7 @@ inlineQueryResultsButton text:string type:InlineQueryResultsButtonType = InlineQ //@inline_query_id Unique identifier of the inline query //@button Button to be shown above inline query results; may be null //@results Results of the query -//@next_offset The offset for the next request. If empty, there are no more results +//@next_offset The offset for the next request. If empty, then there are no more results inlineQueryResults inline_query_id:int64 button:inlineQueryResultsButton results:vector<InlineQueryResult> next_offset:string = InlineQueryResults; @@ -3711,12 +5332,21 @@ chatEventMemberPromoted user_id:int53 old_status:ChatMemberStatus new_status:Cha //@description A chat member was restricted/unrestricted or banned/unbanned, or the list of their restrictions has changed @member_id Affected chat member identifier @old_status Previous status of the chat member @new_status New status of the chat member chatEventMemberRestricted member_id:MessageSender old_status:ChatMemberStatus new_status:ChatMemberStatus = ChatEventAction; +//@description A chat member extended their subscription to the chat @user_id Affected chat member user identifier @old_status Previous status of the chat member @new_status New status of the chat member +chatEventMemberSubscriptionExtended user_id:int53 old_status:ChatMemberStatus new_status:ChatMemberStatus = ChatEventAction; + //@description The chat available reactions were changed @old_available_reactions Previous chat available reactions @new_available_reactions New chat available reactions chatEventAvailableReactionsChanged old_available_reactions:ChatAvailableReactions new_available_reactions:ChatAvailableReactions = ChatEventAction; +//@description The chat background was changed @old_background Previous background; may be null if none @new_background New background; may be null if none +chatEventBackgroundChanged old_background:chatBackground new_background:chatBackground = ChatEventAction; + //@description The chat description was changed @old_description Previous chat description @new_description New chat description chatEventDescriptionChanged old_description:string new_description:string = ChatEventAction; +//@description The chat emoji status was changed @old_emoji_status Previous emoji status; may be null if none @new_emoji_status New emoji status; may be null if none +chatEventEmojiStatusChanged old_emoji_status:emojiStatus new_emoji_status:emojiStatus = ChatEventAction; + //@description The linked chat of a supergroup was changed @old_linked_chat_id Previous supergroup linked chat identifier @new_linked_chat_id New supergroup linked chat identifier chatEventLinkedChatChanged old_linked_chat_id:int53 new_linked_chat_id:int53 = ChatEventAction; @@ -3726,7 +5356,7 @@ chatEventLocationChanged old_location:chatLocation new_location:chatLocation = C //@description The message auto-delete timer was changed @old_message_auto_delete_time Previous value of message_auto_delete_time @new_message_auto_delete_time New value of message_auto_delete_time chatEventMessageAutoDeleteTimeChanged old_message_auto_delete_time:int32 new_message_auto_delete_time:int32 = ChatEventAction; -//@description The chat permissions was changed @old_permissions Previous chat permissions @new_permissions New chat permissions +//@description The chat permissions were changed @old_permissions Previous chat permissions @new_permissions New chat permissions chatEventPermissionsChanged old_permissions:chatPermissions new_permissions:chatPermissions = ChatEventAction; //@description The chat photo was changed @old_photo Previous chat photo value; may be null @new_photo New chat photo value; may be null @@ -3738,6 +5368,9 @@ chatEventSlowModeDelayChanged old_slow_mode_delay:int32 new_slow_mode_delay:int3 //@description The supergroup sticker set was changed @old_sticker_set_id Previous identifier of the chat sticker set; 0 if none @new_sticker_set_id New identifier of the chat sticker set; 0 if none chatEventStickerSetChanged old_sticker_set_id:int64 new_sticker_set_id:int64 = ChatEventAction; +//@description The supergroup sticker set with allowed custom emoji was changed @old_sticker_set_id Previous identifier of the chat sticker set; 0 if none @new_sticker_set_id New identifier of the chat sticker set; 0 if none +chatEventCustomEmojiStickerSetChanged old_sticker_set_id:int64 new_sticker_set_id:int64 = ChatEventAction; + //@description The chat title was changed @old_title Previous chat title @new_title New chat title chatEventTitleChanged old_title:string new_title:string = ChatEventAction; @@ -3747,6 +5380,20 @@ chatEventUsernameChanged old_username:string new_username:string = ChatEventActi //@description The chat active usernames were changed @old_usernames Previous list of active usernames @new_usernames New list of active usernames chatEventActiveUsernamesChanged old_usernames:vector<string> new_usernames:vector<string> = ChatEventAction; +//@description The chat accent color or background custom emoji were changed +//@old_accent_color_id Previous identifier of chat accent color +//@old_background_custom_emoji_id Previous identifier of the custom emoji; 0 if none +//@new_accent_color_id New identifier of chat accent color +//@new_background_custom_emoji_id New identifier of the custom emoji; 0 if none +chatEventAccentColorChanged old_accent_color_id:int32 old_background_custom_emoji_id:int64 new_accent_color_id:int32 new_background_custom_emoji_id:int64 = ChatEventAction; + +//@description The chat's profile accent color or profile background custom emoji were changed +//@old_profile_accent_color_id Previous identifier of chat's profile accent color; -1 if none +//@old_profile_background_custom_emoji_id Previous identifier of the custom emoji; 0 if none +//@new_profile_accent_color_id New identifier of chat's profile accent color; -1 if none +//@new_profile_background_custom_emoji_id New identifier of the custom emoji; 0 if none +chatEventProfileAccentColorChanged old_profile_accent_color_id:int32 old_profile_background_custom_emoji_id:int64 new_profile_accent_color_id:int32 new_profile_background_custom_emoji_id:int64 = ChatEventAction; + //@description The has_protected_content setting of a channel was toggled @has_protected_content New value of has_protected_content chatEventHasProtectedContentToggled has_protected_content:Bool = ChatEventAction; @@ -3762,6 +5409,9 @@ chatEventHasAggressiveAntiSpamEnabledToggled has_aggressive_anti_spam_enabled:Bo //@description The sign_messages setting of a channel was toggled @sign_messages New value of sign_messages chatEventSignMessagesToggled sign_messages:Bool = ChatEventAction; +//@description The show_message_sender setting of a channel was toggled @show_message_sender New value of show_message_sender +chatEventShowMessageSenderToggled show_message_sender:Bool = ChatEventAction; + //@description A chat invite link was edited @old_invite_link Previous information about the invite link @new_invite_link New information about the invite link chatEventInviteLinkEdited old_invite_link:chatInviteLink new_invite_link:chatInviteLink = ChatEventAction; @@ -3831,7 +5481,8 @@ chatEvents events:vector<chatEvent> = ChatEvents; //@invite_link_changes True, if changes to invite links need to be returned //@video_chat_changes True, if video chat actions need to be returned //@forum_changes True, if forum-related actions need to be returned -chatEventLogFilters message_edits:Bool message_deletions:Bool message_pins:Bool member_joins:Bool member_leaves:Bool member_invites:Bool member_promotions:Bool member_restrictions:Bool info_changes:Bool setting_changes:Bool invite_link_changes:Bool video_chat_changes:Bool forum_changes:Bool = ChatEventLogFilters; +//@subscription_extensions True, if subscription extensions need to be returned +chatEventLogFilters message_edits:Bool message_deletions:Bool message_pins:Bool member_joins:Bool member_leaves:Bool member_invites:Bool member_promotions:Bool member_restrictions:Bool info_changes:Bool setting_changes:Bool invite_link_changes:Bool video_chat_changes:Bool forum_changes:Bool subscription_extensions:Bool = ChatEventLogFilters; //@class LanguagePackStringValue @description Represents the value of a string in a language pack @@ -3878,7 +5529,7 @@ languagePackInfo id:string base_language_pack_id:string name:string native_name: localizationTargetInfo language_packs:vector<languagePackInfo> = LocalizationTargetInfo; -//@class PremiumLimitType @description Describes type of a limit, increased for Premium users +//@class PremiumLimitType @description Describes type of limit, increased for Premium users //@description The maximum number of joined supergroups and channels premiumLimitTypeSupergroupCount = PremiumLimitType; @@ -3904,6 +5555,9 @@ premiumLimitTypeChatFolderChosenChatCount = PremiumLimitType; //@description The maximum number of pinned chats in the archive chat list premiumLimitTypePinnedArchivedChatCount = PremiumLimitType; +//@description The maximum number of pinned Saved Messages topics +premiumLimitTypePinnedSavedMessagesTopicCount = PremiumLimitType; + //@description The maximum length of sent media caption premiumLimitTypeCaptionLength = PremiumLimitType; @@ -3916,6 +5570,24 @@ premiumLimitTypeChatFolderInviteLinkCount = PremiumLimitType; //@description The maximum number of added shareable chat folders premiumLimitTypeShareableChatFolderCount = PremiumLimitType; +//@description The maximum number of active stories +premiumLimitTypeActiveStoryCount = PremiumLimitType; + +//@description The maximum number of stories sent per week +premiumLimitTypeWeeklySentStoryCount = PremiumLimitType; + +//@description The maximum number of stories sent per month +premiumLimitTypeMonthlySentStoryCount = PremiumLimitType; + +//@description The maximum length of captions of sent stories +premiumLimitTypeStoryCaptionLength = PremiumLimitType; + +//@description The maximum number of suggested reaction areas on a story +premiumLimitTypeStorySuggestedReactionAreaCount = PremiumLimitType; + +//@description The maximum number of received similar chats +premiumLimitTypeSimilarChatCount = PremiumLimitType; + //@class PremiumFeature @description Describes a feature available to Premium users @@ -3949,7 +5621,7 @@ premiumFeatureAdvancedChatManagement = PremiumFeature; //@description A badge in the user's profile premiumFeatureProfileBadge = PremiumFeature; -//@description A emoji status shown along with the user's name +//@description The ability to show an emoji status along with the user's name premiumFeatureEmojiStatus = PremiumFeature; //@description Profile photo animation on message and chat screens @@ -3964,6 +5636,94 @@ premiumFeatureAppIcons = PremiumFeature; //@description Allowed to translate chat messages real-time premiumFeatureRealTimeChatTranslation = PremiumFeature; +//@description Allowed to use many additional features for stories +premiumFeatureUpgradedStories = PremiumFeature; + +//@description The ability to boost chats +premiumFeatureChatBoost = PremiumFeature; + +//@description The ability to choose accent color for replies and user profile +premiumFeatureAccentColor = PremiumFeature; + +//@description The ability to set private chat background for both users +premiumFeatureBackgroundForBoth = PremiumFeature; + +//@description The ability to use tags in Saved Messages +premiumFeatureSavedMessagesTags = PremiumFeature; + +//@description The ability to disallow incoming voice and video note messages in private chats using setUserPrivacySettingRules with userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages +//-and to restrict incoming messages from non-contacts using setNewChatPrivacySettings +premiumFeatureMessagePrivacy = PremiumFeature; + +//@description The ability to view last seen and read times of other users even they can't view last seen or read time for the current user +premiumFeatureLastSeenTimes = PremiumFeature; + +//@description The ability to use Business features +premiumFeatureBusiness = PremiumFeature; + +//@description The ability to use all available message effects +premiumFeatureMessageEffects = PremiumFeature; + + +//@class BusinessFeature @description Describes a feature available to Business user accounts + +//@description The ability to set location +businessFeatureLocation = BusinessFeature; + +//@description The ability to set opening hours +businessFeatureOpeningHours = BusinessFeature; + +//@description The ability to use quick replies +businessFeatureQuickReplies = BusinessFeature; + +//@description The ability to set up a greeting message +businessFeatureGreetingMessage = BusinessFeature; + +//@description The ability to set up an away message +businessFeatureAwayMessage = BusinessFeature; + +//@description The ability to create links to the business account with predefined message text +businessFeatureAccountLinks = BusinessFeature; + +//@description The ability to customize start page +businessFeatureStartPage = BusinessFeature; + +//@description The ability to connect a bot to the account +businessFeatureBots = BusinessFeature; + +//@description The ability to show an emoji status along with the business name +businessFeatureEmojiStatus = BusinessFeature; + +//@description The ability to display folder names for each chat in the chat list +businessFeatureChatFolderTags = BusinessFeature; + +//@description Allowed to use many additional features for stories +businessFeatureUpgradedStories = BusinessFeature; + + +//@class PremiumStoryFeature @description Describes a story feature available to Premium users + +//@description Stories of the current user are displayed before stories of non-Premium contacts, supergroups, and channels +premiumStoryFeaturePriorityOrder = PremiumStoryFeature; + +//@description The ability to hide the fact that the user viewed other's stories +premiumStoryFeatureStealthMode = PremiumStoryFeature; + +//@description The ability to check who opened the current user's stories after they expire +premiumStoryFeaturePermanentViewsHistory = PremiumStoryFeature; + +//@description The ability to set custom expiration duration for stories +premiumStoryFeatureCustomExpirationDuration = PremiumStoryFeature; + +//@description The ability to save other's unprotected stories +premiumStoryFeatureSaveStories = PremiumStoryFeature; + +//@description The ability to use links and formatting in story caption, and use inputStoryAreaTypeLink areas +premiumStoryFeatureLinksAndFormatting = PremiumStoryFeature; + +//@description The ability to choose better quality for viewed stories +premiumStoryFeatureVideoQuality = PremiumStoryFeature; + //@description Contains information about a limit, increased for Premium users @type The type of the limit @default_value Default value of the limit @premium_value Value of the limit for Premium users premiumLimit type:PremiumLimitType default_value:int32 premium_value:int32 = PremiumLimit; @@ -3974,6 +5734,9 @@ premiumLimit type:PremiumLimitType default_value:int32 premium_value:int32 = Pre //@payment_link An internal link to be opened to pay for Telegram Premium if store payment isn't possible; may be null if direct payment isn't available premiumFeatures features:vector<PremiumFeature> limits:vector<premiumLimit> payment_link:InternalLinkType = PremiumFeatures; +//@description Contains information about features, available to Business user accounts @features The list of available business features +businessFeatures features:vector<BusinessFeature> = BusinessFeatures; + //@class PremiumSource @description Describes a source from which the Premium features screen is opened @@ -3983,6 +5746,12 @@ premiumSourceLimitExceeded limit_type:PremiumLimitType = PremiumSource; //@description A user tried to use a Premium feature @feature The used feature premiumSourceFeature feature:PremiumFeature = PremiumSource; +//@description A user tried to use a Business feature @feature The used feature; pass null if none specific feature was used +premiumSourceBusinessFeature feature:BusinessFeature = PremiumSource; + +//@description A user tried to use a Premium story feature @feature The used feature +premiumSourceStoryFeature feature:PremiumStoryFeature = PremiumSource; + //@description A user opened an internal link of the type internalLinkTypePremiumFeatures @referrer The referrer from the link premiumSourceLink referrer:string = PremiumSource; @@ -3993,21 +5762,105 @@ premiumSourceSettings = PremiumSource; //@description Describes a promotion animation for a Premium feature @feature Premium feature @animation Promotion animation for the feature premiumFeaturePromotionAnimation feature:PremiumFeature animation:animation = PremiumFeaturePromotionAnimation; +//@description Describes a promotion animation for a Business feature @feature Business feature @animation Promotion animation for the feature +businessFeaturePromotionAnimation feature:BusinessFeature animation:animation = BusinessFeaturePromotionAnimation; + //@description Contains state of Telegram Premium subscription and promotion videos for Premium features //@state Text description of the state of the current Premium subscription; may be empty if the current user has no Telegram Premium subscription //@payment_options The list of available options for buying Telegram Premium //@animations The list of available promotion animations for Premium features -premiumState state:formattedText payment_options:vector<premiumStatePaymentOption> animations:vector<premiumFeaturePromotionAnimation> = PremiumState; +//@business_animations The list of available promotion animations for Business features +premiumState state:formattedText payment_options:vector<premiumStatePaymentOption> animations:vector<premiumFeaturePromotionAnimation> business_animations:vector<businessFeaturePromotionAnimation> = PremiumState; //@class StorePaymentPurpose @description Describes a purpose of an in-store payment -//@description The user subscribed to Telegram Premium @is_restore Pass true if this is a restore of a Telegram Premium purchase; only for App Store @is_upgrade Pass true if this is an upgrade from a monthly subscription to early subscription; only for App Store +//@description The user subscribing to Telegram Premium @is_restore Pass true if this is a restore of a Telegram Premium purchase; only for App Store @is_upgrade Pass true if this is an upgrade from a monthly subscription to early subscription; only for App Store storePaymentPurposePremiumSubscription is_restore:Bool is_upgrade:Bool = StorePaymentPurpose; -//@description The user gifted Telegram Premium to another user @user_id Identifier of the user for which Premium was gifted @currency ISO 4217 currency code of the payment currency @amount Paid amount, in the smallest units of the currency +//@description The user gifting Telegram Premium to another user +//@user_id Identifier of the user to which Telegram Premium is gifted +//@currency ISO 4217 currency code of the payment currency +//@amount Paid amount, in the smallest units of the currency storePaymentPurposeGiftedPremium user_id:int53 currency:string amount:int53 = StorePaymentPurpose; +//@description The user creating Telegram Premium gift codes for other users +//@boosted_chat_id Identifier of the supergroup or channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user; 0 if none +//@currency ISO 4217 currency code of the payment currency +//@amount Paid amount, in the smallest units of the currency +//@user_ids Identifiers of the users which can activate the gift codes +storePaymentPurposePremiumGiftCodes boosted_chat_id:int53 currency:string amount:int53 user_ids:vector<int53> = StorePaymentPurpose; + +//@description The user creating a Telegram Premium giveaway +//@parameters Giveaway parameters +//@currency ISO 4217 currency code of the payment currency +//@amount Paid amount, in the smallest units of the currency +storePaymentPurposePremiumGiveaway parameters:giveawayParameters currency:string amount:int53 = StorePaymentPurpose; + +//@description The user creating a Telegram Star giveaway +//@parameters Giveaway parameters +//@currency ISO 4217 currency code of the payment currency +//@amount Paid amount, in the smallest units of the currency +//@winner_count The number of users to receive Telegram Stars +//@star_count The number of Telegram Stars to be distributed through the giveaway +storePaymentPurposeStarGiveaway parameters:giveawayParameters currency:string amount:int53 winner_count:int32 star_count:int53 = StorePaymentPurpose; + +//@description The user buying Telegram Stars +//@currency ISO 4217 currency code of the payment currency +//@amount Paid amount, in the smallest units of the currency +//@star_count Number of bought Telegram Stars +storePaymentPurposeStars currency:string amount:int53 star_count:int53 = StorePaymentPurpose; + +//@description The user buying Telegram Stars for other users +//@user_id Identifier of the user to which Telegram Stars are gifted +//@currency ISO 4217 currency code of the payment currency +//@amount Paid amount, in the smallest units of the currency +//@star_count Number of bought Telegram Stars +storePaymentPurposeGiftedStars user_id:int53 currency:string amount:int53 star_count:int53 = StorePaymentPurpose; + + +//@class TelegramPaymentPurpose @description Describes a purpose of a payment toward Telegram + +//@description The user creating Telegram Premium gift codes for other users +//@boosted_chat_id Identifier of the supergroup or channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user; 0 if none +//@currency ISO 4217 currency code of the payment currency +//@amount Paid amount, in the smallest units of the currency +//@user_ids Identifiers of the users which can activate the gift codes +//@month_count Number of months the Telegram Premium subscription will be active for the users +telegramPaymentPurposePremiumGiftCodes boosted_chat_id:int53 currency:string amount:int53 user_ids:vector<int53> month_count:int32 = TelegramPaymentPurpose; + +//@description The user creating a Telegram Premium giveaway +//@parameters Giveaway parameters +//@currency ISO 4217 currency code of the payment currency +//@amount Paid amount, in the smallest units of the currency +//@winner_count Number of users which will be able to activate the gift codes +//@month_count Number of months the Telegram Premium subscription will be active for the users +telegramPaymentPurposePremiumGiveaway parameters:giveawayParameters currency:string amount:int53 winner_count:int32 month_count:int32 = TelegramPaymentPurpose; + +//@description The user buying Telegram Stars +//@currency ISO 4217 currency code of the payment currency +//@amount Paid amount, in the smallest units of the currency +//@star_count Number of bought Telegram Stars +telegramPaymentPurposeStars currency:string amount:int53 star_count:int53 = TelegramPaymentPurpose; + +//@description The user buying Telegram Stars for other users +//@user_id Identifier of the user to which Telegram Stars are gifted +//@currency ISO 4217 currency code of the payment currency +//@amount Paid amount, in the smallest units of the currency +//@star_count Number of bought Telegram Stars +telegramPaymentPurposeGiftedStars user_id:int53 currency:string amount:int53 star_count:int53 = TelegramPaymentPurpose; + +//@description The user creating a Telegram Star giveaway +//@parameters Giveaway parameters +//@currency ISO 4217 currency code of the payment currency +//@amount Paid amount, in the smallest units of the currency +//@winner_count The number of users to receive Telegram Stars +//@star_count The number of Telegram Stars to be distributed through the giveaway +telegramPaymentPurposeStarGiveaway parameters:giveawayParameters currency:string amount:int53 winner_count:int32 star_count:int53 = TelegramPaymentPurpose; + +//@description The user joins a chat and subscribes to regular payments in Telegram Stars @invite_link Invite link to use +telegramPaymentPurposeJoinChat invite_link:string = TelegramPaymentPurpose; + //@class DeviceToken @description Represents a data needed to subscribe for push notifications through registerDevice method. //-To use specific push notification service, the correct application platform must be specified and a valid server authentication data must be uploaded at https://my.telegram.org @@ -4067,11 +5920,11 @@ backgroundFillSolid color:int32 = BackgroundFill; //@rotation_angle Clockwise rotation angle of the gradient, in degrees; 0-359. Must always be divisible by 45 backgroundFillGradient top_color:int32 bottom_color:int32 rotation_angle:int32 = BackgroundFill; -//@description Describes a freeform gradient fill of a background @colors A list of 3 or 4 colors of the freeform gradients in the RGB24 format +//@description Describes a freeform gradient fill of a background @colors A list of 3 or 4 colors of the freeform gradient in the RGB24 format backgroundFillFreeformGradient colors:vector<int32> = BackgroundFill; -//@class BackgroundType @description Describes the type of a background +//@class BackgroundType @description Describes the type of background //@description A wallpaper in JPEG format //@is_blurred True, if the wallpaper must be downscaled to fit in 450x450 square and then box-blurred with radius 12 @@ -4080,7 +5933,7 @@ backgroundTypeWallpaper is_blurred:Bool is_moving:Bool = BackgroundType; //@description A PNG or TGV (gzipped subset of SVG with MIME type "application/x-tgwallpattern") pattern to be combined with the background fill chosen by the user //@fill Fill of the background -//@intensity Intensity of the pattern when it is shown above the filled background; 0-100. +//@intensity Intensity of the pattern when it is shown above the filled background; 0-100 //@is_inverted True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only //@is_moving True, if the background needs to be slightly moved when device is tilted backgroundTypePattern fill:BackgroundFill intensity:int32 is_inverted:Bool is_moving:Bool = BackgroundType; @@ -4088,6 +5941,9 @@ backgroundTypePattern fill:BackgroundFill intensity:int32 is_inverted:Bool is_mo //@description A filled background @fill The background fill backgroundTypeFill fill:BackgroundFill = BackgroundType; +//@description A background from a chat theme; can be used only as a chat background in channels @theme_name Name of the chat theme +backgroundTypeChatTheme theme_name:string = BackgroundType; + //@class InputBackground @description Contains information about background to set @@ -4102,15 +5958,6 @@ inputBackgroundRemote background_id:int64 = InputBackground; inputBackgroundPrevious message_id:int53 = InputBackground; -//@description Describes theme settings -//@accent_color Theme accent color in ARGB format -//@background The background to be used in chats; may be null -//@outgoing_message_fill The fill to be used as a background for outgoing messages -//@animate_outgoing_message_fill If true, the freeform gradient fill needs to be animated on every sent message -//@outgoing_message_accent_color Accent color of outgoing messages in ARGB format -themeSettings accent_color:int32 background:background outgoing_message_fill:BackgroundFill animate_outgoing_message_fill:Bool outgoing_message_accent_color:int32 = ThemeSettings; - - //@description Describes a chat theme //@name Theme name //@light_settings Theme settings for a light chat theme @@ -4118,10 +5965,41 @@ themeSettings accent_color:int32 background:background outgoing_message_fill:Bac chatTheme name:string light_settings:themeSettings dark_settings:themeSettings = ChatTheme; +//@description Describes a time zone +//@id Unique time zone identifier +//@name Time zone name +//@utc_time_offset Current UTC time offset for the time zone +timeZone id:string name:string utc_time_offset:int32 = TimeZone; + +//@description Contains a list of time zones @time_zones A list of time zones +timeZones time_zones:vector<timeZone> = TimeZones; + + //@description Contains a list of hashtags @hashtags A list of hashtags hashtags hashtags:vector<string> = Hashtags; +//@class CanSendStoryResult @description Represents result of checking whether the current user can send a story in the specific chat + +//@description A story can be sent +canSendStoryResultOk = CanSendStoryResult; + +//@description The user must subscribe to Telegram Premium to be able to post stories +canSendStoryResultPremiumNeeded = CanSendStoryResult; + +//@description The chat must be boosted first by Telegram Premium subscribers to post more stories. Call getChatBoostStatus to get current boost status of the chat +canSendStoryResultBoostNeeded = CanSendStoryResult; + +//@description The limit for the number of active stories exceeded. The user can buy Telegram Premium, delete an active story, or wait for the oldest story to expire +canSendStoryResultActiveStoryLimitExceeded = CanSendStoryResult; + +//@description The weekly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time @retry_after Time left before the user can send the next story +canSendStoryResultWeeklyLimitExceeded retry_after:int32 = CanSendStoryResult; + +//@description The monthly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time @retry_after Time left before the user can send the next story +canSendStoryResultMonthlyLimitExceeded retry_after:int32 = CanSendStoryResult; + + //@class CanTransferOwnershipResult @description Represents result of checking whether the current session can be used to transfer a chat ownership to another user //@description The session can be used @@ -4148,7 +6026,7 @@ checkChatUsernameResultUsernameInvalid = CheckChatUsernameResult; //@description The username is occupied checkChatUsernameResultUsernameOccupied = CheckChatUsernameResult; -//@description The username can be purchased at fragment.com +//@description The username can be purchased at https://fragment.com. Information about the username can be received using getCollectibleItemInfo checkChatUsernameResultUsernamePurchasable = CheckChatUsernameResult; //@description The user has too many chats with username, one of them must be made private first @@ -4184,13 +6062,13 @@ resetPasswordResultDeclined retry_date:int32 = ResetPasswordResult; //@class MessageFileType @description Contains information about a file with messages exported from another app -//@description The messages was exported from a private chat @name Name of the other party; may be empty if unrecognized +//@description The messages were exported from a private chat @name Name of the other party; may be empty if unrecognized messageFileTypePrivate name:string = MessageFileType; -//@description The messages was exported from a group chat @title Title of the group chat; may be empty if unrecognized +//@description The messages were exported from a group chat @title Title of the group chat; may be empty if unrecognized messageFileTypeGroup title:string = MessageFileType; -//@description The messages was exported from a chat of unknown type +//@description The messages were exported from a chat of unknown type messageFileTypeUnknown = MessageFileType; @@ -4226,6 +6104,11 @@ pushMessageContentInvoice price:string is_pinned:Bool = PushMessageContent; //@description A message with a location @is_live True, if the location is live @is_pinned True, if the message is a pinned message with the specified content pushMessageContentLocation is_live:Bool is_pinned:Bool = PushMessageContent; +//@description A message with paid media +//@star_count Number of Telegram Stars needed to buy access to the media in the message; 0 for pinned message +//@is_pinned True, if the message is a pinned message with the specified content +pushMessageContentPaidMedia star_count:int53 is_pinned:Bool = PushMessageContent; + //@description A photo message //@photo Message content; may be null //@caption Photo caption @@ -4239,6 +6122,15 @@ pushMessageContentPhoto photo:photo caption:string is_secret:Bool is_pinned:Bool //@is_pinned True, if the message is a pinned message with the specified content pushMessageContentPoll question:string is_regular:Bool is_pinned:Bool = PushMessageContent; +//@description A message with a Telegram Premium gift code created for the user @month_count Number of months the Telegram Premium subscription will be active after code activation +pushMessageContentPremiumGiftCode month_count:int32 = PushMessageContent; + +//@description A message with a giveaway +//@winner_count Number of users which will receive giveaway prizes; 0 for pinned message +//@prize Prize of the giveaway; may be null for pinned message +//@is_pinned True, if the message is a pinned message with the specified content +pushMessageContentGiveaway winner_count:int32 prize:GiveawayPrize is_pinned:Bool = PushMessageContent; + //@description A screenshot of a message in the chat has been taken pushMessageContentScreenshotTaken = PushMessageContent; @@ -4248,6 +6140,9 @@ pushMessageContentScreenshotTaken = PushMessageContent; //@is_pinned True, if the message is a pinned message with the specified content pushMessageContentSticker sticker:sticker emoji:string is_pinned:Bool = PushMessageContent; +//@description A message with a story @is_pinned True, if the message is a pinned message with the specified content +pushMessageContentStory is_pinned:Bool = PushMessageContent; + //@description A text message @text Message text @is_pinned True, if the message is a pinned message with the specified content pushMessageContentText text:string is_pinned:Bool = PushMessageContent; @@ -4327,7 +6222,7 @@ notificationTypeNewSecretChat = NotificationType; notificationTypeNewCall call_id:int32 = NotificationType; //@description New message was received through a push notification -//@message_id The message identifier. The message will not be available in the chat history, but the ID can be used in viewMessages, or as reply_to_message_id +//@message_id The message identifier. The message will not be available in the chat history, but the identifier can be used in viewMessages, or as a message to be replied in the same chat //@sender_id Identifier of the sender of the message. Corresponding user or chat may be inaccessible //@sender_name Name of the sender //@is_outgoing True, if the message is outgoing @@ -4418,14 +6313,32 @@ jsonValueArray values:vector<JsonValue> = JsonValue; jsonValueObject members:vector<jsonObjectMember> = JsonValue; -//@class UserPrivacySettingRule @description Represents a single rule for managing privacy settings +//@class StoryPrivacySettings @description Describes privacy settings of a story + +//@description The story can be viewed by everyone @except_user_ids Identifiers of the users that can't see the story; always unknown and empty for non-owned stories +storyPrivacySettingsEveryone except_user_ids:vector<int53> = StoryPrivacySettings; + +//@description The story can be viewed by all contacts except chosen users @except_user_ids User identifiers of the contacts that can't see the story; always unknown and empty for non-owned stories +storyPrivacySettingsContacts except_user_ids:vector<int53> = StoryPrivacySettings; + +//@description The story can be viewed by all close friends +storyPrivacySettingsCloseFriends = StoryPrivacySettings; + +//@description The story can be viewed by certain specified users @user_ids Identifiers of the users; always unknown and empty for non-owned stories +storyPrivacySettingsSelectedUsers user_ids:vector<int53> = StoryPrivacySettings; + + +//@class UserPrivacySettingRule @description Represents a single rule for managing user privacy settings //@description A rule to allow all users to do something userPrivacySettingRuleAllowAll = UserPrivacySettingRule; -//@description A rule to allow all of a user's contacts to do something +//@description A rule to allow all contacts of the user to do something userPrivacySettingRuleAllowContacts = UserPrivacySettingRule; +//@description A rule to allow all Premium Users to do something; currently, allowed only for userPrivacySettingAllowChatInvites +userPrivacySettingRuleAllowPremiumUsers = UserPrivacySettingRule; + //@description A rule to allow certain specified users to do something @user_ids The user identifiers, total number of users in all rules must not exceed 1000 userPrivacySettingRuleAllowUsers user_ids:vector<int53> = UserPrivacySettingRule; @@ -4435,7 +6348,7 @@ userPrivacySettingRuleAllowChatMembers chat_ids:vector<int53> = UserPrivacySetti //@description A rule to restrict all users from doing something userPrivacySettingRuleRestrictAll = UserPrivacySettingRule; -//@description A rule to restrict all contacts of a user from doing something +//@description A rule to restrict all contacts of the user from doing something userPrivacySettingRuleRestrictContacts = UserPrivacySettingRule; //@description A rule to restrict all specified users from doing something @user_ids The user identifiers, total number of users in all rules must not exceed 1000 @@ -4447,6 +6360,7 @@ userPrivacySettingRuleRestrictChatMembers chat_ids:vector<int53> = UserPrivacySe //@description A list of privacy rules. Rules are matched in the specified order. The first matched rule defines the privacy setting for a given user. If no rule matches, the action is not allowed @rules A list of rules userPrivacySettingRules rules:vector<UserPrivacySettingRule> = UserPrivacySettingRules; + //@class UserPrivacySetting @description Describes available user privacy settings //@description A privacy setting for managing whether the user's online status is visible @@ -4461,6 +6375,12 @@ userPrivacySettingShowLinkInForwardedMessages = UserPrivacySetting; //@description A privacy setting for managing whether the user's phone number is visible userPrivacySettingShowPhoneNumber = UserPrivacySetting; +//@description A privacy setting for managing whether the user's bio is visible +userPrivacySettingShowBio = UserPrivacySetting; + +//@description A privacy setting for managing whether the user's birthdate is visible +userPrivacySettingShowBirthdate = UserPrivacySetting; + //@description A privacy setting for managing whether the user can be invited to chats userPrivacySettingAllowChatInvites = UserPrivacySetting; @@ -4473,11 +6393,32 @@ userPrivacySettingAllowPeerToPeerCalls = UserPrivacySetting; //@description A privacy setting for managing whether the user can be found by their phone number. Checked only if the phone number is not known to the other user. Can be set only to "Allow contacts" or "Allow all" userPrivacySettingAllowFindingByPhoneNumber = UserPrivacySetting; -//@description A privacy setting for managing whether the user can receive voice and video messages in private chats +//@description A privacy setting for managing whether the user can receive voice and video messages in private chats; for Telegram Premium users only userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages = UserPrivacySetting; -//@description Contains information about the period of inactivity after which the current user's account will automatically be deleted @days Number of days of inactivity before the account will be flagged for deletion; 30-366 days +//@description Contains privacy settings for message read date in private chats. Read dates are always shown to the users that can see online status of the current user regardless of this setting +//@show_read_date True, if message read date is shown to other users in private chats. If false and the current user isn't a Telegram Premium user, then they will not be able to see other's message read date +readDatePrivacySettings show_read_date:Bool = ReadDatePrivacySettings; + +//@description Contains privacy settings for new chats with non-contacts +//@allow_new_chats_from_unknown_users True, if non-contacts users are able to write first to the current user. Telegram Premium subscribers are able to write first regardless of this setting +newChatPrivacySettings allow_new_chats_from_unknown_users:Bool = NewChatPrivacySettings; + + +//@class CanSendMessageToUserResult @description Describes result of canSendMessageToUser + +//@description The user can be messaged +canSendMessageToUserResultOk = CanSendMessageToUserResult; + +//@description The user can't be messaged, because they are deleted or unknown +canSendMessageToUserResultUserIsDeleted = CanSendMessageToUserResult; + +//@description The user can't be messaged, because they restrict new chats with non-contacts +canSendMessageToUserResultUserRestrictsNewChats = CanSendMessageToUserResult; + + +//@description Contains information about the period of inactivity after which the current user's account will automatically be deleted @days Number of days of inactivity before the account will be flagged for deletion; 30-730 days accountTtl days:int32 = AccountTtl; @@ -4485,7 +6426,7 @@ accountTtl days:int32 = AccountTtl; messageAutoDeleteTime time:int32 = MessageAutoDeleteTime; -//@class SessionType @description Represents the type of a session +//@class SessionType @description Represents the type of session //@description The session is running on an Android device sessionTypeAndroid = SessionType; @@ -4543,6 +6484,7 @@ sessionTypeXbox = SessionType; //@id Session identifier //@is_current True, if this session is the current session //@is_password_pending True, if a 2-step verification password is needed to complete authorization of the session +//@is_unconfirmed True, if the session wasn't confirmed from another session //@can_accept_secret_chats True, if incoming secret chats can be accepted by the session //@can_accept_calls True, if incoming calls can be accepted by the session //@type Session type based on the system and application version, which can be used to display a corresponding icon @@ -4555,14 +6497,20 @@ sessionTypeXbox = SessionType; //@system_version Version of the operating system the application has been run or is running on, as provided by the application //@log_in_date Point in time (Unix timestamp) when the user has logged in //@last_active_date Point in time (Unix timestamp) when the session was last used -//@ip IP address from which the session was created, in human-readable format -//@country A two-letter country code for the country from which the session was created, based on the IP address -//@region Region code from which the session was created, based on the IP address -session id:int64 is_current:Bool is_password_pending:Bool can_accept_secret_chats:Bool can_accept_calls:Bool type:SessionType api_id:int32 application_name:string application_version:string is_official_application:Bool device_model:string platform:string system_version:string log_in_date:int32 last_active_date:int32 ip:string country:string region:string = Session; +//@ip_address IP address from which the session was created, in human-readable format +//@location A human-readable description of the location from which the session was created, based on the IP address +session id:int64 is_current:Bool is_password_pending:Bool is_unconfirmed:Bool can_accept_secret_chats:Bool can_accept_calls:Bool type:SessionType api_id:int32 application_name:string application_version:string is_official_application:Bool device_model:string platform:string system_version:string log_in_date:int32 last_active_date:int32 ip_address:string location:string = Session; //@description Contains a list of sessions @sessions List of sessions @inactive_session_ttl_days Number of days of inactivity before sessions will automatically be terminated; 1-366 days sessions sessions:vector<session> inactive_session_ttl_days:int32 = Sessions; +//@description Contains information about an unconfirmed session +//@id Session identifier +//@log_in_date Point in time (Unix timestamp) when the user has logged in +//@device_model Model of the device that was used for the session creation, as provided by the application +//@location A human-readable description of the location from which the session was created, based on the IP address +unconfirmedSession id:int64 log_in_date:int32 device_model:string location:string = UnconfirmedSession; + //@description Contains information about one website the current user is logged in with Telegram //@id Website identifier @@ -4572,45 +6520,45 @@ sessions sessions:vector<session> inactive_session_ttl_days:int32 = Sessions; //@platform Operating system the browser is running on //@log_in_date Point in time (Unix timestamp) when the user was logged in //@last_active_date Point in time (Unix timestamp) when obtained authorization was last used -//@ip IP address from which the user was logged in, in human-readable format +//@ip_address IP address from which the user was logged in, in human-readable format //@location Human-readable description of a country and a region from which the user was logged in, based on the IP address -connectedWebsite id:int64 domain_name:string bot_user_id:int53 browser:string platform:string log_in_date:int32 last_active_date:int32 ip:string location:string = ConnectedWebsite; +connectedWebsite id:int64 domain_name:string bot_user_id:int53 browser:string platform:string log_in_date:int32 last_active_date:int32 ip_address:string location:string = ConnectedWebsite; //@description Contains a list of websites the current user is logged in with Telegram @websites List of connected websites connectedWebsites websites:vector<connectedWebsite> = ConnectedWebsites; -//@class ChatReportReason @description Describes the reason why a chat is reported +//@class ReportReason @description Describes the reason why a chat is reported //@description The chat contains spam messages -chatReportReasonSpam = ChatReportReason; +reportReasonSpam = ReportReason; //@description The chat promotes violence -chatReportReasonViolence = ChatReportReason; +reportReasonViolence = ReportReason; //@description The chat contains pornographic messages -chatReportReasonPornography = ChatReportReason; +reportReasonPornography = ReportReason; //@description The chat has child abuse related content -chatReportReasonChildAbuse = ChatReportReason; +reportReasonChildAbuse = ReportReason; //@description The chat contains copyrighted content -chatReportReasonCopyright = ChatReportReason; +reportReasonCopyright = ReportReason; //@description The location-based chat is unrelated to its stated location -chatReportReasonUnrelatedLocation = ChatReportReason; +reportReasonUnrelatedLocation = ReportReason; //@description The chat represents a fake account -chatReportReasonFake = ChatReportReason; +reportReasonFake = ReportReason; //@description The chat has illegal drugs related content -chatReportReasonIllegalDrugs = ChatReportReason; +reportReasonIllegalDrugs = ReportReason; //@description The chat contains messages with personal details -chatReportReasonPersonalDetails = ChatReportReason; +reportReasonPersonalDetails = ReportReason; //@description A custom reason provided by the user -chatReportReasonCustom = ChatReportReason; +reportReasonCustom = ReportReason; //@class TargetChat @description Describes the target chat to be opened @@ -4631,12 +6579,13 @@ targetChatInternalLink link:InternalLinkType = TargetChat; //@class InternalLinkType @description Describes an internal https://t.me or tg: link, which must be processed by the application in a special way -//@description The link is a link to the active sessions section of the application. Use getActiveSessions to handle the link +//@description The link is a link to the Devices section of the application. Use getActiveSessions to get the list of active sessions and show them to the user internalLinkTypeActiveSessions = InternalLinkType; //@description The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat. //-Then, call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. -//-If the bot isn't added to attachment menu, then user needs to confirm adding the bot to attachment menu. If user confirms adding, then use toggleBotIsAddedToAttachmentMenu to add it. +//-If the bot isn't added to attachment menu, then show a disclaimer about Mini Apps being third-party applications, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. +//-If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. //-If the attachment menu bot can't be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL //@target_chat Target chat to be opened //@bot_username Username of the bot @@ -4646,7 +6595,9 @@ internalLinkTypeAttachmentMenuBot target_chat:TargetChat bot_username:string url //@description The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode @code The authentication code internalLinkTypeAuthenticationCode code:string = InternalLinkType; -//@description The link is a link to a background. Call searchBackground with the given background name to process the link @background_name Name of the background +//@description The link is a link to a background. Call searchBackground with the given background name to process the link. +//-If background is found and the user wants to apply it, then call setDefaultBackground +//@background_name Name of the background internalLinkTypeBackground background_name:string = InternalLinkType; //@description The link is a link to a Telegram bot, which is supposed to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot, @@ -4668,48 +6619,86 @@ internalLinkTypeBotStart bot_username:string start_parameter:string autostart:Bo //-If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, //-check that the current user can edit its administrator rights, combine received rights with the requested administrator rights, show confirmation box to the user, //-and call setChatMemberStatus with the chosen chat and confirmed administrator rights. Before call to setChatMemberStatus it may be required to upgrade the chosen basic group chat to a supergroup chat. -//-Then, if start_parameter isn't empty, call sendBotStartMessage with the given start parameter and the chosen chat; otherwise, just send /start message with bot's username added to the chat. +//-Then, if start_parameter isn't empty, call sendBotStartMessage with the given start parameter and the chosen chat; otherwise, just send /start message with bot's username added to the chat //@bot_username Username of the bot //@start_parameter The parameter to be passed to sendBotStartMessage //@administrator_rights Expected administrator rights for the bot; may be null internalLinkTypeBotStartInGroup bot_username:string start_parameter:string administrator_rights:chatAdministratorRights = InternalLinkType; -//@description The link is a link to the change phone number section of the app +//@description The link is a link to a business chat. Use getBusinessChatLinkInfo with the provided link name to get information about the link, +//-then open received private chat and replace chat draft with the provided text +//@link_name Name of the link +internalLinkTypeBusinessChat link_name:string = InternalLinkType; + +//@description The link is a link to the Telegram Star purchase section of the application +//@star_count The number of Telegram Stars that must be owned by the user +//@purpose Purpose of Telegram Star purchase. Arbitrary string specified by the server, for example, "subs" if the Telegram Stars are required to extend channel subscriptions +internalLinkTypeBuyStars star_count:int53 purpose:string = InternalLinkType; + +//@description The link is a link to the change phone number section of the application internalLinkTypeChangePhoneNumber = InternalLinkType; -//@description The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link @invite_link Internal representation of the invite link +//@description The link is a link to boost a Telegram chat. Call getChatBoostLinkInfo with the given URL to process the link. +//-If the chat is found, then call getChatBoostStatus and getAvailableChatBoostSlots to get the current boost status and check whether the chat can be boosted. +//-If the user wants to boost the chat and the chat can be boosted, then call boostChat +//@url URL to be passed to getChatBoostLinkInfo +internalLinkTypeChatBoost url:string = InternalLinkType; + +//@description The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link. +//-If the link is valid and the user wants to join the chat folder, then call addChatFolderByInviteLink +//@invite_link Internal representation of the invite link internalLinkTypeChatFolderInvite invite_link:string = InternalLinkType; -//@description The link is a link to the folder section of the app settings +//@description The link is a link to the folder section of the application settings internalLinkTypeChatFolderSettings = InternalLinkType; -//@description The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link @invite_link Internal representation of the invite link +//@description The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link. +//-If the link is valid and the user wants to join the chat, then call joinChatByInviteLink +//@invite_link Internal representation of the invite link internalLinkTypeChatInvite invite_link:string = InternalLinkType; -//@description The link is a link to the default message auto-delete timer settings section of the app settings +//@description The link is a link to the default message auto-delete timer settings section of the application settings internalLinkTypeDefaultMessageAutoDeleteTimerSettings = InternalLinkType; -//@description The link is a link to the edit profile section of the app settings +//@description The link is a link to the edit profile section of the application settings internalLinkTypeEditProfileSettings = InternalLinkType; -//@description The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame +//@description The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, +//-ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame //@bot_username Username of the bot that owns the game //@game_short_name Short name of the game internalLinkTypeGame bot_username:string game_short_name:string = InternalLinkType; -//@description The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link @url URL to be passed to getWebPageInstantView @fallback_url An URL to open if getWebPageInstantView fails +//@description The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link. +//-If Instant View is found, then show it, otherwise, open the fallback URL in an external browser +//@url URL to be passed to getWebPageInstantView +//@fallback_url An URL to open if getWebPageInstantView fails internalLinkTypeInstantView url:string fallback_url:string = InternalLinkType; //@description The link is a link to an invoice. Call getPaymentForm with the given invoice name to process the link @invoice_name Name of the invoice internalLinkTypeInvoice invoice_name:string = InternalLinkType; -//@description The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link @language_pack_id Language pack identifier +//@description The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link. +//-If the language pack is found and the user wants to apply it, then call setOption for the option "language_pack_id" +//@language_pack_id Language pack identifier internalLinkTypeLanguagePack language_pack_id:string = InternalLinkType; -//@description The link is a link to the language section of the app settings +//@description The link is a link to the language section of the application settings internalLinkTypeLanguageSettings = InternalLinkType; -//@description The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link @url URL to be passed to getMessageLinkInfo +//@description The link is a link to the main Web App of a bot. Call searchPublicChat with the given bot username, check that the user is a bot and has the main Web App. +//-If the bot can be added to attachment menu, then use getAttachmentMenuBot to receive information about the bot, then if the bot isn't added to side menu, +//-show a disclaimer about Mini Apps being third-party applications, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu, +//-then if the user accepts the terms and confirms adding, use toggleBotIsAddedToAttachmentMenu to add the bot. +//-Then, use getMainWebApp with the given start parameter and open the returned URL as a Web App +//@bot_username Username of the bot +//@start_parameter Start parameter to be passed to getMainWebApp +//@is_compact True, if the Web App must be opened in the compact mode instead of the full-size mode +internalLinkTypeMainWebApp bot_username:string start_parameter:string is_compact:Bool = InternalLinkType; + +//@description The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link, +//-and then open received forum topic or chat and show the message there +//@url URL to be passed to getMessageLinkInfo internalLinkTypeMessage url:string = InternalLinkType; //@description The link contains a message draft text. A share screen needs to be shown to the user, then the chosen chat must be opened and the text is added to the input field @@ -4718,7 +6707,7 @@ internalLinkTypeMessage url:string = InternalLinkType; internalLinkTypeMessageDraft text:formattedText contains_link:Bool = InternalLinkType; //@description The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the application; otherwise, ignore it -//@bot_user_id User identifier of the service's bot +//@bot_user_id User identifier of the service's bot; the corresponding user may be unknown yet //@scope Telegram Passport element types requested by the service //@public_key Service's public key //@nonce Unique request identifier provided by the service @@ -4726,25 +6715,40 @@ internalLinkTypeMessageDraft text:formattedText contains_link:Bool = InternalLin //-If empty, then onActivityResult method must be used to return response on Android, or the link tgbot{bot_user_id}://passport/success or tgbot{bot_user_id}://passport/cancel must be opened otherwise internalLinkTypePassportDataRequest bot_user_id:int53 scope:string public_key:string nonce:string callback_url:string = InternalLinkType; -//@description The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberConfirmationCode with the given hash and phone number to process the link +//@description The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberCode with the given phone number and with phoneNumberCodeTypeConfirmOwnership with the given hash to process the link. +//-If succeeded, call checkPhoneNumberCode to check entered by the user code, or resendPhoneNumberCode to resend it //@hash Hash value from the link //@phone_number Phone number value from the link internalLinkTypePhoneNumberConfirmation hash:string phone_number:string = InternalLinkType; -//@description The link is a link to the Premium features screen of the application from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link @referrer Referrer specified in the link +//@description The link is a link to the Premium features screen of the application from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link +//@referrer Referrer specified in the link internalLinkTypePremiumFeatures referrer:string = InternalLinkType; -//@description The link is a link to the privacy and security section of the app settings +//@description The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram payments or in-store purchases @referrer Referrer specified in the link +internalLinkTypePremiumGift referrer:string = InternalLinkType; + +//@description The link is a link with a Telegram Premium gift code. Call checkPremiumGiftCode with the given code to process the link. +//-If the code is valid and the user wants to apply it, then call applyPremiumGiftCode +//@code The Telegram Premium gift code +internalLinkTypePremiumGiftCode code:string = InternalLinkType; + +//@description The link is a link to the privacy and security section of the application settings internalLinkTypePrivacyAndSecuritySettings = InternalLinkType; //@description The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy -//@server Proxy server IP address +//@server Proxy server domain or IP address //@port Proxy server port //@type Type of the proxy internalLinkTypeProxy server:string port:int32 type:ProxyType = InternalLinkType; -//@description The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link @chat_username Username of the chat -internalLinkTypePublicChat chat_username:string = InternalLinkType; +//@description The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link. +//-If the chat is found, open its profile information screen or the chat itself. +//-If draft text isn't empty and the chat is a private chat with a regular user, then put the draft text in the input field +//@chat_username Username of the chat +//@draft_text Draft text for message to send in the chat +//@open_profile True, if chat profile information screen must be opened; otherwise, the chat itself must be opened +internalLinkTypePublicChat chat_username:string draft_text:string open_profile:Bool = InternalLinkType; //@description The link can be used to login the current user on another device, but it must be scanned from QR-code using in-app camera. An alert similar to //-"This code can be used to allow someone to log in to your Telegram account. To confirm Telegram login, please go to Settings > Devices > Scan QR and scan the code" needs to be shown @@ -4756,15 +6760,21 @@ internalLinkTypeRestorePurchases = InternalLinkType; //@description The link is a link to application settings internalLinkTypeSettings = InternalLinkType; -//@description The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set +//@description The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set. +//-If the sticker set is found and the user wants to add it, then call changeStickerSet //@sticker_set_name Name of the sticker set //@expect_custom_emoji True, if the sticker set is expected to contain custom emoji internalLinkTypeStickerSet sticker_set_name:string expect_custom_emoji:Bool = InternalLinkType; -//@description The link is a link to a theme. TDLib has no theme support yet @theme_name Name of the theme +//@description The link is a link to a story. Call searchPublicChat with the given sender username, then call getStory with the received chat identifier and the given story identifier, then show the story if received +//@story_sender_username Username of the sender of the story +//@story_id Story identifier +internalLinkTypeStory story_sender_username:string story_id:int32 = InternalLinkType; + +//@description The link is a link to a cloud theme. TDLib has no theme support yet @theme_name Name of the theme internalLinkTypeTheme theme_name:string = InternalLinkType; -//@description The link is a link to the theme section of the app settings +//@description The link is a link to the theme section of the application settings internalLinkTypeThemeSettings = InternalLinkType; //@description The link is an unknown tg: link. Call getDeepLinkInfo to process the link @link Link to be passed to getDeepLinkInfo @@ -4773,10 +6783,16 @@ internalLinkTypeUnknownDeepLink link:string = InternalLinkType; //@description The link is a link to an unsupported proxy. An alert can be shown to the user internalLinkTypeUnsupportedProxy = InternalLinkType; -//@description The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link @phone_number Phone number of the user -internalLinkTypeUserPhoneNumber phone_number:string = InternalLinkType; +//@description The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link. +//-If the user is found, then call createPrivateChat and open user's profile information screen or the chat itself. If draft text isn't empty, then put the draft text in the input field +//@phone_number Phone number of the user +//@draft_text Draft text for message to send in the chat +//@open_profile True, if user's profile information screen must be opened; otherwise, the chat itself must be opened +internalLinkTypeUserPhoneNumber phone_number:string draft_text:string open_profile:Bool = InternalLinkType; -//@description The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link @token The token +//@description The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link. +//-If the user is found, then call createPrivateChat and open the chat +//@token The token internalLinkTypeUserToken token:string = InternalLinkType; //@description The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGroupCall with the given invite hash to process the link @@ -4786,11 +6802,14 @@ internalLinkTypeUserToken token:string = InternalLinkType; internalLinkTypeVideoChat chat_username:string invite_hash:string is_live_stream:Bool = InternalLinkType; //@description The link is a link to a Web App. Call searchPublicChat with the given bot username, check that the user is a bot, then call searchWebApp with the received bot and the given web_app_short_name. -//-Process received foundWebApp by showing a confirmation dialog if needed, then calling getWebAppLinkUrl and opening the returned URL +//-Process received foundWebApp by showing a confirmation dialog if needed. If the bot can be added to attachment or side menu, but isn't added yet, then show a disclaimer about Mini Apps being third-party applications +//-instead of the dialog and ask the user to accept their Terms of service. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. +//-Then, call getWebAppLinkUrl and open the returned URL as a Web App //@bot_username Username of the bot that owns the Web App //@web_app_short_name Short name of the Web App //@start_parameter Start parameter to be passed to getWebAppLinkUrl -internalLinkTypeWebApp bot_username:string web_app_short_name:string start_parameter:string = InternalLinkType; +//@is_compact True, if the Web App must be opened in the compact mode instead of the full-size mode +internalLinkTypeWebApp bot_username:string web_app_short_name:string start_parameter:string is_compact:Bool = InternalLinkType; //@description Contains an HTTPS link to a message in a supergroup or channel, or a forum topic @link The link @is_public True, if the link will work for non-members of the chat @@ -4801,16 +6820,34 @@ messageLink link:string is_public:Bool = MessageLink; //@chat_id If found, identifier of the chat to which the link points, 0 otherwise //@message_thread_id If found, identifier of the message thread in which to open the message, or a forum topic to open if the message is missing //@message If found, the linked message; may be null -//@media_timestamp Timestamp from which the video/audio/video note/voice note playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview +//@media_timestamp Timestamp from which the video/audio/video note/voice note/story playing must start, in seconds; 0 if not specified. The media can be in the message content or in its link preview //@for_album True, if the whole media album to which the message belongs is linked messageLinkInfo is_public:Bool chat_id:int53 message_thread_id:int53 message:message media_timestamp:int32 for_album:Bool = MessageLinkInfo; +//@description Contains an HTTPS link to boost a chat @link The link @is_public True, if the link will work for non-members of the chat +chatBoostLink link:string is_public:Bool = ChatBoostLink; + +//@description Contains information about a link to boost a chat +//@is_public True, if the link will work for non-members of the chat +//@chat_id Identifier of the chat to which the link points; 0 if the chat isn't found +chatBoostLinkInfo is_public:Bool chat_id:int53 = ChatBoostLinkInfo; + + +//@class BlockList @description Describes type of block list + +//@description The main block list that disallows writing messages to the current user, receiving their status and photo, viewing of stories, and some other actions +blockListMain = BlockList; + +//@description The block list that disallows viewing of stories of the current user +blockListStories = BlockList; + + //@description Contains a part of a file @data File bytes filePart data:bytes = FilePart; -//@class FileType @description Represents the type of a file +//@class FileType @description Represents the type of file //@description The data is not a file fileTypeNone = FileType; @@ -4830,6 +6867,9 @@ fileTypeNotificationSound = FileType; //@description The file is a photo fileTypePhoto = FileType; +//@description The file is a photo published as a story +fileTypePhotoStory = FileType; + //@description The file is a profile photo fileTypeProfilePhoto = FileType; @@ -4857,6 +6897,9 @@ fileTypeVideo = FileType; //@description The file is a video note fileTypeVideoNote = FileType; +//@description The file is a video published as a story +fileTypeVideoStory = FileType; + //@description The file is a voice note fileTypeVoiceNote = FileType; @@ -4896,7 +6939,7 @@ storageStatisticsFast files_size:int53 file_count:int32 database_size:int53 lang databaseStatistics statistics:string = DatabaseStatistics; -//@class NetworkType @description Represents the type of a network +//@class NetworkType @description Represents the type of network //@description The network is not available networkTypeNone = NetworkType; @@ -4942,8 +6985,9 @@ networkStatistics since_date:int32 entries:vector<NetworkStatisticsEntry> = Netw //@video_upload_bitrate The maximum suggested bitrate for uploaded videos, in kbit/s //@preload_large_videos True, if the beginning of video files needs to be preloaded for instant playback //@preload_next_audio True, if the next audio track needs to be preloaded while the user is listening to an audio file +//@preload_stories True, if stories needs to be preloaded //@use_less_data_for_calls True, if "use less data for calls" option needs to be enabled -autoDownloadSettings is_auto_download_enabled:Bool max_photo_file_size:int32 max_video_file_size:int53 max_other_file_size:int53 video_upload_bitrate:int32 preload_large_videos:Bool preload_next_audio:Bool use_less_data_for_calls:Bool = AutoDownloadSettings; +autoDownloadSettings is_auto_download_enabled:Bool max_photo_file_size:int32 max_video_file_size:int53 max_other_file_size:int53 video_upload_bitrate:int32 preload_large_videos:Bool preload_next_audio:Bool preload_stories:Bool use_less_data_for_calls:Bool = AutoDownloadSettings; //@description Contains auto-download settings presets for the current user //@low Preset with lowest settings; supposed to be used by default when roaming @@ -4988,16 +7032,16 @@ autosaveSettings private_chat_settings:scopeAutosaveSettings group_settings:scop //@class ConnectionState @description Describes the current state of the connection to Telegram servers -//@description Currently waiting for the network to become available. Use setNetworkType to change the available network type +//@description Waiting for the network to become available. Use setNetworkType to change the available network type connectionStateWaitingForNetwork = ConnectionState; -//@description Currently establishing a connection with a proxy server +//@description Establishing a connection with a proxy server connectionStateConnectingToProxy = ConnectionState; -//@description Currently establishing a connection to the Telegram servers +//@description Establishing a connection to the Telegram servers connectionStateConnecting = ConnectionState; -//@description Downloading data received while the application was offline +//@description Downloading data supposed to be received while the application was offline connectionStateUpdating = ConnectionState; //@description There is a working connection to the Telegram servers @@ -5021,6 +7065,9 @@ topChatCategoryChannels = TopChatCategory; //@description A category containing frequently used chats with inline bots sorted by their usage in inline mode topChatCategoryInlineBots = TopChatCategory; +//@description A category containing frequently used chats with bots, which Web Apps were opened +topChatCategoryWebAppBots = TopChatCategory; + //@description A category containing frequently used chats used for calls topChatCategoryCalls = TopChatCategory; @@ -5028,7 +7075,14 @@ topChatCategoryCalls = TopChatCategory; topChatCategoryForwardChats = TopChatCategory; -//@class TMeUrlType @description Describes the type of a URL linking to an internal Telegram entity +//@description Contains 0-based match position @position The position of the match +foundPosition position:int32 = FoundPosition; + +//@description Contains 0-based positions of matched objects @total_count Total number of matched objects @positions The positions of the matched objects +foundPositions total_count:int32 positions:vector<int32> = FoundPositions; + + +//@class TMeUrlType @description Describes the type of URL linking to an internal Telegram entity //@description A URL linking to a user @user_id Identifier of the user tMeUrlTypeUser user_id:int53 = TMeUrlType; @@ -5051,7 +7105,7 @@ tMeUrls urls:vector<tMeUrl> = TMeUrls; //@class SuggestedAction @description Describes an action suggested to the current user -//@description Suggests the user to enable "archive_and_mute_new_chats_from_unknown_users" option +//@description Suggests the user to enable archive_and_mute_new_chats_from_unknown_users setting in archiveChatListSettings suggestedActionEnableArchiveAndMuteNewChats = SuggestedAction; //@description Suggests the user to check whether they still remember their 2-step verification password @@ -5073,9 +7127,25 @@ suggestedActionSetPassword authorization_delay:int32 = SuggestedAction; //@description Suggests the user to upgrade the Premium subscription from monthly payments to annual payments suggestedActionUpgradePremium = SuggestedAction; +//@description Suggests the user to restore a recently expired Premium subscription +suggestedActionRestorePremium = SuggestedAction; + //@description Suggests the user to subscribe to the Premium subscription with annual payments suggestedActionSubscribeToAnnualPremium = SuggestedAction; +//@description Suggests the user to gift Telegram Premium to friends for Christmas +suggestedActionGiftPremiumForChristmas = SuggestedAction; + +//@description Suggests the user to set birthdate +suggestedActionSetBirthdate = SuggestedAction; + +//@description Suggests the user to extend their expiring Telegram Premium subscription @manage_premium_subscription_url A URL for managing Telegram Premium subscription +suggestedActionExtendPremium manage_premium_subscription_url:string = SuggestedAction; + +//@description Suggests the user to extend their expiring Telegram Star subscriptions. Call getStarSubscriptions with only_expiring == true +//-to get the number of expiring subscriptions and the number of required to buy Telegram Stars +suggestedActionExtendStarSubscriptions = SuggestedAction; + //@description Contains a counter @count Count count count:int32 = Count; @@ -5104,7 +7174,7 @@ textParseModeMarkdown version:int32 = TextParseMode; textParseModeHTML = TextParseMode; -//@class ProxyType @description Describes the type of a proxy server +//@class ProxyType @description Describes the type of proxy server //@description A SOCKS5 proxy server @username Username for logging in; may be empty @password Password for logging in; may be empty proxyTypeSocks5 username:string password:string = ProxyType; @@ -5118,7 +7188,7 @@ proxyTypeMtproto secret:string = ProxyType; //@description Contains information about a proxy server //@id Unique identifier of the proxy -//@server Proxy server IP address +//@server Proxy server domain or IP address //@port Proxy server port //@last_used_date Point in time (Unix timestamp) when the proxy was last used; 0 if never //@is_enabled True, if the proxy is enabled now @@ -5132,10 +7202,11 @@ proxies proxies:vector<proxy> = Proxies; //@description A sticker to be added to a sticker set //@sticker File with the sticker; must fit in a 512x512 square. For WEBP stickers the file must be in WEBP or PNG format, which will be converted to WEBP server-side. //-See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements +//@format Format of the sticker //@emojis String with 1-20 emoji corresponding to the sticker //@mask_position Position where the mask is placed; pass null if not specified //@keywords List of up to 20 keywords with total length up to 64 characters, which can be used to find the sticker -inputSticker sticker:InputFile emojis:string mask_position:maskPosition keywords:vector<string> = InputSticker; +inputSticker sticker:InputFile format:StickerFormat emojis:string mask_position:maskPosition keywords:vector<string> = InputSticker; //@description Represents a date range @start_date Point in time (Unix timestamp) at which the date range begins @end_date Point in time (Unix timestamp) at which the date range ends @@ -5158,11 +7229,21 @@ statisticalGraphAsync token:string = StatisticalGraph; statisticalGraphError error_message:string = StatisticalGraph; -//@description Contains statistics about interactions with a message -//@message_id Message identifier -//@view_count Number of times the message was viewed -//@forward_count Number of times the message was forwarded -chatStatisticsMessageInteractionInfo message_id:int53 view_count:int32 forward_count:int32 = ChatStatisticsMessageInteractionInfo; +//@class ChatStatisticsObjectType @description Describes type of object, for which statistics are provided + +//@description Describes a message sent in the chat @message_id Message identifier +chatStatisticsObjectTypeMessage message_id:int53 = ChatStatisticsObjectType; + +//@description Describes a story sent by the chat @story_id Story identifier +chatStatisticsObjectTypeStory story_id:int32 = ChatStatisticsObjectType; + + +//@description Contains statistics about interactions with a message sent in the chat or a story sent by the chat +//@object_type Type of the object +//@view_count Number of times the object was viewed +//@forward_count Number of times the object was forwarded +//@reaction_count Number of times reactions were added to the object +chatStatisticsInteractionInfo object_type:ChatStatisticsObjectType view_count:int32 forward_count:int32 reaction_count:int32 = ChatStatisticsInteractionInfo; //@description Contains statistics about messages sent by a user //@user_id User identifier @@ -5207,9 +7288,13 @@ chatStatisticsSupergroup period:dateRange member_count:statisticalValue message_ //@description A detailed statistics about a channel chat //@period A period to which the statistics applies //@member_count Number of members in the chat -//@mean_view_count Mean number of times the recently sent messages was viewed -//@mean_share_count Mean number of times the recently sent messages was shared -//@enabled_notifications_percentage A percentage of users with enabled notifications for the chat +//@mean_message_view_count Mean number of times the recently sent messages were viewed +//@mean_message_share_count Mean number of times the recently sent messages were shared +//@mean_message_reaction_count Mean number of times reactions were added to the recently sent messages +//@mean_story_view_count Mean number of times the recently sent stories were viewed +//@mean_story_share_count Mean number of times the recently sent stories were shared +//@mean_story_reaction_count Mean number of times reactions were added to the recently sent stories +//@enabled_notifications_percentage A percentage of users with enabled notifications for the chat; 0-100 //@member_count_graph A graph containing number of members in the chat //@join_graph A graph containing number of members joined and left the chat //@mute_graph A graph containing number of members muted and unmuted the chat @@ -5218,13 +7303,95 @@ chatStatisticsSupergroup period:dateRange member_count:statisticalValue message_ //@join_by_source_graph A graph containing number of new member joins per source //@language_graph A graph containing number of users viewed chat messages per language //@message_interaction_graph A graph containing number of chat message views and shares +//@message_reaction_graph A graph containing number of reactions on messages +//@story_interaction_graph A graph containing number of story views and shares +//@story_reaction_graph A graph containing number of reactions on stories //@instant_view_interaction_graph A graph containing number of views of associated with the chat instant views -//@recent_message_interactions Detailed statistics about number of views and shares of recently sent messages -chatStatisticsChannel period:dateRange member_count:statisticalValue mean_view_count:statisticalValue mean_share_count:statisticalValue enabled_notifications_percentage:double member_count_graph:StatisticalGraph join_graph:StatisticalGraph mute_graph:StatisticalGraph view_count_by_hour_graph:StatisticalGraph view_count_by_source_graph:StatisticalGraph join_by_source_graph:StatisticalGraph language_graph:StatisticalGraph message_interaction_graph:StatisticalGraph instant_view_interaction_graph:StatisticalGraph recent_message_interactions:vector<chatStatisticsMessageInteractionInfo> = ChatStatistics; +//@recent_interactions Detailed statistics about number of views and shares of recently sent messages and stories +chatStatisticsChannel period:dateRange member_count:statisticalValue mean_message_view_count:statisticalValue mean_message_share_count:statisticalValue mean_message_reaction_count:statisticalValue mean_story_view_count:statisticalValue mean_story_share_count:statisticalValue mean_story_reaction_count:statisticalValue enabled_notifications_percentage:double member_count_graph:StatisticalGraph join_graph:StatisticalGraph mute_graph:StatisticalGraph view_count_by_hour_graph:StatisticalGraph view_count_by_source_graph:StatisticalGraph join_by_source_graph:StatisticalGraph language_graph:StatisticalGraph message_interaction_graph:StatisticalGraph message_reaction_graph:StatisticalGraph story_interaction_graph:StatisticalGraph story_reaction_graph:StatisticalGraph instant_view_interaction_graph:StatisticalGraph recent_interactions:vector<chatStatisticsInteractionInfo> = ChatStatistics; + + +//@description Contains information about revenue earned from sponsored messages in a chat +//@cryptocurrency Cryptocurrency in which revenue is calculated +//@total_amount Total amount of the cryptocurrency earned, in the smallest units of the cryptocurrency +//@balance_amount Amount of the cryptocurrency that isn't withdrawn yet, in the smallest units of the cryptocurrency +//@available_amount Amount of the cryptocurrency available for withdrawal, in the smallest units of the cryptocurrency +//@withdrawal_enabled True, if Telegram Stars can be withdrawn now or later +chatRevenueAmount cryptocurrency:string total_amount:int64 balance_amount:int64 available_amount:int64 withdrawal_enabled:Bool = ChatRevenueAmount; + +//@description A detailed statistics about revenue earned from sponsored messages in a chat +//@revenue_by_hour_graph A graph containing amount of revenue in a given hour +//@revenue_graph A graph containing amount of revenue +//@revenue_amount Amount of earned revenue +//@usd_rate Current conversion rate of the cryptocurrency in which revenue is calculated to USD +chatRevenueStatistics revenue_by_hour_graph:StatisticalGraph revenue_graph:StatisticalGraph revenue_amount:chatRevenueAmount usd_rate:double = ChatRevenueStatistics; + +//@description A detailed statistics about a message +//@message_interaction_graph A graph containing number of message views and shares +//@message_reaction_graph A graph containing number of message reactions +messageStatistics message_interaction_graph:StatisticalGraph message_reaction_graph:StatisticalGraph = MessageStatistics; + +//@description A detailed statistics about a story +//@story_interaction_graph A graph containing number of story views and shares +//@story_reaction_graph A graph containing number of story reactions +storyStatistics story_interaction_graph:StatisticalGraph story_reaction_graph:StatisticalGraph = StoryStatistics; + + +//@class RevenueWithdrawalState @description Describes state of a revenue withdrawal + +//@description Withdrawal is pending +revenueWithdrawalStatePending = RevenueWithdrawalState; + +//@description Withdrawal succeeded +//@date Point in time (Unix timestamp) when the withdrawal was completed +//@url The URL where the withdrawal transaction can be viewed +revenueWithdrawalStateSucceeded date:int32 url:string = RevenueWithdrawalState; + +//@description Withdrawal failed +revenueWithdrawalStateFailed = RevenueWithdrawalState; -//@description A detailed statistics about a message @message_interaction_graph A graph containing number of message views and shares -messageStatistics message_interaction_graph:StatisticalGraph = MessageStatistics; +//@class ChatRevenueTransactionType @description Describes type of transaction for revenue earned from sponsored messages in a chat + +//@description Describes earnings from sponsored messages in a chat in some time frame +//@start_date Point in time (Unix timestamp) when the earnings started +//@end_date Point in time (Unix timestamp) when the earnings ended +chatRevenueTransactionTypeEarnings start_date:int32 end_date:int32 = ChatRevenueTransactionType; + +//@description Describes a withdrawal of earnings +//@withdrawal_date Point in time (Unix timestamp) when the earnings withdrawal started +//@provider Name of the payment provider +//@state State of the withdrawal +chatRevenueTransactionTypeWithdrawal withdrawal_date:int32 provider:string state:RevenueWithdrawalState = ChatRevenueTransactionType; + +//@description Describes a refund for failed withdrawal of earnings +//@refund_date Point in time (Unix timestamp) when the transaction was refunded +//@provider Name of the payment provider +chatRevenueTransactionTypeRefund refund_date:int32 provider:string = ChatRevenueTransactionType; + +//@description Contains a chat revenue transactions +//@cryptocurrency Cryptocurrency in which revenue is calculated +//@cryptocurrency_amount The withdrawn amount, in the smallest units of the cryptocurrency +//@type Type of the transaction +chatRevenueTransaction cryptocurrency:string cryptocurrency_amount:int64 type:ChatRevenueTransactionType = ChatRevenueTransaction; + +//@description Contains a list of chat revenue transactions @total_count Total number of transactions @transactions List of transactions +chatRevenueTransactions total_count:int32 transactions:vector<chatRevenueTransaction> = ChatRevenueTransactions; + + +//@description Contains information about Telegram Stars earned by a bot or a chat +//@total_count Total number of Telegram Stars earned +//@current_count The number of Telegram Stars that aren't withdrawn yet +//@available_count The number of Telegram Stars that are available for withdrawal +//@withdrawal_enabled True, if Telegram Stars can be withdrawn now or later +//@next_withdrawal_in Time left before the next withdrawal can be started, in seconds; 0 if withdrawal can be started now +starRevenueStatus total_count:int53 current_count:int53 available_count:int53 withdrawal_enabled:Bool next_withdrawal_in:int32 = StarRevenueStatus; + +//@description A detailed statistics about Telegram Stars earned by a bot or a chat +//@revenue_by_day_graph A graph containing amount of revenue in a given day +//@status Telegram Star revenue status +//@usd_rate Current conversion rate of a Telegram Star to USD +starRevenueStatistics revenue_by_day_graph:StatisticalGraph status:starRevenueStatus usd_rate:double = StarRevenueStatistics; //@description A point on a Cartesian plane @x The point's first coordinate @y The point's second coordinate @@ -5264,6 +7431,19 @@ botCommandScopeChatAdministrators chat_id:int53 = BotCommandScope; botCommandScopeChatMember chat_id:int53 user_id:int53 = BotCommandScope; +//@class PhoneNumberCodeType @description Describes type of the request for which a code is sent to a phone number + +//@description Checks ownership of a new phone number to change the user's authentication phone number; for official Android and iOS applications only +phoneNumberCodeTypeChange = PhoneNumberCodeType; + +//@description Verifies ownership of a phone number to be added to the user's Telegram Passport +phoneNumberCodeTypeVerify = PhoneNumberCodeType; + +//@description Confirms ownership of a phone number to prevent account deletion while handling links of the type internalLinkTypePhoneNumberConfirmation +//@hash Hash value from the link +phoneNumberCodeTypeConfirmOwnership hash:string = PhoneNumberCodeType; + + //@class Update @description Contains notifications about data changes //@description The user authorization state has changed @authorization_state New authorization state @@ -5272,8 +7452,8 @@ updateAuthorizationState authorization_state:AuthorizationState = Update; //@description A new message was received; can also be an outgoing message @message The new message updateNewMessage message:message = Update; -//@description A request to send a message has reached the Telegram server. This doesn't mean that the message will be sent successfully or even that the send message request will be processed. -//-This update will be sent only if the option "use_quick_ack" is set to true. This update may be sent multiple times for the same message +//@description A request to send a message has reached the Telegram server. This doesn't mean that the message will be sent successfully. +//-This update is sent only if the option "use_quick_ack" is set to true. This update may be sent multiple times for the same message //@chat_id The chat identifier of the sent message //@message_id A temporary message identifier updateMessageSendAcknowledged chat_id:int53 message_id:int53 = Update; @@ -5284,9 +7464,8 @@ updateMessageSendSucceeded message:message old_message_id:int53 = Update; //@description A message failed to send. Be aware that some messages being sent can be irrecoverably deleted, in which case updateDeleteMessages will be received instead of this update //@message The failed to send message //@old_message_id The previous temporary message identifier -//@error_code An error code -//@error_message Error message -updateMessageSendFailed message:message old_message_id:int53 error_code:int32 error_message:string = Update; +//@error The cause of the message sending failure +updateMessageSendFailed message:message old_message_id:int53 error:error = Update; //@description The message content has changed @chat_id Chat identifier @message_id Message identifier @new_content New message content updateMessageContent chat_id:int53 message_id:int53 new_content:MessageContent = Update; @@ -5317,6 +7496,12 @@ updateMessageMentionRead chat_id:int53 message_id:int53 unread_mention_count:int //@unread_reaction_count The new number of messages with unread reactions left in the chat updateMessageUnreadReactions chat_id:int53 message_id:int53 unread_reactions:vector<unreadReaction> unread_reaction_count:int32 = Update; +//@description A fact-check added to a message was changed +//@chat_id Chat identifier +//@message_id Message identifier +//@fact_check The new fact-check +updateMessageFactCheck chat_id:int53 message_id:int53 fact_check:factCheck = Update; + //@description A message with a live location was viewed. When the update is received, the application is supposed to update the live location //@chat_id Identifier of the chat with the live location message //@message_id Identifier of the message with live location @@ -5331,12 +7516,20 @@ updateChatTitle chat_id:int53 title:string = Update; //@description A chat photo was changed @chat_id Chat identifier @photo The new chat photo; may be null updateChatPhoto chat_id:int53 photo:chatPhotoInfo = Update; -//@description Chat permissions was changed @chat_id Chat identifier @permissions The new chat permissions +//@description Chat accent colors have changed +//@chat_id Chat identifier +//@accent_color_id The new chat accent color identifier +//@background_custom_emoji_id The new identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none +//@profile_accent_color_id The new chat profile accent color identifier; -1 if none +//@profile_background_custom_emoji_id The new identifier of a custom emoji to be shown on the profile background; 0 if none +updateChatAccentColors chat_id:int53 accent_color_id:int32 background_custom_emoji_id:int64 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 = Update; + +//@description Chat permissions were changed @chat_id Chat identifier @permissions The new chat permissions updateChatPermissions chat_id:int53 permissions:chatPermissions = Update; -//@description The last message of a chat was changed. If last_message is null, then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case +//@description The last message of a chat was changed //@chat_id Chat identifier -//@last_message The new last message in the chat; may be null +//@last_message The new last message in the chat; may be null if the last message became unknown. While the last message is unknown, new messages can be added to the chat without corresponding updateNewMessage update //@positions The new chat positions in the chat lists updateChatLastMessage chat_id:int53 last_message:message positions:vector<chatPosition> = Update; @@ -5345,6 +7538,12 @@ updateChatLastMessage chat_id:int53 last_message:message positions:vector<chatPo //@position New chat position. If new order is 0, then the chat needs to be removed from the list updateChatPosition chat_id:int53 position:chatPosition = Update; +//@description A chat was added to a chat list @chat_id Chat identifier @chat_list The chat list to which the chat was added +updateChatAddedToList chat_id:int53 chat_list:ChatList = Update; + +//@description A chat was removed from a chat list @chat_id Chat identifier @chat_list The chat list from which the chat was removed +updateChatRemovedFromList chat_id:int53 chat_list:ChatList = Update; + //@description Incoming messages were read or the number of unread messages has been changed @chat_id Chat identifier @last_read_inbox_message_id Identifier of the last read incoming message @unread_count The number of unread messages left in the chat updateChatReadInbox chat_id:int53 last_read_inbox_message_id:int53 unread_count:int32 = Update; @@ -5354,15 +7553,23 @@ updateChatReadOutbox chat_id:int53 last_read_outbox_message_id:int53 = Update; //@description The chat action bar was changed @chat_id Chat identifier @action_bar The new value of the action bar; may be null updateChatActionBar chat_id:int53 action_bar:ChatActionBar = Update; +//@description The bar for managing business bot was changed in a chat @chat_id Chat identifier @business_bot_manage_bar The new value of the business bot manage bar; may be null +updateChatBusinessBotManageBar chat_id:int53 business_bot_manage_bar:businessBotManageBar = Update; + //@description The chat available reactions were changed @chat_id Chat identifier @available_reactions The new reactions, available in the chat updateChatAvailableReactions chat_id:int53 available_reactions:ChatAvailableReactions = Update; //@description A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update mustn't be applied //@chat_id Chat identifier -//@draft_message The new draft message; may be null +//@draft_message The new draft message; may be null if none //@positions The new chat positions in the chat lists updateChatDraftMessage chat_id:int53 draft_message:draftMessage positions:vector<chatPosition> = Update; +//@description Chat emoji status has changed +//@chat_id Chat identifier +//@emoji_status The new chat emoji status; may be null +updateChatEmojiStatus chat_id:int53 emoji_status:emojiStatus = Update; + //@description The message sender that is selected to send messages in a chat has changed @chat_id Chat identifier @message_sender_id New value of message_sender_id; may be null if the user can't change message sender updateChatMessageSender chat_id:int53 message_sender_id:MessageSender = Update; @@ -5407,27 +7614,58 @@ updateChatIsTranslatable chat_id:int53 is_translatable:Bool = Update; //@description A chat was marked as unread or was read @chat_id Chat identifier @is_marked_as_unread New value of is_marked_as_unread updateChatIsMarkedAsUnread chat_id:int53 is_marked_as_unread:Bool = Update; -//@description A chat was blocked or unblocked @chat_id Chat identifier @is_blocked New value of is_blocked -updateChatIsBlocked chat_id:int53 is_blocked:Bool = Update; +//@description A chat default appearance has changed @chat_id Chat identifier @view_as_topics New value of view_as_topics +updateChatViewAsTopics chat_id:int53 view_as_topics:Bool = Update; + +//@description A chat was blocked or unblocked @chat_id Chat identifier @block_list Block list to which the chat is added; may be null if none +updateChatBlockList chat_id:int53 block_list:BlockList = Update; //@description A chat's has_scheduled_messages field has changed @chat_id Chat identifier @has_scheduled_messages New value of has_scheduled_messages updateChatHasScheduledMessages chat_id:int53 has_scheduled_messages:Bool = Update; -//@description The list of chat folders or a chat folder has changed @chat_folders The new list of chat folders @main_chat_list_position Position of the main chat list among chat folders, 0-based -updateChatFolders chat_folders:vector<chatFolderInfo> main_chat_list_position:int32 = Update; +//@description The list of chat folders or a chat folder has changed +//@chat_folders The new list of chat folders +//@main_chat_list_position Position of the main chat list among chat folders, 0-based +//@are_tags_enabled True, if folder tags are enabled +updateChatFolders chat_folders:vector<chatFolderInfo> main_chat_list_position:int32 are_tags_enabled:Bool = Update; //@description The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. -//-There is no guarantee that it will be sent just after the number of online users has changed +//-There is no guarantee that it is sent just after the number of online users has changed //@chat_id Identifier of the chat //@online_member_count New number of online members in the chat, or 0 if unknown updateChatOnlineMemberCount chat_id:int53 online_member_count:int32 = Update; +//@description Basic information about a Saved Messages topic has changed. This update is guaranteed to come before the topic identifier is returned to the application +//@topic New data about the topic +updateSavedMessagesTopic topic:savedMessagesTopic = Update; + +//@description Number of Saved Messages topics has changed @topic_count Approximate total number of Saved Messages topics +updateSavedMessagesTopicCount topic_count:int32 = Update; + +//@description Basic information about a quick reply shortcut has changed. This update is guaranteed to come before the quick shortcut name is returned to the application +//@shortcut New data about the shortcut +updateQuickReplyShortcut shortcut:quickReplyShortcut = Update; + +//@description A quick reply shortcut and all its messages were deleted @shortcut_id The identifier of the deleted shortcut +updateQuickReplyShortcutDeleted shortcut_id:int32 = Update; + +//@description The list of quick reply shortcuts has changed @shortcut_ids The new list of identifiers of quick reply shortcuts +updateQuickReplyShortcuts shortcut_ids:vector<int32> = Update; + +//@description The list of quick reply shortcut messages has changed +//@shortcut_id The identifier of the shortcut +//@messages The new list of quick reply messages for the shortcut in order from the first to the last sent +updateQuickReplyShortcutMessages shortcut_id:int32 messages:vector<quickReplyMessage> = Update; + //@description Basic information about a topic in a forum chat was changed @chat_id Chat identifier @info New information about the topic updateForumTopicInfo chat_id:int53 info:forumTopicInfo = Update; //@description Notification settings for some type of chats were updated @scope Types of chats for which notification settings were updated @notification_settings The new notification settings updateScopeNotificationSettings scope:NotificationSettingsScope notification_settings:scopeNotificationSettings = Update; +//@description Notification settings for reactions were updated @notification_settings The new notification settings +updateReactionNotificationSettings notification_settings:reactionNotificationSettings = Update; + //@description A notification was changed @notification_group_id Unique notification group identifier @notification Changed notification updateNotification notification_group_id:int32 notification:notification = Update; @@ -5438,11 +7676,11 @@ updateNotification notification_group_id:int32 notification:notification = Updat //@notification_settings_chat_id Chat identifier, which notification settings must be applied to the added notifications //@notification_sound_id Identifier of the notification sound to be played; 0 if sound is disabled //@total_count Total number of unread notifications in the group, can be bigger than number of active notifications -//@added_notifications List of added group notifications, sorted by notification ID -//@removed_notification_ids Identifiers of removed group notifications, sorted by notification ID +//@added_notifications List of added group notifications, sorted by notification identifier +//@removed_notification_ids Identifiers of removed group notifications, sorted by notification identifier updateNotificationGroup notification_group_id:int32 type:NotificationGroupType chat_id:int53 notification_settings_chat_id:int53 notification_sound_id:int64 total_count:int32 added_notifications:vector<notification> removed_notification_ids:vector<int32> = Update; -//@description Contains active notifications that was shown on previous application launches. This update is sent only if the message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update @groups Lists of active notification groups +//@description Contains active notifications that were shown on previous application launches. This update is sent only if the message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update @groups Lists of active notification groups updateActiveNotifications groups:vector<notificationGroup> = Update; //@description Describes whether there are some pending notification updates. Can be used to prevent application from killing, while there are some pending notifications @@ -5459,7 +7697,7 @@ updateDeleteMessages chat_id:int53 message_ids:vector<int53> is_permanent:Bool f //@description A message sender activity in the chat has changed //@chat_id Chat identifier -//@message_thread_id If not 0, a message thread identifier in which the action was performed +//@message_thread_id If not 0, the message thread identifier in which the action was performed //@sender_id Identifier of a message sender performing the action //@action The action updateChatAction chat_id:int53 message_thread_id:int53 sender_id:MessageSender action:ChatAction = Update; @@ -5525,6 +7763,14 @@ updateFileDownload file_id:int32 complete_date:int32 is_paused:Bool counts:downl //@description A file was removed from the file download list. This update is sent only after file download list is loaded for the first time @file_id File identifier @counts New number of being downloaded and recently downloaded files found updateFileRemovedFromDownloads file_id:int32 counts:downloadedFileCounts = Update; +//@description A request can't be completed unless application verification is performed; for official mobile applications only. +//-The method setApplicationVerificationToken must be called once the verification is completed or failed +//@verification_id Unique identifier for the verification process +//@nonce Unique base64url-encoded nonce for the classic Play Integrity verification (https://developer.android.com/google/play/integrity/classic) for Android, +//-or a unique string to compare with verify_nonce field from a push notification for iOS +//@cloud_project_number Cloud project number to pass to the Play Integrity API on Android +updateApplicationVerificationRequired verification_id:int53 nonce:string cloud_project_number:int64 = Update; + //@description New call was created or information about a call was updated @call New data about a call updateCall call:call = Update; @@ -5557,6 +7803,33 @@ updateUnreadMessageCount chat_list:ChatList unread_count:int32 unread_unmuted_co //@marked_as_unread_unmuted_count Total number of unmuted chats marked as unread updateUnreadChatCount chat_list:ChatList total_count:int32 unread_count:int32 unread_unmuted_count:int32 marked_as_unread_count:int32 marked_as_unread_unmuted_count:int32 = Update; +//@description A story was changed @story The new information about the story +updateStory story:story = Update; + +//@description A story became inaccessible @story_sender_chat_id Identifier of the chat that posted the story @story_id Story identifier +updateStoryDeleted story_sender_chat_id:int53 story_id:int32 = Update; + +//@description A story has been successfully sent @story The sent story @old_story_id The previous temporary story identifier +updateStorySendSucceeded story:story old_story_id:int32 = Update; + +//@description A story failed to send. If the story sending is canceled, then updateStoryDeleted will be received instead of this update +//@story The failed to send story +//@error The cause of the story sending failure +//@error_type Type of the error; may be null if unknown +updateStorySendFailed story:story error:error error_type:CanSendStoryResult = Update; + +//@description The list of active stories posted by a specific chat has changed +//@active_stories The new list of active stories +updateChatActiveStories active_stories:chatActiveStories = Update; + +//@description Number of chats in a story list has changed @story_list The story list @chat_count Approximate total number of chats with active stories in the list +updateStoryListChatCount story_list:StoryList chat_count:int32 = Update; + +//@description Story stealth mode settings have changed +//@active_until_date Point in time (Unix timestamp) until stealth mode is active; 0 if it is disabled +//@cooldown_until_date Point in time (Unix timestamp) when stealth mode can be enabled again; 0 if there is no active cooldown +updateStoryStealthMode active_until_date:int32 cooldown_until_date:int32 = Update; + //@description An option changed its value @name The option name @value The new option value updateOption name:string value:OptionValue = Update; @@ -5578,15 +7851,26 @@ updateFavoriteStickers sticker_ids:vector<int32> = Update; //@description The list of saved animations was updated @animation_ids The new list of file identifiers of saved animations updateSavedAnimations animation_ids:vector<int32> = Update; -//@description The list of saved notifications sounds was updated. This update may not be sent until information about a notification sound was requested for the first time @notification_sound_ids The new list of identifiers of saved notification sounds +//@description The list of saved notification sounds was updated. This update may not be sent until information about a notification sound was requested for the first time @notification_sound_ids The new list of identifiers of saved notification sounds updateSavedNotificationSounds notification_sound_ids:vector<int64> = Update; -//@description The selected background has changed @for_dark_theme True, if background for dark theme has changed @background The new selected background; may be null -updateSelectedBackground for_dark_theme:Bool background:background = Update; +//@description The default background has changed @for_dark_theme True, if default background for dark theme has changed @background The new default background; may be null +updateDefaultBackground for_dark_theme:Bool background:background = Update; //@description The list of available chat themes has changed @chat_themes The new list of chat themes updateChatThemes chat_themes:vector<chatTheme> = Update; +//@description The list of supported accent colors has changed +//@colors Information about supported colors; colors with identifiers 0 (red), 1 (orange), 2 (purple/violet), 3 (green), 4 (cyan), 5 (blue), 6 (pink) must always be supported +//-and aren't included in the list. The exact colors for the accent colors with identifiers 0-6 must be taken from the app theme +//@available_accent_color_ids The list of accent color identifiers, which can be set through setAccentColor and setChatAccentColor. The colors must be shown in the specififed order +updateAccentColors colors:vector<accentColor> available_accent_color_ids:vector<int32> = Update; + +//@description The list of supported accent colors for user profiles has changed +//@colors Information about supported colors +//@available_accent_color_ids The list of accent color identifiers, which can be set through setProfileAccentColor and setChatProfileAccentColor. The colors must be shown in the specififed order +updateProfileAccentColors colors:vector<profileAccentColor> available_accent_color_ids:vector<int32> = Update; + //@description Some language pack strings have been updated @localization_target Localization target to which the language pack belongs @language_pack_id Identifier of the updated language pack @strings List of changed language pack strings; empty if all strings have changed updateLanguagePackStrings localization_target:string language_pack_id:string strings:vector<languagePackString> = Update; @@ -5599,7 +7883,10 @@ updateTermsOfService terms_of_service_id:string terms_of_service:termsOfService //@description The list of users nearby has changed. The update is guaranteed to be sent only 60 seconds after a successful searchChatsNearby request @users_nearby The new list of users nearby updateUsersNearby users_nearby:vector<chatNearby> = Update; -//@description The list of bots added to attachment menu has changed @bots The new list of bots added to attachment menu. The bots must not be shown on scheduled messages screen +//@description The first unconfirmed session has changed @session The unconfirmed session; may be null if none +updateUnconfirmedSession session:unconfirmedSession = Update; + +//@description The list of bots added to attachment or side menu has changed @bots The new list of bots. The bots must not be shown on scheduled messages screen updateAttachmentMenuBots bots:vector<attachmentMenuBot> = Update; //@description A message was sent by an opened Web App, so the Web App needs to be closed @web_app_launch_id Identifier of Web App launch @@ -5608,9 +7895,43 @@ updateWebAppMessageSent web_app_launch_id:int64 = Update; //@description The list of active emoji reactions has changed @emojis The new list of active emoji reactions updateActiveEmojiReactions emojis:vector<string> = Update; +//@description The list of available message effects has changed +//@reaction_effect_ids The new list of available message effects from emoji reactions +//@sticker_effect_ids The new list of available message effects from Premium stickers +updateAvailableMessageEffects reaction_effect_ids:vector<int64> sticker_effect_ids:vector<int64> = Update; + //@description The type of default reaction has changed @reaction_type The new type of the default reaction updateDefaultReactionType reaction_type:ReactionType = Update; +//@description Tags used in Saved Messages or a Saved Messages topic have changed +//@saved_messages_topic_id Identifier of Saved Messages topic which tags were changed; 0 if tags for the whole chat has changed +//@tags The new tags +updateSavedMessagesTags saved_messages_topic_id:int53 tags:savedMessagesTags = Update; + +//@description The list of messages with active live location that need to be updated by the application has changed. The list is persistent across application restarts only if the message database is used +//@messages The list of messages with active live locations +updateActiveLiveLocationMessages messages:vector<message> = Update; + +//@description The number of Telegram Stars owned by the current user has changed @star_count The new number of Telegram Stars owned +updateOwnedStarCount star_count:int53 = Update; + +//@description The revenue earned from sponsored messages in a chat has changed. If chat revenue screen is opened, then getChatRevenueTransactions may be called to fetch new transactions +//@chat_id Identifier of the chat +//@revenue_amount New amount of earned revenue +updateChatRevenueAmount chat_id:int53 revenue_amount:chatRevenueAmount = Update; + +//@description The Telegram Star revenue earned by a bot or a chat has changed. If Telegram Star transaction screen of the chat is opened, then getStarTransactions may be called to fetch new transactions +//@owner_id Identifier of the owner of the Telegram Stars +//@status New Telegram Star revenue status +updateStarRevenueStatus owner_id:MessageSender status:starRevenueStatus = Update; + +//@description The parameters of speech recognition without Telegram Premium subscription has changed +//@max_media_duration The maximum allowed duration of media for speech recognition without Telegram Premium subscription, in seconds +//@weekly_count The total number of allowed speech recognitions per week; 0 if none +//@left_count Number of left speech recognition attempts this week +//@next_reset_date Point in time (Unix timestamp) when the weekly number of tries will reset; 0 if unknown +updateSpeechRecognitionTrial max_media_duration:int32 weekly_count:int32 left_count:int32 next_reset_date:int32 = Update; + //@description The list of supported dice emojis has changed @emojis The new list of supported dice emojis updateDiceEmojis emojis:vector<string> = Update; @@ -5626,12 +7947,32 @@ updateAnimationSearchParameters provider:string emojis:vector<string> = Update; //@description The list of suggested to the user actions has changed @added_actions Added suggested actions @removed_actions Removed suggested actions updateSuggestedActions added_actions:vector<SuggestedAction> removed_actions:vector<SuggestedAction> = Update; -//@description Adding users to a chat has failed because of their privacy settings. An invite link can be shared with the users if appropriate @chat_id Chat identifier @user_ids Identifiers of users, which weren't added because of their privacy settings -updateAddChatMembersPrivacyForbidden chat_id:int53 user_ids:vector<int53> = Update; +//@description Download or upload file speed for the user was limited, but it can be restored by subscription to Telegram Premium. The notification can be postponed until a being downloaded or uploaded file is visible to the user. +//-Use getOption("premium_download_speedup") or getOption("premium_upload_speedup") to get expected speedup after subscription to Telegram Premium +//@is_upload True, if upload speed was limited; false, if download speed was limited +updateSpeedLimitNotification is_upload:Bool = Update; + +//@description The list of contacts that had birthdays recently or will have birthday soon has changed @close_birthday_users List of contact users with close birthday +updateContactCloseBirthdays close_birthday_users:vector<closeBirthdayUser> = Update; //@description Autosave settings for some type of chats were updated @scope Type of chats for which autosave settings were updated @settings The new autosave settings; may be null if the settings are reset to default updateAutosaveSettings scope:AutosaveSettingsScope settings:scopeAutosaveSettings = Update; +//@description A business connection has changed; for bots only @connection New data about the connection +updateBusinessConnection connection:businessConnection = Update; + +//@description A new message was added to a business account; for bots only @connection_id Unique identifier of the business connection @message The new message +updateNewBusinessMessage connection_id:string message:businessMessage = Update; + +//@description A message in a business account was edited; for bots only @connection_id Unique identifier of the business connection @message The edited message +updateBusinessMessageEdited connection_id:string message:businessMessage = Update; + +//@description Messages in a business account were deleted; for bots only +//@connection_id Unique identifier of the business connection +//@chat_id Identifier of a chat in the business account in which messages were deleted +//@message_ids Unique message identifiers of the deleted messages +updateBusinessMessagesDeleted connection_id:string chat_id:int53 message_ids:vector<int53> = Update; + //@description A new incoming inline query; for bots only //@id Unique query identifier //@sender_user_id Identifier of the user who sent the query @@ -5666,6 +8007,15 @@ updateNewCallbackQuery id:int64 sender_user_id:int53 chat_id:int53 message_id:in //@payload Query payload updateNewInlineCallbackQuery id:int64 sender_user_id:int53 inline_message_id:string chat_instance:int64 payload:CallbackQueryPayload = Update; +//@description A new incoming callback query from a business message; for bots only +//@id Unique query identifier +//@sender_user_id Identifier of the user who sent the query +//@connection_id Unique identifier of the business connection +//@message The message from the business account from which the query originated +//@chat_instance An identifier uniquely corresponding to the chat a message was sent to +//@payload Query payload +updateNewBusinessCallbackQuery id:int64 sender_user_id:int53 connection_id:string message:businessMessage chat_instance:int64 payload:CallbackQueryPayload = Update; + //@description A new incoming shipping query; for bots only. Only for invoices with flexible price //@id Unique query identifier //@sender_user_id Identifier of the user who sent the query @@ -5692,18 +8042,22 @@ updateNewCustomQuery id:int64 data:string timeout:int32 = Update; //@description A poll was updated; for bots only @poll New data about the poll updatePoll poll:poll = Update; -//@description A user changed the answer to a poll; for bots only @poll_id Unique poll identifier @user_id The user, who changed the answer to the poll @option_ids 0-based identifiers of answer options, chosen by the user -updatePollAnswer poll_id:int64 user_id:int53 option_ids:vector<int32> = Update; +//@description A user changed the answer to a poll; for bots only +//@poll_id Unique poll identifier +//@voter_id Identifier of the message sender that changed the answer to the poll +//@option_ids 0-based identifiers of answer options, chosen by the user +updatePollAnswer poll_id:int64 voter_id:MessageSender option_ids:vector<int32> = Update; //@description User rights changed in a chat; for bots only //@chat_id Chat identifier //@actor_user_id Identifier of the user, changing the rights -//@date Point in time (Unix timestamp) when the user rights was changed +//@date Point in time (Unix timestamp) when the user rights were changed //@invite_link If user has joined the chat using an invite link, the invite link; may be null +//@via_join_request True, if the user has joined the chat after sending a join request and being approved by an administrator //@via_chat_folder_invite_link True, if the user has joined the chat using an invite link for a chat folder //@old_chat_member Previous chat member //@new_chat_member New chat member -updateChatMember chat_id:int53 actor_user_id:int53 date:int32 invite_link:chatInviteLink via_chat_folder_invite_link:Bool old_chat_member:chatMember new_chat_member:chatMember = Update; +updateChatMember chat_id:int53 actor_user_id:int53 date:int32 invite_link:chatInviteLink via_join_request:Bool via_chat_folder_invite_link:Bool old_chat_member:chatMember new_chat_member:chatMember = Update; //@description A user sent a join request to a chat; for bots only //@chat_id Chat identifier @@ -5712,6 +8066,32 @@ updateChatMember chat_id:int53 actor_user_id:int53 date:int32 invite_link:chatIn //@invite_link The invite link, which was used to send join request; may be null updateNewChatJoinRequest chat_id:int53 request:chatJoinRequest user_chat_id:int53 invite_link:chatInviteLink = Update; +//@description A chat boost has changed; for bots only +//@chat_id Chat identifier +//@boost New information about the boost +updateChatBoost chat_id:int53 boost:chatBoost = Update; + +//@description User changed its reactions on a message with public reactions; for bots only +//@chat_id Chat identifier +//@message_id Message identifier +//@actor_id Identifier of the user or chat that changed reactions +//@date Point in time (Unix timestamp) when the reactions were changed +//@old_reaction_types Old list of chosen reactions +//@new_reaction_types New list of chosen reactions +updateMessageReaction chat_id:int53 message_id:int53 actor_id:MessageSender date:int32 old_reaction_types:vector<ReactionType> new_reaction_types:vector<ReactionType> = Update; + +//@description Reactions added to a message with anonymous reactions have changed; for bots only +//@chat_id Chat identifier +//@message_id Message identifier +//@date Point in time (Unix timestamp) when the reactions were changed +//@reactions The list of reactions added to the message +updateMessageReactions chat_id:int53 message_id:int53 date:int32 reactions:vector<messageReaction> = Update; + +//@description Paid media were purchased by a user; for bots only +//@user_id User identifier +//@payload Bot-specified payload for the paid media +updatePaidMediaPurchased user_id:int53 payload:string = Update; + //@description Contains a list of updates @updates List of updates updates updates:vector<Update> = Updates; @@ -5779,9 +8159,7 @@ getAuthorizationState = AuthorizationState; //@device_model Model of the device the application is being run on; must be non-empty //@system_version Version of the operating system the application is being run on. If empty, the version is automatically detected by TDLib //@application_version Application version; must be non-empty -//@enable_storage_optimizer Pass true to automatically delete old files in background -//@ignore_file_names Pass true to ignore original file names for downloaded files. Otherwise, downloaded files are saved under names as close as possible to the original name -setTdlibParameters use_test_dc:Bool database_directory:string files_directory:string database_encryption_key:bytes use_file_database:Bool use_chat_info_database:Bool use_message_database:Bool use_secret_chats:Bool api_id:int32 api_hash:string system_language_code:string device_model:string system_version:string application_version:string enable_storage_optimizer:Bool ignore_file_names:Bool = Ok; +setTdlibParameters use_test_dc:Bool database_directory:string files_directory:string database_encryption_key:bytes use_file_database:Bool use_chat_info_database:Bool use_message_database:Bool use_secret_chats:Bool api_id:int32 api_hash:string system_language_code:string device_model:string system_version:string application_version:string = Ok; //@description Sets the phone number of the user and sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitPhoneNumber, //-or if there is no pending authentication query and the current authorization state is authorizationStateWaitEmailAddress, authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword @@ -5792,11 +8170,12 @@ setAuthenticationPhoneNumber phone_number:string settings:phoneNumberAuthenticat //@description Sets the email address of the user and sends an authentication code to the email address. Works only when the current authorization state is authorizationStateWaitEmailAddress @email_address The email address of the user setAuthenticationEmailAddress email_address:string = Ok; -//@description Resends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode, the next_code_type of the result is not null and the server-specified timeout has passed, -//-or when the current authorization state is authorizationStateWaitEmailCode -resendAuthenticationCode = Ok; +//@description Resends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode, the next_code_type of the result is not null +//-and the server-specified timeout has passed, or when the current authorization state is authorizationStateWaitEmailCode +//@reason Reason of code resending; pass null if unknown +resendAuthenticationCode reason:ResendCodeReason = Ok; -//@description Checks the authentication of a email address. Works only when the current authorization state is authorizationStateWaitEmailCode @code Email address authentication to check +//@description Checks the authentication of an email address. Works only when the current authorization state is authorizationStateWaitEmailCode @code Email address authentication to check checkAuthenticationEmailCode code:EmailAddressAuthentication = Ok; //@description Checks the authentication code. Works only when the current authorization state is authorizationStateWaitCode @code Authentication code to check @@ -5810,7 +8189,8 @@ requestQrCodeAuthentication other_user_ids:vector<int53> = Ok; //@description Finishes user registration. Works only when the current authorization state is authorizationStateWaitRegistration //@first_name The first name of the user; 1-64 characters //@last_name The last name of the user; 0-64 characters -registerUser first_name:string last_name:string = Ok; +//@disable_notification Pass true to disable notification about the current user joining Telegram for other users that added them to contact list +registerUser first_name:string last_name:string disable_notification:Bool = Ok; //@description Resets the login email address. May return an error with a message "TASK_ALREADY_EXISTS" if reset is still pending. //-Works only when the current authorization state is authorizationStateWaitEmailCode and authorization_state.can_reset_email_address == true @@ -5832,9 +8212,12 @@ checkAuthenticationPasswordRecoveryCode recovery_code:string = Ok; recoverAuthenticationPassword recovery_code:string new_password:string new_hint:string = Ok; //@description Sends Firebase Authentication SMS to the phone number of the user. Works only when the current authorization state is authorizationStateWaitCode and the server returned code of the type authenticationCodeTypeFirebaseAndroid or authenticationCodeTypeFirebaseIos -//@token SafetyNet Attestation API token for the Android application, or secret from push notification for the iOS application +//@token Play Integrity API or SafetyNet Attestation API token for the Android application, or secret from push notification for the iOS application sendAuthenticationFirebaseSms token:string = Ok; +//@description Reports that authentication code wasn't delivered via SMS; for official mobile applications only. Works only when the current authorization state is authorizationStateWaitCode @mobile_network_code Current mobile network code +reportAuthenticationCodeMissing mobile_network_code:string = Ok; + //@description Checks the authentication token of a bot; to log in as a bot. Works only when the current authorization state is authorizationStateWaitPhoneNumber. Can be used instead of setAuthenticationPhoneNumber and checkAuthenticationCode to log in @token The bot token checkAuthenticationBotToken token:string = Ok; @@ -5873,7 +8256,7 @@ getPasswordState = PasswordState; setPassword old_password:string new_password:string new_hint:string set_recovery_email_address:Bool new_recovery_email_address:string = PasswordState; //@description Changes the login email address of the user. The email address can be changed only if the current user already has login email and passwordState.login_email_address_pattern is non-empty. -//-The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. To use Apple ID/Google ID instead of a email address, call checkLoginEmailAddressCode directly +//-The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. To use Apple ID/Google ID instead of an email address, call checkLoginEmailAddressCode directly //@new_login_email_address New login email address setLoginEmailAddress new_login_email_address:string = EmailAddressAuthenticationCodeInfo; @@ -5898,6 +8281,9 @@ checkRecoveryEmailAddressCode code:string = PasswordState; //@description Resends the 2-step verification recovery email address verification code resendRecoveryEmailAddressCode = PasswordState; +//@description Cancels verification of the 2-step verification recovery email address +cancelRecoveryEmailAddressVerification = PasswordState; + //@description Requests to send a 2-step verification password recovery code to an email address that was previously set up requestPasswordRecovery = EmailAddressAuthenticationCodeInfo; @@ -5947,7 +8333,7 @@ getSupergroupFullInfo supergroup_id:int53 = SupergroupFullInfo; //@description Returns information about a secret chat by its identifier. This is an offline request @secret_chat_id Secret chat identifier getSecretChat secret_chat_id:int32 = SecretChat; -//@description Returns information about a chat by its identifier, this is an offline request if the current user is not a bot @chat_id Chat identifier +//@description Returns information about a chat by its identifier; this is an offline request if the current user is not a bot @chat_id Chat identifier getChat chat_id:int53 = Chat; //@description Returns information about a message @chat_id Identifier of the chat the message belongs to @message_id Identifier of the message to get @@ -5956,8 +8342,9 @@ getMessage chat_id:int53 message_id:int53 = Message; //@description Returns information about a message, if it is available without sending network request. This is an offline request @chat_id Identifier of the chat the message belongs to @message_id Identifier of the message to get getMessageLocally chat_id:int53 message_id:int53 = Message; -//@description Returns information about a message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, and the topic creation message for messages -//-of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground and topic messages without replied message respectively +//@description Returns information about a non-bundled message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, +//-the message with a previously set same background, the giveaway message, and the topic creation message for messages of the types +//-messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground, messageGiveawayCompleted and topic messages without non-bundled replied message respectively //@chat_id Identifier of the chat the message belongs to //@message_id Identifier of the reply message getRepliedMessage chat_id:int53 message_id:int53 = Message; @@ -5971,10 +8358,18 @@ getCallbackQueryMessage chat_id:int53 message_id:int53 callback_query_id:int64 = //@description Returns information about messages. If a message is not found, returns null on the corresponding position of the result @chat_id Identifier of the chat the messages belong to @message_ids Identifiers of the messages to get getMessages chat_id:int53 message_ids:vector<int53> = Messages; -//@description Returns information about a message thread. Can be used only if message.can_get_message_thread == true @chat_id Chat identifier @message_id Identifier of the message +//@description Returns properties of a message; this is an offline request @chat_id Chat identifier @message_id Identifier of the message +getMessageProperties chat_id:int53 message_id:int53 = MessageProperties; + +//@description Returns information about a message thread. Can be used only if messageProperties.can_get_message_thread == true @chat_id Chat identifier @message_id Identifier of the message getMessageThread chat_id:int53 message_id:int53 = MessageThreadInfo; -//@description Returns viewers of a recent outgoing message in a basic group or a supergroup chat. For video notes and voice notes only users, opened content of the message, are returned. The method can be called if message.can_get_viewers == true +//@description Returns read date of a recent outgoing message in a private chat. The method can be called if messageProperties.can_get_read_date == true +//@chat_id Chat identifier +//@message_id Identifier of the message +getMessageReadDate chat_id:int53 message_id:int53 = MessageReadDate; + +//@description Returns viewers of a recent outgoing message in a basic group or a supergroup chat. For video notes and voice notes only users, opened content of the message, are returned. The method can be called if messageProperties.can_get_viewers == true //@chat_id Chat identifier //@message_id Identifier of the message getMessageViewers chat_id:int53 message_id:int53 = MessageViewers; @@ -5982,7 +8377,7 @@ getMessageViewers chat_id:int53 message_id:int53 = MessageViewers; //@description Returns information about a file; this is an offline request @file_id Identifier of the file to get getFile file_id:int32 = File; -//@description Returns information about a file by its remote ID; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. +//@description Returns information about a file by its remote identifier; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user. //-For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application //@remote_file_id Remote identifier of the file to get //@file_type File type; pass null if unknown @@ -6006,7 +8401,7 @@ searchPublicChat username:string = Chat; //@query Query to search for searchPublicChats query:string = Chats; -//@description Searches for the specified query in the title and username of already known chats, this is an offline request. Returns chats in the order seen in the main chat list +//@description Searches for the specified query in the title and username of already known chats; this is an offline request. Returns chats in the order seen in the main chat list //@query Query to search for. If the query is empty, returns up to 50 recently found chats //@limit The maximum number of chats to be returned searchChats query:string limit:int32 = Chats; @@ -6019,12 +8414,33 @@ searchChatsOnServer query:string limit:int32 = Chats; //@location Current user location searchChatsNearby location:location = ChatsNearby; -//@description Returns a list of frequently used chats. Supported only if the chat info database is enabled @category Category of chats to be returned @limit The maximum number of chats to be returned; up to 30 +//@description Returns a list of channel chats recommended to the current user +getRecommendedChats = Chats; + +//@description Returns a list of chats similar to the given chat @chat_id Identifier of the target chat; must be an identifier of a channel chat +getChatSimilarChats chat_id:int53 = Chats; + +//@description Returns approximate number of chats similar to the given chat +//@chat_id Identifier of the target chat; must be an identifier of a channel chat +//@return_local Pass true to get the number of chats without sending network requests, or -1 if the number of chats is unknown locally +getChatSimilarChatCount chat_id:int53 return_local:Bool = Count; + +//@description Informs TDLib that a chat was opened from the list of similar chats. The method is independent of openChat and closeChat methods +//@chat_id Identifier of the original chat, which similar chats were requested +//@opened_chat_id Identifier of the opened chat +openChatSimilarChat chat_id:int53 opened_chat_id:int53 = Ok; + +//@description Returns a list of frequently used chats @category Category of chats to be returned @limit The maximum number of chats to be returned; up to 30 getTopChats category:TopChatCategory limit:int32 = Chats; //@description Removes a chat from the list of frequently used chats. Supported only if the chat info database is enabled @category Category of frequently used chats @chat_id Chat identifier removeTopChat category:TopChatCategory chat_id:int53 = Ok; +//@description Searches for the specified query in the title and username of up to 50 recently found chats; this is an offline request +//@query Query to search for +//@limit The maximum number of chats to be returned +searchRecentlyFoundChats query:string limit:int32 = Chats; + //@description Adds a chat to the list of recently found chats. The chat is added to the beginning of the list. If the chat is already in the list, it will be removed from the list first @chat_id Identifier of the chat to add addRecentlyFoundChat chat_id:int53 = Ok; @@ -6034,10 +8450,10 @@ removeRecentlyFoundChat chat_id:int53 = Ok; //@description Clears the list of recently found chats clearRecentlyFoundChats = Ok; -//@description Returns recently opened chats, this is an offline request. Returns chats in the order of last opening @limit The maximum number of chats to be returned +//@description Returns recently opened chats; this is an offline request. Returns chats in the order of last opening @limit The maximum number of chats to be returned getRecentlyOpenedChats limit:int32 = Chats; -//@description Checks whether a username can be set for a chat @chat_id Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or zero if the chat is being created @username Username to be checked +//@description Checks whether a username can be set for a chat @chat_id Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or 0 if the chat is being created @username Username to be checked checkChatUsername chat_id:int53 username:string = CheckChatUsernameResult; //@description Returns a list of public chats of the specified type, owned by the user @type Type of the public chats to return @@ -6053,6 +8469,44 @@ getSuitableDiscussionChats = Chats; //@description Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of joined supergroups and channels and receives CHANNELS_TOO_MUCH error. Also, the limit can be increased with Telegram Premium getInactiveSupergroupChats = Chats; +//@description Returns a list of channel chats, which can be used as a personal chat +getSuitablePersonalChats = Chats; + + +//@description Loads more Saved Messages topics. The loaded topics will be sent through updateSavedMessagesTopic. Topics are sorted by their topic.order in descending order. Returns a 404 error if all topics have been loaded +//@limit The maximum number of topics to be loaded. For optimal performance, the number of loaded topics is chosen by TDLib and can be smaller than the specified limit, even if the end of the list is not reached +loadSavedMessagesTopics limit:int32 = Ok; + +//@description Returns messages in a Saved Messages topic. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id) +//@saved_messages_topic_id Identifier of Saved Messages topic which messages will be fetched +//@from_message_id Identifier of the message starting from which messages must be fetched; use 0 to get results from the last message +//@offset Specify 0 to get results from exactly the message from_message_id or a negative offset up to 99 to get additionally some newer messages +//@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. +//-For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit +getSavedMessagesTopicHistory saved_messages_topic_id:int53 from_message_id:int53 offset:int32 limit:int32 = Messages; + +//@description Returns the last message sent in a Saved Messages topic no later than the specified date +//@saved_messages_topic_id Identifier of Saved Messages topic which message will be returned +//@date Point in time (Unix timestamp) relative to which to search for messages +getSavedMessagesTopicMessageByDate saved_messages_topic_id:int53 date:int32 = Message; + +//@description Deletes all messages in a Saved Messages topic @saved_messages_topic_id Identifier of Saved Messages topic which messages will be deleted +deleteSavedMessagesTopicHistory saved_messages_topic_id:int53 = Ok; + +//@description Deletes all messages between the specified dates in a Saved Messages topic. Messages sent in the last 30 seconds will not be deleted +//@saved_messages_topic_id Identifier of Saved Messages topic which messages will be deleted +//@min_date The minimum date of the messages to delete +//@max_date The maximum date of the messages to delete +deleteSavedMessagesTopicMessagesByDate saved_messages_topic_id:int53 min_date:int32 max_date:int32 = Ok; + +//@description Changes the pinned state of a Saved Messages topic. There can be up to getOption("pinned_saved_messages_topic_count_max") pinned topics. The limit can be increased with Telegram Premium +//@saved_messages_topic_id Identifier of Saved Messages topic to pin or unpin +//@is_pinned Pass true to pin the topic; pass false to unpin it +toggleSavedMessagesTopicIsPinned saved_messages_topic_id:int53 is_pinned:Bool = Ok; + +//@description Changes the order of pinned Saved Messages topics @saved_messages_topic_ids Identifiers of the new pinned Saved Messages topics +setPinnedSavedMessagesTopics saved_messages_topic_ids:vector<int53> = Ok; + //@description Returns a list of common group chats with a given user. Chats are sorted by their type and creation date //@user_id User identifier @@ -6061,22 +8515,22 @@ getInactiveSupergroupChats = Chats; getGroupsInCommon user_id:int53 offset_chat_id:int53 limit:int32 = Chats; -//@description Returns messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id). +//@description Returns messages in a chat. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id). //-For optimal performance, the number of returned messages is chosen by TDLib. This is an offline request if only_local is true //@chat_id Chat identifier //@from_message_id Identifier of the message starting from which history must be fetched; use 0 to get results from the last message -//@offset Specify 0 to get results from exactly the from_message_id or a negative offset up to 99 to get additionally some newer messages +//@offset Specify 0 to get results from exactly the message from_message_id or a negative offset up to 99 to get additionally some newer messages //@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. //-For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit //@only_local Pass true to get only messages that are available without sending network requests getChatHistory chat_id:int53 from_message_id:int53 offset:int32 limit:int32 only_local:Bool = Messages; -//@description Returns messages in a message thread of a message. Can be used only if message.can_get_message_thread == true. Message thread of a channel message is in the channel's linked supergroup. -//-The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib +//@description Returns messages in a message thread of a message. Can be used only if messageProperties.can_get_message_thread == true. Message thread of a channel message is in the channel's linked supergroup. +//-The messages are returned in reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib //@chat_id Chat identifier //@message_id Message identifier, which thread history needs to be returned //@from_message_id Identifier of the message starting from which history must be fetched; use 0 to get results from the last message -//@offset Specify 0 to get results from exactly the from_message_id or a negative offset up to 99 to get additionally some newer messages +//@offset Specify 0 to get results from exactly the message from_message_id or a negative offset up to 99 to get additionally some newer messages //@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. //-For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit getMessageThreadHistory chat_id:int53 message_id:int53 from_message_id:int53 offset:int32 limit:int32 = Messages; @@ -6099,23 +8553,25 @@ deleteChat chat_id:int53 = Ok; //@query Query to search for //@sender_id Identifier of the sender of messages to search for; pass null to search for messages from any sender. Not supported in secret chats //@from_message_id Identifier of the message starting from which history must be fetched; use 0 to get results from the last message -//@offset Specify 0 to get results from exactly the from_message_id or a negative offset to get the specified message and some newer messages +//@offset Specify 0 to get results from exactly the message from_message_id or a negative offset to get the specified message and some newer messages //@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than -offset. //-For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit //@filter Additional filter for messages to search; pass null to search for all messages //@message_thread_id If not 0, only messages in the specified thread will be returned; supergroups only -searchChatMessages chat_id:int53 query:string sender_id:MessageSender from_message_id:int53 offset:int32 limit:int32 filter:SearchMessagesFilter message_thread_id:int53 = FoundChatMessages; +//@saved_messages_topic_id If not 0, only messages in the specified Saved Messages topic will be returned; pass 0 to return all messages, or for chats other than Saved Messages +searchChatMessages chat_id:int53 query:string sender_id:MessageSender from_message_id:int53 offset:int32 limit:int32 filter:SearchMessagesFilter message_thread_id:int53 saved_messages_topic_id:int53 = FoundChatMessages; //@description Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)). //-For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit //@chat_list Chat list in which to search messages; pass null to search in all chats regardless of their chat list. Only Main and Archive chat lists are supported +//@only_in_channels Pass true to search only for messages in channels //@query Query to search for //@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results //@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit //@filter Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function //@min_date If not 0, the minimum date of the messages to return //@max_date If not 0, the maximum date of the messages to return -searchMessages chat_list:ChatList query:string offset:string limit:int32 filter:SearchMessagesFilter min_date:int32 max_date:int32 = FoundMessages; +searchMessages chat_list:ChatList only_in_channels:Bool query:string offset:string limit:int32 filter:SearchMessagesFilter min_date:int32 max_date:int32 = FoundMessages; //@description Searches for messages in secret chats. Returns the results in reverse chronological order. For optimal performance, the number of returned messages is chosen by TDLib //@chat_id Identifier of the chat in which to search. Specify 0 to search in all secret chats @@ -6125,6 +8581,18 @@ searchMessages chat_list:ChatList query:string offset:string limit:int32 filter: //@filter Additional filter for messages to search; pass null to search for all messages searchSecretMessages chat_id:int53 query:string offset:string limit:int32 filter:SearchMessagesFilter = FoundMessages; +//@description Searches for messages tagged by the given reaction and with the given words in the Saved Messages chat; for Telegram Premium users only. +//-Returns the results in reverse chronological order, i.e. in order of decreasing message_id. +//-For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit +//@saved_messages_topic_id If not 0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all messages +//@tag Tag to search for; pass null to return all suitable messages +//@query Query to search for +//@from_message_id Identifier of the message starting from which messages must be fetched; use 0 to get results from the last message +//@offset Specify 0 to get results from exactly the message from_message_id or a negative offset to get the specified message and some newer messages +//@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than -offset. +//-For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit +searchSavedMessages saved_messages_topic_id:int53 tag:ReactionType query:string from_message_id:int53 offset:int32 limit:int32 = FoundChatMessages; + //@description Searches for call messages. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib //@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results //@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit @@ -6136,15 +8604,46 @@ searchCallMessages offset:string limit:int32 only_missed:Bool = FoundMessages; //@limit The maximum number of messages to be returned; up to 100 searchOutgoingDocumentMessages query:string limit:int32 = FoundMessages; +//@description Searches for public channel posts containing the given hashtag or cashtag. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit +//@tag Hashtag or cashtag to search for +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit +searchPublicMessagesByTag tag:string offset:string limit:int32 = FoundMessages; + +//@description Searches for public stories containing the given hashtag or cashtag. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit +//@tag Hashtag or cashtag to search for +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of stories to be returned; up to 100. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit +searchPublicStoriesByTag tag:string offset:string limit:int32 = FoundStories; + +//@description Searches for public stories by the given address location. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit +//@address Address of the location +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of stories to be returned; up to 100. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit +searchPublicStoriesByLocation address:locationAddress offset:string limit:int32 = FoundStories; + +//@description Searches for public stories from the given venue. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit +//@venue_provider Provider of the venue +//@venue_id Identifier of the venue in the provider database +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of stories to be returned; up to 100. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit +searchPublicStoriesByVenue venue_provider:string venue_id:string offset:string limit:int32 = FoundStories; + +//@description Returns recently searched for hashtags or cashtags by their prefix @tag_prefix Prefix of hashtags or cashtags to return @limit The maximum number of items to be returned +getSearchedForTags tag_prefix:string limit:int32 = Hashtags; + +//@description Removes a hashtag or a cashtag from the list of recently searched for hashtags or cashtags @tag Hashtag or cashtag to delete +removeSearchedForTag tag:string = Ok; + +//@description Clears the list of recently searched for hashtags or cashtags @clear_cashtags Pass true to clear the list of recently searched for cashtags; otherwise, the list of recently searched for hashtags will be cleared +clearSearchedForTags clear_cashtags:Bool = Ok; + //@description Deletes all call messages @revoke Pass true to delete the messages for all users deleteAllCallMessages revoke:Bool = Ok; //@description Returns information about the recent locations of chat members that were sent to the chat. Returns up to 1 location message per user @chat_id Chat identifier @limit The maximum number of messages to be returned searchChatRecentLocationMessages chat_id:int53 limit:int32 = Messages; -//@description Returns all active live locations that need to be updated by the application. The list is persistent across application restarts only if the message database is used -getActiveLiveLocationMessages = Messages; - //@description Returns the last message sent in a chat no later than the specified date @chat_id Chat identifier @date Point in time (Unix timestamp) relative to which to search for messages getChatMessageByDate chat_id:int53 date:int32 = Message; @@ -6154,40 +8653,48 @@ getChatMessageByDate chat_id:int53 date:int32 = Message; //@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function //@from_message_id The message identifier from which to return information about message positions //@limit The expected number of message positions to be returned; 50-2000. A smaller number of positions can be returned, if there are not enough appropriate messages -getChatSparseMessagePositions chat_id:int53 filter:SearchMessagesFilter from_message_id:int53 limit:int32 = MessagePositions; +//@saved_messages_topic_id If not 0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all messages, or for chats other than Saved Messages +getChatSparseMessagePositions chat_id:int53 filter:SearchMessagesFilter from_message_id:int53 limit:int32 saved_messages_topic_id:int53 = MessagePositions; //@description Returns information about the next messages of the specified type in the chat split by days. Returns the results in reverse chronological order. Can return partial result for the last returned day. Behavior of this method depends on the value of the option "utc_time_offset" //@chat_id Identifier of the chat in which to return information about messages //@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function //@from_message_id The message identifier from which to return information about messages; use 0 to get results from the last message -getChatMessageCalendar chat_id:int53 filter:SearchMessagesFilter from_message_id:int53 = MessageCalendar; +//@saved_messages_topic_id If not0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all messages, or for chats other than Saved Messages +getChatMessageCalendar chat_id:int53 filter:SearchMessagesFilter from_message_id:int53 saved_messages_topic_id:int53 = MessageCalendar; //@description Returns approximate number of messages of the specified type in the chat //@chat_id Identifier of the chat in which to count messages //@filter Filter for message content; searchMessagesFilterEmpty is unsupported in this function +//@saved_messages_topic_id If not 0, only messages in the specified Saved Messages topic will be counted; pass 0 to count all messages, or for chats other than Saved Messages //@return_local Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally -getChatMessageCount chat_id:int53 filter:SearchMessagesFilter return_local:Bool = Count; +getChatMessageCount chat_id:int53 filter:SearchMessagesFilter saved_messages_topic_id:int53 return_local:Bool = Count; //@description Returns approximate 1-based position of a message among messages, which can be found by the specified filter in the chat. Cannot be used in secret chats //@chat_id Identifier of the chat in which to find message position //@message_id Message identifier //@filter Filter for message content; searchMessagesFilterEmpty, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, and searchMessagesFilterFailedToSend are unsupported in this function //@message_thread_id If not 0, only messages in the specified thread will be considered; supergroups only -getChatMessagePosition chat_id:int53 message_id:int53 filter:SearchMessagesFilter message_thread_id:int53 = Count; +//@saved_messages_topic_id If not 0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all relevant messages, or for chats other than Saved Messages +getChatMessagePosition chat_id:int53 message_id:int53 filter:SearchMessagesFilter message_thread_id:int53 saved_messages_topic_id:int53 = Count; -//@description Returns all scheduled messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) @chat_id Chat identifier +//@description Returns all scheduled messages in a chat. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id) @chat_id Chat identifier getChatScheduledMessages chat_id:int53 = Messages; -//@description Returns forwarded copies of a channel message to different public channels. For optimal performance, the number of returned messages is chosen by TDLib -//@chat_id Chat identifier of the message -//@message_id Message identifier -//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results -//@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit -getMessagePublicForwards chat_id:int53 message_id:int53 offset:string limit:int32 = FoundMessages; - //@description Returns sponsored messages to be shown in a chat; for channel chats only @chat_id Identifier of the chat getChatSponsoredMessages chat_id:int53 = SponsoredMessages; +//@description Informs TDLib that the user opened the sponsored chat via the button, the name, the photo, or a mention in the sponsored message +//@chat_id Chat identifier of the sponsored message +//@message_id Identifier of the sponsored message +clickChatSponsoredMessage chat_id:int53 message_id:int53 = Ok; + +//@description Reports a sponsored message to Telegram moderators +//@chat_id Chat identifier of the sponsored message +//@message_id Identifier of the sponsored message +//@option_id Option identifier chosen by the user; leave empty for the initial request +reportChatSponsoredMessage chat_id:int53 message_id:int53 option_id:bytes = ReportChatSponsoredMessageResult; + //@description Removes an active notification from notification list. Needs to be called only if the notification is removed by the current user @notification_group_id Identifier of notification group to which the notification belongs @notification_id Identifier of removed notification removeNotification notification_group_id:int32 notification_id:int32 = Ok; @@ -6196,15 +8703,15 @@ removeNotification notification_group_id:int32 notification_id:int32 = Ok; removeNotificationGroup notification_group_id:int32 max_notification_id:int32 = Ok; -//@description Returns an HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels, or if message.can_get_media_timestamp_links and a media timestamp link is generated. This is an offline request +//@description Returns an HTTPS link to a message in a chat. Available only if messageProperties.can_get_link, or if messageProperties.can_get_media_timestamp_links and a media timestamp link is generated. This is an offline request //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message -//@media_timestamp If not 0, timestamp from which the video/audio/video note/voice note playing must start, in seconds. The media can be in the message content or in its web page preview +//@media_timestamp If not 0, timestamp from which the video/audio/video note/voice note/story playing must start, in seconds. The media can be in the message content or in its link preview //@for_album Pass true to create a link for the whole media album //@in_message_thread Pass true to create a link to the message as a channel post comment, in a message thread, or a forum topic getMessageLink chat_id:int53 message_id:int53 media_timestamp:int32 for_album:Bool in_message_thread:Bool = MessageLink; -//@description Returns an HTML code for embedding the message. Available only for messages in supergroups and channels with a username +//@description Returns an HTML code for embedding the message. Available only if messageProperties.can_get_embedding_code //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message //@for_album Pass true to return an HTML code for embedding of the whole media album @@ -6233,16 +8740,16 @@ translateText text:formattedText to_language_code:string = FormattedText; //-"st", "sn", "sd", "si", "sk", "sl", "so", "es", "su", "sw", "sv", "tl", "tg", "ta", "tt", "te", "th", "tr", "tk", "uk", "ur", "ug", "uz", "vi", "cy", "xh", "yi", "ji", "yo", "zu" translateMessageText chat_id:int53 message_id:int53 to_language_code:string = FormattedText; -//@description Recognizes speech in a video note or a voice note message. The message must be successfully sent and must not be scheduled. May return an error with a message "MSG_VOICE_TOO_LONG" if media duration is too big to be recognized +//@description Recognizes speech in a video note or a voice note message //@chat_id Identifier of the chat to which the message belongs -//@message_id Identifier of the message +//@message_id Identifier of the message. Use messageProperties.can_recognize_speech to check whether the message is suitable recognizeSpeech chat_id:int53 message_id:int53 = Ok; //@description Rates recognized speech in a video note or a voice note message @chat_id Identifier of the chat to which the message belongs @message_id Identifier of the message @is_good Pass true if the speech recognition is good rateSpeechRecognition chat_id:int53 message_id:int53 is_good:Bool = Ok; -//@description Returns list of message sender identifiers, which can be used to send messages in a chat @chat_id Chat identifier +//@description Returns the list of message sender identifiers, which can be used to send messages in a chat @chat_id Chat identifier getChatAvailableMessageSenders chat_id:int53 = ChatMessageSenders; //@description Selects a message sender to send messages in a chat @chat_id Chat identifier @message_sender_id New message sender for the chat @@ -6250,23 +8757,24 @@ setChatMessageSender chat_id:int53 message_sender_id:MessageSender = Ok; //@description Sends a message. Returns the sent message //@chat_id Target chat -//@message_thread_id If not 0, a message thread identifier in which the message will be sent -//@reply_to_message_id Identifier of the replied message; 0 if none +//@message_thread_id If not 0, the message thread identifier in which the message will be sent +//@reply_to Information about the message or story to be replied; pass null if none //@options Options to be used to send the message; pass null to use default options //@reply_markup Markup for replying to the message; pass null if none; for bots only //@input_message_content The content of the message to be sent -sendMessage chat_id:int53 message_thread_id:int53 reply_to_message_id:int53 options:messageSendOptions reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; +sendMessage chat_id:int53 message_thread_id:int53 reply_to:InputMessageReplyTo options:messageSendOptions reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; -//@description Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages +//@description Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. +//-Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages //@chat_id Target chat -//@message_thread_id If not 0, a message thread identifier in which the messages will be sent -//@reply_to_message_id Identifier of a replied message; 0 if none +//@message_thread_id If not 0, the message thread identifier in which the messages will be sent +//@reply_to Information about the message or story to be replied; pass null if none //@options Options to be used to send the messages; pass null to use default options -//@input_message_contents Contents of messages to be sent. At most 10 messages can be added to an album -//@only_preview Pass true to get fake messages instead of actually sending them -sendMessageAlbum chat_id:int53 message_thread_id:int53 reply_to_message_id:int53 options:messageSendOptions input_message_contents:vector<InputMessageContent> only_preview:Bool = Messages; +//@input_message_contents Contents of messages to be sent. At most 10 messages can be added to an album. All messages must have the same value of show_caption_above_media +sendMessageAlbum chat_id:int53 message_thread_id:int53 reply_to:InputMessageReplyTo options:messageSendOptions input_message_contents:vector<InputMessageContent> = Messages; -//@description Invites a bot to a chat (if it is not yet a member) and sends it the /start command. Bots can't be invited to a private chat other than the chat with the bot. Bots can't be invited to channels (although they can be added as admins) and secret chats. Returns the sent message +//@description Invites a bot to a chat (if it is not yet a member) and sends it the /start command; requires can_invite_users member right. Bots can't be invited to a private chat other than the chat with the bot. +//-Bots can't be invited to channels (although they can be added as admins) and secret chats. Returns the sent message //@bot_user_id Identifier of the bot //@chat_id Identifier of the target chat //@parameter A hidden parameter sent to the bot for deep linking purposes (https://core.telegram.org/bots#deep-linking) @@ -6274,43 +8782,49 @@ sendBotStartMessage bot_user_id:int53 chat_id:int53 parameter:string = Message; //@description Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message //@chat_id Target chat -//@message_thread_id If not 0, a message thread identifier in which the message will be sent -//@reply_to_message_id Identifier of a replied message; 0 if none +//@message_thread_id If not 0, the message thread identifier in which the message will be sent +//@reply_to Information about the message or story to be replied; pass null if none //@options Options to be used to send the message; pass null to use default options //@query_id Identifier of the inline query -//@result_id Identifier of the inline result +//@result_id Identifier of the inline query result //@hide_via_bot Pass true to hide the bot, via which the message is sent. Can be used only for bots getOption("animation_search_bot_username"), getOption("photo_search_bot_username"), and getOption("venue_search_bot_username") -sendInlineQueryResultMessage chat_id:int53 message_thread_id:int53 reply_to_message_id:int53 options:messageSendOptions query_id:int64 result_id:string hide_via_bot:Bool = Message; +sendInlineQueryResultMessage chat_id:int53 message_thread_id:int53 reply_to:InputMessageReplyTo options:messageSendOptions query_id:int64 result_id:string hide_via_bot:Bool = Message; //@description Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message //@chat_id Identifier of the chat to which to forward messages -//@message_thread_id If not 0, a message thread identifier in which the message will be sent; for forum threads only +//@message_thread_id If not 0, the message thread identifier in which the message will be sent; for forum threads only //@from_chat_id Identifier of the chat from which to forward messages -//@message_ids Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously +//@message_ids Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously. A message can be forwarded only if messageProperties.can_be_forwarded //@options Options to be used to send the messages; pass null to use default options //@send_copy Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local //@remove_caption Pass true to remove media captions of message copies. Ignored if send_copy is false -//@only_preview Pass true to get fake messages instead of actually forwarding them -forwardMessages chat_id:int53 message_thread_id:int53 from_chat_id:int53 message_ids:vector<int53> options:messageSendOptions send_copy:Bool remove_caption:Bool only_preview:Bool = Messages; +forwardMessages chat_id:int53 message_thread_id:int53 from_chat_id:int53 message_ids:vector<int53> options:messageSendOptions send_copy:Bool remove_caption:Bool = Messages; + +//@description Sends messages from a quick reply shortcut. Requires Telegram Business subscription +//@chat_id Identifier of the chat to which to send messages. The chat must be a private chat with a regular user +//@shortcut_id Unique identifier of the quick reply shortcut +//@sending_id Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates +sendQuickReplyShortcutMessages chat_id:int53 shortcut_id:int32 sending_id:int32 = Messages; //@description Resends messages which failed to send. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. //-If a message is re-sent, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be re-sent, null will be returned instead of the message //@chat_id Identifier of the chat to send messages //@message_ids Identifiers of the messages to resend. Message identifiers must be in a strictly increasing order -resendMessages chat_id:int53 message_ids:vector<int53> = Messages; - -//@description Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats @chat_id Chat identifier -sendChatScreenshotTakenNotification chat_id:int53 = Ok; +//@quote New manually chosen quote from the message to be replied; pass null if none. Ignored if more than one message is re-sent, or if messageSendingStateFailed.need_another_reply_quote == false +resendMessages chat_id:int53 message_ids:vector<int53> quote:inputTextQuote = Messages; //@description Adds a local message to a chat. The message is persistent across application restarts only if the message database is used. Returns the added message //@chat_id Target chat //@sender_id Identifier of the sender of the message -//@reply_to_message_id Identifier of the replied message; 0 if none +//@reply_to Information about the message or story to be replied; pass null if none //@disable_notification Pass true to disable notification for the message //@input_message_content The content of the message to be added -addLocalMessage chat_id:int53 sender_id:MessageSender reply_to_message_id:int53 disable_notification:Bool input_message_content:InputMessageContent = Message; +addLocalMessage chat_id:int53 sender_id:MessageSender reply_to:InputMessageReplyTo disable_notification:Bool input_message_content:InputMessageContent = Message; -//@description Deletes messages @chat_id Chat identifier @message_ids Identifiers of the messages to be deleted @revoke Pass true to delete messages for all chat members. Always true for supergroups, channels and secret chats +//@description Deletes messages +//@chat_id Chat identifier +//@message_ids Identifiers of the messages to be deleted. Use messageProperties.can_be_deleted_only_for_self and messageProperties.can_be_deleted_for_all_users to get suitable messages +//@revoke Pass true to delete messages for all chat members. Always true for supergroups, channels and secret chats deleteMessages chat_id:int53 message_ids:vector<int53> revoke:Bool = Ok; //@description Deletes all messages sent by the specified message sender in a chat. Supported only for supergroups; requires can_delete_messages administrator privileges @chat_id Chat identifier @sender_id Identifier of the sender of messages to delete @@ -6326,38 +8840,43 @@ deleteChatMessagesByDate chat_id:int53 min_date:int32 max_date:int32 revoke:Bool //@description Edits the text of a message (or a text of a game message). Returns the edited message after the edit is completed on the server side //@chat_id The chat the message belongs to -//@message_id Identifier of the message +//@message_id Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited //@reply_markup The new message reply markup; pass null if none; for bots only //@input_message_content New text content of the message. Must be of type inputMessageText editMessageText chat_id:int53 message_id:int53 reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; -//@description Edits the message content of a live location. Messages can be edited for a limited period of time specified in the live location. Returns the edited message after the edit is completed on the server side +//@description Edits the message content of a live location. Messages can be edited for a limited period of time specified in the live location. +//-Returns the edited message after the edit is completed on the server side //@chat_id The chat the message belongs to -//@message_id Identifier of the message +//@message_id Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited //@reply_markup The new message reply markup; pass null if none; for bots only //@location New location content of the message; pass null to stop sharing the live location +//@live_period New time relative to the message send date, for which the location can be updated, in seconds. If 0x7FFFFFFF specified, then the location can be updated forever. +//-Otherwise, must not exceed the current live_period by more than a day, and the live location expiration date must remain in the next 90 days. Pass 0 to keep the current live_period //@heading The new direction in which the location moves, in degrees; 1-360. Pass 0 if unknown //@proximity_alert_radius The new maximum distance for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled -editMessageLiveLocation chat_id:int53 message_id:int53 reply_markup:ReplyMarkup location:location heading:int32 proximity_alert_radius:int32 = Message; +editMessageLiveLocation chat_id:int53 message_id:int53 reply_markup:ReplyMarkup location:location live_period:int32 heading:int32 proximity_alert_radius:int32 = Message; //@description Edits the content of a message with an animation, an audio, a document, a photo or a video, including message caption. If only the caption needs to be edited, use editMessageCaption instead. -//-The media can't be edited if the message was set to self-destruct or to a self-destructing media. The type of message content in an album can't be changed with exception of replacing a photo with a video or vice versa. Returns the edited message after the edit is completed on the server side +//-The media can't be edited if the message was set to self-destruct or to a self-destructing media. The type of message content in an album can't be changed with exception of replacing a photo with a video or vice versa. +//-Returns the edited message after the edit is completed on the server side //@chat_id The chat the message belongs to -//@message_id Identifier of the message +//@message_id Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited //@reply_markup The new message reply markup; pass null if none; for bots only //@input_message_content New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto or inputMessageVideo editMessageMedia chat_id:int53 message_id:int53 reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; //@description Edits the message content caption. Returns the edited message after the edit is completed on the server side //@chat_id The chat the message belongs to -//@message_id Identifier of the message +//@message_id Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited //@reply_markup The new message reply markup; pass null if none; for bots only //@caption New message content caption; 0-getOption("message_caption_length_max") characters; pass null to remove caption -editMessageCaption chat_id:int53 message_id:int53 reply_markup:ReplyMarkup caption:formattedText = Message; +//@show_caption_above_media Pass true to show the caption above the media; otherwise, the caption will be shown below the media. Can be true only for animation, photo, and video messages +editMessageCaption chat_id:int53 message_id:int53 reply_markup:ReplyMarkup caption:formattedText show_caption_above_media:Bool = Message; //@description Edits the message reply markup; for bots only. Returns the edited message after the edit is completed on the server side //@chat_id The chat the message belongs to -//@message_id Identifier of the message +//@message_id Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited //@reply_markup The new message reply markup; pass null if none editMessageReplyMarkup chat_id:int53 message_id:int53 reply_markup:ReplyMarkup = Message; @@ -6371,9 +8890,11 @@ editInlineMessageText inline_message_id:string reply_markup:ReplyMarkup input_me //@inline_message_id Inline message identifier //@reply_markup The new message reply markup; pass null if none //@location New location content of the message; pass null to stop sharing the live location +//@live_period New time relative to the message send date, for which the location can be updated, in seconds. If 0x7FFFFFFF specified, then the location can be updated forever. +//-Otherwise, must not exceed the current live_period by more than a day, and the live location expiration date must remain in the next 90 days. Pass 0 to keep the current live_period //@heading The new direction in which the location moves, in degrees; 1-360. Pass 0 if unknown //@proximity_alert_radius The new maximum distance for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled -editInlineMessageLiveLocation inline_message_id:string reply_markup:ReplyMarkup location:location heading:int32 proximity_alert_radius:int32 = Ok; +editInlineMessageLiveLocation inline_message_id:string reply_markup:ReplyMarkup location:location live_period:int32 heading:int32 proximity_alert_radius:int32 = Ok; //@description Edits the content of a message with an animation, an audio, a document, a photo or a video in an inline message sent via a bot; for bots only //@inline_message_id Inline message identifier @@ -6385,7 +8906,8 @@ editInlineMessageMedia inline_message_id:string reply_markup:ReplyMarkup input_m //@inline_message_id Inline message identifier //@reply_markup The new message reply markup; pass null if none //@caption New message content caption; pass null to remove caption; 0-getOption("message_caption_length_max") characters -editInlineMessageCaption inline_message_id:string reply_markup:ReplyMarkup caption:formattedText = Ok; +//@show_caption_above_media Pass true to show the caption above the media; otherwise, the caption will be shown below the media. Can be true only for animation, photo, and video messages +editInlineMessageCaption inline_message_id:string reply_markup:ReplyMarkup caption:formattedText show_caption_above_media:Bool = Ok; //@description Edits the reply markup of an inline message sent via a bot; for bots only //@inline_message_id Inline message identifier @@ -6394,21 +8916,169 @@ editInlineMessageReplyMarkup inline_message_id:string reply_markup:ReplyMarkup = //@description Edits the time when a scheduled message will be sent. Scheduling state of all messages in the same album or forwarded together with the message will be also changed //@chat_id The chat the message belongs to -//@message_id Identifier of the message +//@message_id Identifier of the message. Use messageProperties.can_edit_scheduling_state to check whether the message is suitable //@scheduling_state The new message scheduling state; pass null to send the message immediately editMessageSchedulingState chat_id:int53 message_id:int53 scheduling_state:MessageSchedulingState = Ok; +//@description Changes the fact-check of a message. Can be only used if messageProperties.can_set_fact_check == true +//@chat_id The channel chat the message belongs to +//@message_id Identifier of the message +//@text New text of the fact-check; 0-getOption("fact_check_length_max") characters; pass null to remove it. Only Bold, Italic, and TextUrl entities with https://t.me/ links are supported +setMessageFactCheck chat_id:int53 message_id:int53 text:formattedText = Ok; + + +//@description Sends a message on behalf of a business account; for bots only. Returns the message after it was sent +//@business_connection_id Unique identifier of business connection on behalf of which to send the request +//@chat_id Target chat +//@reply_to Information about the message to be replied; pass null if none +//@disable_notification Pass true to disable notification for the message +//@protect_content Pass true if the content of the message must be protected from forwarding and saving +//@effect_id Identifier of the effect to apply to the message +//@reply_markup Markup for replying to the message; pass null if none +//@input_message_content The content of the message to be sent +sendBusinessMessage business_connection_id:string chat_id:int53 reply_to:InputMessageReplyTo disable_notification:Bool protect_content:Bool effect_id:int64 reply_markup:ReplyMarkup input_message_content:InputMessageContent = BusinessMessage; + +//@description Sends 2-10 messages grouped together into an album on behalf of a business account; for bots only. Currently, only audio, document, photo and video messages can be grouped into an album. +//-Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages +//@business_connection_id Unique identifier of business connection on behalf of which to send the request +//@chat_id Target chat +//@reply_to Information about the message to be replied; pass null if none +//@disable_notification Pass true to disable notification for the message +//@protect_content Pass true if the content of the message must be protected from forwarding and saving +//@effect_id Identifier of the effect to apply to the message +//@input_message_contents Contents of messages to be sent. At most 10 messages can be added to an album. All messages must have the same value of show_caption_above_media +sendBusinessMessageAlbum business_connection_id:string chat_id:int53 reply_to:InputMessageReplyTo disable_notification:Bool protect_content:Bool effect_id:int64 input_message_contents:vector<InputMessageContent> = BusinessMessages; + +//@description Edits the text of a text or game message sent on behalf of a business account; for bots only +//@business_connection_id Unique identifier of business connection on behalf of which the message was sent +//@chat_id The chat the message belongs to +//@message_id Identifier of the message +//@reply_markup The new message reply markup; pass null if none +//@input_message_content New text content of the message. Must be of type inputMessageText +editBusinessMessageText business_connection_id:string chat_id:int53 message_id:int53 reply_markup:ReplyMarkup input_message_content:InputMessageContent = BusinessMessage; -//@description Returns list of custom emojis, which can be used as forum topic icon by all users +//@description Edits the content of a live location in a message sent on behalf of a business account; for bots only +//@business_connection_id Unique identifier of business connection on behalf of which the message was sent +//@chat_id The chat the message belongs to +//@message_id Identifier of the message +//@reply_markup The new message reply markup; pass null if none +//@location New location content of the message; pass null to stop sharing the live location +//@live_period New time relative to the message send date, for which the location can be updated, in seconds. If 0x7FFFFFFF specified, then the location can be updated forever. +//-Otherwise, must not exceed the current live_period by more than a day, and the live location expiration date must remain in the next 90 days. Pass 0 to keep the current live_period +//@heading The new direction in which the location moves, in degrees; 1-360. Pass 0 if unknown +//@proximity_alert_radius The new maximum distance for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled +editBusinessMessageLiveLocation business_connection_id:string chat_id:int53 message_id:int53 reply_markup:ReplyMarkup location:location live_period:int32 heading:int32 proximity_alert_radius:int32 = BusinessMessage; + +//@description Edits the content of a message with an animation, an audio, a document, a photo or a video in a message sent on behalf of a business account; for bots only +//@business_connection_id Unique identifier of business connection on behalf of which the message was sent +//@chat_id The chat the message belongs to +//@message_id Identifier of the message +//@reply_markup The new message reply markup; pass null if none; for bots only +//@input_message_content New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto or inputMessageVideo +editBusinessMessageMedia business_connection_id:string chat_id:int53 message_id:int53 reply_markup:ReplyMarkup input_message_content:InputMessageContent = BusinessMessage; + +//@description Edits the caption of a message sent on behalf of a business account; for bots only +//@business_connection_id Unique identifier of business connection on behalf of which the message was sent +//@chat_id The chat the message belongs to +//@message_id Identifier of the message +//@reply_markup The new message reply markup; pass null if none +//@caption New message content caption; pass null to remove caption; 0-getOption("message_caption_length_max") characters +//@show_caption_above_media Pass true to show the caption above the media; otherwise, the caption will be shown below the media. Can be true only for animation, photo, and video messages +editBusinessMessageCaption business_connection_id:string chat_id:int53 message_id:int53 reply_markup:ReplyMarkup caption:formattedText show_caption_above_media:Bool = BusinessMessage; + +//@description Edits the reply markup of a message sent on behalf of a business account; for bots only +//@business_connection_id Unique identifier of business connection on behalf of which the message was sent +//@chat_id The chat the message belongs to +//@message_id Identifier of the message +//@reply_markup The new message reply markup; pass null if none +editBusinessMessageReplyMarkup business_connection_id:string chat_id:int53 message_id:int53 reply_markup:ReplyMarkup = BusinessMessage; + +//@description Stops a poll sent on behalf of a business account; for bots only +//@business_connection_id Unique identifier of business connection on behalf of which the message with the poll was sent +//@chat_id The chat the message belongs to +//@message_id Identifier of the message containing the poll +//@reply_markup The new message reply markup; pass null if none +stopBusinessPoll business_connection_id:string chat_id:int53 message_id:int53 reply_markup:ReplyMarkup = BusinessMessage; + +//@description Pins or unpins a message sent on behalf of a business account; for bots only +//@business_connection_id Unique identifier of business connection on behalf of which the message was sent +//@chat_id The chat the message belongs to +//@message_id Identifier of the message +//@is_pinned Pass true to pin the message, pass false to unpin it +setBusinessMessageIsPinned business_connection_id:string chat_id:int53 message_id:int53 is_pinned:Bool = Ok; + + +//@description Checks validness of a name for a quick reply shortcut. Can be called synchronously @name The name of the shortcut; 1-32 characters +checkQuickReplyShortcutName name:string = Ok; + +//@description Loads quick reply shortcuts created by the current user. The loaded data will be sent through updateQuickReplyShortcut and updateQuickReplyShortcuts +loadQuickReplyShortcuts = Ok; + +//@description Changes name of a quick reply shortcut @shortcut_id Unique identifier of the quick reply shortcut @name New name for the shortcut. Use checkQuickReplyShortcutName to check its validness +setQuickReplyShortcutName shortcut_id:int32 name:string = Ok; + +//@description Deletes a quick reply shortcut @shortcut_id Unique identifier of the quick reply shortcut +deleteQuickReplyShortcut shortcut_id:int32 = Ok; + +//@description Changes the order of quick reply shortcuts @shortcut_ids The new order of quick reply shortcuts +reorderQuickReplyShortcuts shortcut_ids:vector<int32> = Ok; + +//@description Loads quick reply messages that can be sent by a given quick reply shortcut. The loaded messages will be sent through updateQuickReplyShortcutMessages +//@shortcut_id Unique identifier of the quick reply shortcut +loadQuickReplyShortcutMessages shortcut_id:int32 = Ok; + +//@description Deletes specified quick reply messages +//@shortcut_id Unique identifier of the quick reply shortcut to which the messages belong +//@message_ids Unique identifiers of the messages +deleteQuickReplyShortcutMessages shortcut_id:int32 message_ids:vector<int53> = Ok; + +//@description Adds a message to a quick reply shortcut. If shortcut doesn't exist and there are less than getOption("quick_reply_shortcut_count_max") shortcuts, then a new shortcut is created. +//-The shortcut must not contain more than getOption("quick_reply_shortcut_message_count_max") messages after adding the new message. Returns the added message +//@shortcut_name Name of the target shortcut +//@reply_to_message_id Identifier of a quick reply message in the same shortcut to be replied; pass 0 if none +//@input_message_content The content of the message to be added; inputMessagePoll, inputMessageForwarded and inputMessageLocation with live_period aren't supported +addQuickReplyShortcutMessage shortcut_name:string reply_to_message_id:int53 input_message_content:InputMessageContent = QuickReplyMessage; + +//@description Adds a message to a quick reply shortcut via inline bot. If shortcut doesn't exist and there are less than getOption("quick_reply_shortcut_count_max") shortcuts, then a new shortcut is created. +//-The shortcut must not contain more than getOption("quick_reply_shortcut_message_count_max") messages after adding the new message. Returns the added message +//@shortcut_name Name of the target shortcut +//@reply_to_message_id Identifier of a quick reply message in the same shortcut to be replied; pass 0 if none +//@query_id Identifier of the inline query +//@result_id Identifier of the inline query result +//@hide_via_bot Pass true to hide the bot, via which the message is sent. Can be used only for bots getOption("animation_search_bot_username"), getOption("photo_search_bot_username"), and getOption("venue_search_bot_username") +addQuickReplyShortcutInlineQueryResultMessage shortcut_name:string reply_to_message_id:int53 query_id:int64 result_id:string hide_via_bot:Bool = QuickReplyMessage; + +//@description Adds 2-10 messages grouped together into an album to a quick reply shortcut. Currently, only audio, document, photo and video messages can be grouped into an album. +//-Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages +//@shortcut_name Name of the target shortcut +//@reply_to_message_id Identifier of a quick reply message in the same shortcut to be replied; pass 0 if none +//@input_message_contents Contents of messages to be sent. At most 10 messages can be added to an album. All messages must have the same value of show_caption_above_media +addQuickReplyShortcutMessageAlbum shortcut_name:string reply_to_message_id:int53 input_message_contents:vector<InputMessageContent> = QuickReplyMessages; + +//@description Readds quick reply messages which failed to add. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. +//-If a message is readded, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be readded, null will be returned instead of the message +//@shortcut_name Name of the target shortcut +//@message_ids Identifiers of the quick reply messages to readd. Message identifiers must be in a strictly increasing order +readdQuickReplyShortcutMessages shortcut_name:string message_ids:vector<int53> = QuickReplyMessages; + +//@description Asynchronously edits the text, media or caption of a quick reply message. Use quickReplyMessage.can_be_edited to check whether a message can be edited. +//-Text message can be edited only to a text message. The type of message content in an album can't be changed with exception of replacing a photo with a video or vice versa +//@shortcut_id Unique identifier of the quick reply shortcut with the message +//@message_id Identifier of the message +//@input_message_content New content of the message. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto or inputMessageVideo +editQuickReplyMessage shortcut_id:int32 message_id:int53 input_message_content:InputMessageContent = Ok; + + +//@description Returns the list of custom emoji, which can be used as forum topic icon by all users getForumTopicDefaultIcons = Stickers; -//@description Creates a topic in a forum supergroup chat; requires can_manage_topics rights in the supergroup +//@description Creates a topic in a forum supergroup chat; requires can_manage_topics administrator or can_create_topics member right in the supergroup //@chat_id Identifier of the chat //@name Name of the topic; 1-128 characters //@icon Icon of the topic. Icon color must be one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F. Telegram Premium users can use any custom emoji as topic icon, other users can use only a custom emoji returned by getForumTopicDefaultIcons createForumTopic chat_id:int53 name:string icon:forumTopicIcon = ForumTopicInfo; -//@description Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless the user is creator of the topic +//@description Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics right in the supergroup unless the user is creator of the topic //@chat_id Identifier of the chat //@message_thread_id Message thread identifier of the forum topic //@name New name of the topic; 0-128 characters. If empty, the previous topic name is kept @@ -6437,24 +9107,24 @@ getForumTopics chat_id:int53 query:string offset_date:int32 offset_message_id:in //@notification_settings New notification settings for the forum topic. If the topic is muted for more than 366 days, it is considered to be muted forever setForumTopicNotificationSettings chat_id:int53 message_thread_id:int53 notification_settings:chatNotificationSettings = Ok; -//@description Toggles whether a topic is closed in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless the user is creator of the topic +//@description Toggles whether a topic is closed in a forum supergroup chat; requires can_manage_topics right in the supergroup unless the user is creator of the topic //@chat_id Identifier of the chat //@message_thread_id Message thread identifier of the forum topic //@is_closed Pass true to close the topic; pass false to reopen it toggleForumTopicIsClosed chat_id:int53 message_thread_id:int53 is_closed:Bool = Ok; -//@description Toggles whether a General topic is hidden in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup +//@description Toggles whether a General topic is hidden in a forum supergroup chat; requires can_manage_topics right in the supergroup //@chat_id Identifier of the chat //@is_hidden Pass true to hide and close the General topic; pass false to unhide it toggleGeneralForumTopicIsHidden chat_id:int53 is_hidden:Bool = Ok; -//@description Changes the pinned state of a forum topic; requires can_manage_topics administrator right in the supergroup. There can be up to getOption("pinned_forum_topic_count_max") pinned forum topics +//@description Changes the pinned state of a forum topic; requires can_manage_topics right in the supergroup. There can be up to getOption("pinned_forum_topic_count_max") pinned forum topics //@chat_id Chat identifier //@message_thread_id Message thread identifier of the forum topic //@is_pinned Pass true to pin the topic; pass false to unpin it toggleForumTopicIsPinned chat_id:int53 message_thread_id:int53 is_pinned:Bool = Ok; -//@description Changes the order of pinned forum topics @chat_id Chat identifier @message_thread_ids The new list of pinned forum topics +//@description Changes the order of pinned forum topics; requires can_manage_topics right in the supergroup @chat_id Chat identifier @message_thread_ids The new list of pinned forum topics setPinnedForumTopics chat_id:int53 message_thread_ids:vector<int53> = Ok; //@description Deletes all messages in a forum topic; requires can_delete_messages administrator right in the supergroup unless the user is creator of the topic, the topic has no messages from other users and has at most 11 messages @@ -6463,7 +9133,7 @@ setPinnedForumTopics chat_id:int53 message_thread_ids:vector<int53> = Ok; deleteForumTopic chat_id:int53 message_thread_id:int53 = Ok; -//@description Returns information about a emoji reaction. Returns a 404 error if the reaction is not found @emoji Text representation of the reaction +//@description Returns information about an emoji reaction. Returns a 404 error if the reaction is not found @emoji Text representation of the reaction getEmojiReaction emoji:string = EmojiReaction; //@description Returns TGS stickers with generic animations for custom emoji reactions @@ -6478,36 +9148,82 @@ getMessageAvailableReactions chat_id:int53 message_id:int53 row_size:int32 = Ava //@description Clears the list of recently used reactions clearRecentReactions = Ok; -//@description Adds a reaction to a message. Use getMessageAvailableReactions to receive the list of available reactions for the message +//@description Adds a reaction or a tag to a message. Use getMessageAvailableReactions to receive the list of available reactions for the message //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message -//@reaction_type Type of the reaction to add +//@reaction_type Type of the reaction to add. Use addPendingPaidMessageReaction instead to add the paid reaction //@is_big Pass true if the reaction is added with a big animation -//@update_recent_reactions Pass true if the reaction needs to be added to recent reactions +//@update_recent_reactions Pass true if the reaction needs to be added to recent reactions; tags are never added to the list of recent reactions addMessageReaction chat_id:int53 message_id:int53 reaction_type:ReactionType is_big:Bool update_recent_reactions:Bool = Ok; //@description Removes a reaction from a message. A chosen reaction can always be removed //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message -//@reaction_type Type of the reaction to remove +//@reaction_type Type of the reaction to remove. The paid reaction can't be removed removeMessageReaction chat_id:int53 message_id:int53 reaction_type:ReactionType = Ok; -//@description Returns reactions added for a message, along with their sender +//@description Adds the paid message reaction to a message. Use getMessageAvailableReactions to check whether the reaction is available for the message //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message -//@reaction_type Type of the reactions to return; pass null to return all added reactions +//@star_count Number of Telegram Stars to be used for the reaction. The total number of pending paid reactions must not exceed getOption("paid_reaction_star_count_max") +//@use_default_is_anonymous Pass true if the user didn't choose anonymity explicitly, for example, the reaction is set from the message bubble +//@is_anonymous Pass true to make paid reaction of the user on the message anonymous; pass false to make the user's profile visible among top reactors. Ignored if use_default_is_anonymous == true +addPendingPaidMessageReaction chat_id:int53 message_id:int53 star_count:int53 use_default_is_anonymous:Bool is_anonymous:Bool = Ok; + +//@description Applies all pending paid reactions on a message @chat_id Identifier of the chat to which the message belongs @message_id Identifier of the message +commitPendingPaidMessageReactions chat_id:int53 message_id:int53 = Ok; + +//@description Removes all pending paid reactions on a message @chat_id Identifier of the chat to which the message belongs @message_id Identifier of the message +removePendingPaidMessageReactions chat_id:int53 message_id:int53 = Ok; + +//@description Changes whether the paid message reaction of the user to a message is anonymous. The message must have paid reaction added by the user +//@chat_id Identifier of the chat to which the message belongs +//@message_id Identifier of the message +//@is_anonymous Pass true to make paid reaction of the user on the message anonymous; pass false to make the user's profile visible among top reactors +togglePaidMessageReactionIsAnonymous chat_id:int53 message_id:int53 is_anonymous:Bool = Ok; + +//@description Sets reactions on a message; for bots only +//@chat_id Identifier of the chat to which the message belongs +//@message_id Identifier of the message +//@reaction_types Types of the reaction to set +//@is_big Pass true if the reactions are added with a big animation +setMessageReactions chat_id:int53 message_id:int53 reaction_types:vector<ReactionType> is_big:Bool = Ok; + +//@description Returns reactions added for a message, along with their sender +//@chat_id Identifier of the chat to which the message belongs +//@message_id Identifier of the message. Use message.interaction_info.reactions.can_get_added_reactions to check whether added reactions can be received for the message +//@reaction_type Type of the reactions to return; pass null to return all added reactions; reactionTypePaid isn't supported //@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results //@limit The maximum number of reactions to be returned; must be positive and can't be greater than 100 getMessageAddedReactions chat_id:int53 message_id:int53 reaction_type:ReactionType offset:string limit:int32 = AddedReactions; -//@description Changes type of default reaction for the current user @reaction_type New type of the default reaction +//@description Changes type of default reaction for the current user @reaction_type New type of the default reaction. The paid reaction can't be set as default setDefaultReactionType reaction_type:ReactionType = Ok; +//@description Returns tags used in Saved Messages or a Saved Messages topic +//@saved_messages_topic_id Identifier of Saved Messages topic which tags will be returned; pass 0 to get all Saved Messages tags +getSavedMessagesTags saved_messages_topic_id:int53 = SavedMessagesTags; + +//@description Changes label of a Saved Messages tag; for Telegram Premium users only @tag The tag which label will be changed @label New label for the tag; 0-12 characters +setSavedMessagesTagLabel tag:ReactionType label:string = Ok; + +//@description Returns information about a message effect. Returns a 404 error if the effect is not found @effect_id Unique identifier of the effect +getMessageEffect effect_id:int64 = MessageEffect; + + +//@description Searches for a given quote in a text. Returns found quote start position in UTF-16 code units. Returns a 404 error if the quote is not found. Can be called synchronously +//@text Text in which to search for the quote +//@quote Quote to search for +//@quote_position Approximate quote position in UTF-16 code units +searchQuote text:formattedText quote:formattedText quote_position:int32 = FoundPosition; //@description Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously @text The text in which to look for entities getTextEntities text:string = TextEntities; -//@description Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously @text The text to parse @parse_mode Text parse mode +//@description Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, ExpandableBlockQuote, Code, Pre, PreCode, TextUrl +//-and MentionName entities from a marked-up text. Can be called synchronously +//@text The text to parse +//@parse_mode Text parse mode parseTextEntities text:string parse_mode:TextParseMode = FormattedText; //@description Parses Markdown entities in a human-friendly format, ignoring markup errors. Can be called synchronously @@ -6517,6 +9233,9 @@ parseMarkdown text:formattedText = FormattedText; //@description Replaces text entities with Markdown formatting in a human-friendly format. Entities that can't be represented in Markdown unambiguously are kept as is. Can be called synchronously @text The text getMarkdownText text:formattedText = FormattedText; +//@description Returns an emoji for the given country. Returns an empty string on failure. Can be called synchronously @country_code A two-letter ISO 3166-1 alpha-2 country code as received from getCountries +getCountryFlagEmoji country_code:string = Text; + //@description Returns the MIME type of a file, guessed by its extension. Returns an empty string on failure. Can be called synchronously @file_name The name of the file or path to the file getFileMimeType file_name:string = Text; @@ -6549,17 +9268,17 @@ getThemeParametersJsonString theme:themeParameters = Text; //@option_ids 0-based identifiers of answer options, chosen by the user. User can choose more than 1 answer option only is the poll allows multiple answers setPollAnswer chat_id:int53 message_id:int53 option_ids:vector<int32> = Ok; -//@description Returns users voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib +//@description Returns message senders voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib //@chat_id Identifier of the chat to which the poll belongs //@message_id Identifier of the message containing the poll //@option_id 0-based identifier of the answer option -//@offset Number of users to skip in the result; must be non-negative -//@limit The maximum number of users to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned users is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached -getPollVoters chat_id:int53 message_id:int53 option_id:int32 offset:int32 limit:int32 = Users; +//@offset Number of voters to skip in the result; must be non-negative +//@limit The maximum number of voters to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned voters is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached +getPollVoters chat_id:int53 message_id:int53 option_id:int32 offset:int32 limit:int32 = MessageSenders; -//@description Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag set +//@description Stops a poll //@chat_id Identifier of the chat to which the poll belongs -//@message_id Identifier of the message containing the poll +//@message_id Identifier of the message containing the poll. Use messageProperties.can_be_edited to check whether the poll can be stopped //@reply_markup The new message reply markup; pass null if none; for bots only stopPoll chat_id:int53 message_id:int53 reply_markup:ReplyMarkup = Ok; @@ -6567,10 +9286,17 @@ stopPoll chat_id:int53 message_id:int53 reply_markup:ReplyMarkup = Ok; //@description Hides a suggested action @action Suggested action to hide hideSuggestedAction action:SuggestedAction = Ok; +//@description Hides the list of contacts that have close birthdays for 24 hours +hideContactCloseBirthdays = Ok; + + +//@description Returns information about a business connection by its identifier; for bots only @connection_id Identifier of the business connection to return +getBusinessConnection connection_id:string = BusinessConnection; + //@description Returns information about a button of type inlineKeyboardButtonTypeLoginUrl. The method needs to be called when the user presses the button //@chat_id Chat identifier of the message with the button -//@message_id Message identifier of the message with the button +//@message_id Message identifier of the message with the button. The message must not be scheduled //@button_id Button identifier getLoginUrlInfo chat_id:int53 message_id:int53 button_id:int53 = LoginUrlInfo; @@ -6583,13 +9309,13 @@ getLoginUrlInfo chat_id:int53 message_id:int53 button_id:int53 = LoginUrlInfo; getLoginUrl chat_id:int53 message_id:int53 button_id:int53 allow_write_access:Bool = HttpUrl; -//@description Shares a user after pressing a keyboardButtonTypeRequestUser button with the bot +//@description Shares users after pressing a keyboardButtonTypeRequestUsers button with the bot //@chat_id Identifier of the chat with the bot //@message_id Identifier of the message with the button //@button_id Identifier of the button -//@shared_user_id Identifier of the shared user -//@only_check Pass true to check that the user can be shared by the button instead of actually sharing them -shareUserWithBot chat_id:int53 message_id:int53 button_id:int32 shared_user_id:int53 only_check:Bool = Ok; +//@shared_user_ids Identifiers of the shared users +//@only_check Pass true to check that the users can be shared by the button instead of actually sharing them +shareUsersWithBot chat_id:int53 message_id:int53 button_id:int32 shared_user_ids:vector<int53> only_check:Bool = Ok; //@description Shares a chat after pressing a keyboardButtonTypeRequestChat button with the bot //@chat_id Identifier of the chat with the bot @@ -6607,7 +9333,7 @@ shareChatWithBot chat_id:int53 message_id:int53 button_id:int32 shared_chat_id:i //@chat_id Identifier of the chat where the query was sent //@user_location Location of the user; pass null if unknown or the bot doesn't need user's location //@query Text of the query -//@offset Offset of the first entry to return +//@offset Offset of the first entry to return; use empty string to get the first chunk of results getInlineQueryResults bot_user_id:int53 chat_id:int53 user_location:location query:string offset:string = InlineQueryResults; //@description Sets the result of an inline query; for bots only @@ -6620,6 +9346,11 @@ getInlineQueryResults bot_user_id:int53 chat_id:int53 user_location:location que answerInlineQuery inline_query_id:int64 is_personal:Bool button:inlineQueryResultsButton results:vector<InputInlineQueryResult> cache_time:int32 next_offset:string = Ok; +//@description Returns the most grossing Web App bots +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of bots to be returned; up to 100 +getGrossingWebAppBots offset:string limit:int32 = FoundUsers; + //@description Returns information about a Web App by its short name. Returns a 404 error if the Web App is not found //@bot_user_id Identifier of the target bot //@web_app_short_name Short name of the Web App @@ -6631,15 +9362,23 @@ searchWebApp bot_user_id:int53 web_app_short_name:string = FoundWebApp; //@web_app_short_name Short name of the Web App //@start_parameter Start parameter from internalLinkTypeWebApp //@theme Preferred Web App theme; pass null to use the default theme -//@application_name Short name of the application; 0-64 English letters, digits, and underscores +//@application_name Short name of the current application; 0-64 English letters, digits, and underscores //@allow_write_access Pass true if the current user allowed the bot to send them messages getWebAppLinkUrl chat_id:int53 bot_user_id:int53 web_app_short_name:string start_parameter:string theme:themeParameters application_name:string allow_write_access:Bool = HttpUrl; -//@description Returns an HTTPS URL of a Web App to open after keyboardButtonTypeWebApp or inlineQueryResultsButtonTypeWebApp button is pressed +//@description Returns information needed to open the main Web App of a bot +//@chat_id Identifier of the chat in which the Web App is opened; pass 0 if none //@bot_user_id Identifier of the target bot -//@url The URL from the keyboardButtonTypeWebApp or inlineQueryResultsButtonTypeWebApp button +//@start_parameter Start parameter from internalLinkTypeMainWebApp //@theme Preferred Web App theme; pass null to use the default theme -//@application_name Short name of the application; 0-64 English letters, digits, and underscores +//@application_name Short name of the current application; 0-64 English letters, digits, and underscores +getMainWebApp chat_id:int53 bot_user_id:int53 start_parameter:string theme:themeParameters application_name:string = MainWebApp; + +//@description Returns an HTTPS URL of a Web App to open from the side menu, a keyboardButtonTypeWebApp button, or an inlineQueryResultsButtonTypeWebApp button +//@bot_user_id Identifier of the target bot +//@url The URL from a keyboardButtonTypeWebApp button, inlineQueryResultsButtonTypeWebApp button, or an empty string when the bot is opened from the side menu +//@theme Preferred Web App theme; pass null to use the default theme +//@application_name Short name of the current application; 0-64 English letters, digits, and underscores getWebAppUrl bot_user_id:int53 url:string theme:themeParameters application_name:string = HttpUrl; //@description Sends data received from a keyboardButtonTypeWebApp Web App to a bot @@ -6648,16 +9387,16 @@ getWebAppUrl bot_user_id:int53 url:string theme:themeParameters application_name //@data The data sendWebAppData bot_user_id:int53 button_text:string data:string = Ok; -//@description Informs TDLib that a Web App is being opened from attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. +//@description Informs TDLib that a Web App is being opened from the attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. //-For each bot, a confirmation alert about data sent to the bot must be shown once //@chat_id Identifier of the chat in which the Web App is opened. The Web App can't be opened in secret chats //@bot_user_id Identifier of the bot, providing the Web App -//@url The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, or an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise +//@url The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise //@theme Preferred Web App theme; pass null to use the default theme -//@application_name Short name of the application; 0-64 English letters, digits, and underscores -//@message_thread_id If not 0, a message thread identifier in which the message will be sent -//@reply_to_message_id Identifier of the replied message for the message sent by the Web App; 0 if none -openWebApp chat_id:int53 bot_user_id:int53 url:string theme:themeParameters application_name:string message_thread_id:int53 reply_to_message_id:int53 = WebAppInfo; +//@application_name Short name of the current application; 0-64 English letters, digits, and underscores +//@message_thread_id If not 0, the message thread identifier in which the message will be sent +//@reply_to Information about the message or story to be replied in the message sent by the Web App; pass null if none +openWebApp chat_id:int53 bot_user_id:int53 url:string theme:themeParameters application_name:string message_thread_id:int53 reply_to:InputMessageReplyTo = WebAppInfo; //@description Informs TDLib that a previously opened Web App was closed @web_app_launch_id Identifier of Web App launch, received from openWebApp closeWebApp web_app_launch_id:int64 = Ok; @@ -6670,7 +9409,7 @@ answerWebAppQuery web_app_query_id:string result:InputInlineQueryResult = SentWe //@description Sends a callback query to a bot and returns an answer. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires //@chat_id Identifier of the chat with the message -//@message_id Identifier of the message from which the query originated +//@message_id Identifier of the message from which the query originated. The message must not be scheduled //@payload Query payload getCallbackQueryAnswer chat_id:int53 message_id:int53 payload:CallbackQueryPayload = CallbackQueryAnswer; @@ -6720,8 +9459,12 @@ getInlineGameHighScores inline_message_id:string user_id:int53 = GameHighScores; deleteChatReplyMarkup chat_id:int53 message_id:int53 = Ok; -//@description Sends a notification about user activity in a chat @chat_id Chat identifier @message_thread_id If not 0, a message thread identifier in which the action was performed @action The action description; pass null to cancel the currently active action -sendChatAction chat_id:int53 message_thread_id:int53 action:ChatAction = Ok; +//@description Sends a notification about user activity in a chat +//@chat_id Chat identifier +//@message_thread_id If not 0, the message thread identifier in which the action was performed +//@business_connection_id Unique identifier of business connection on behalf of which to send the request; for bots only +//@action The action description; pass null to cancel the currently active action +sendChatAction chat_id:int53 message_thread_id:int53 business_connection_id:string action:ChatAction = Ok; //@description Informs TDLib that the chat is opened by the user. Many useful activities depend on the chat being opened or closed (e.g., in supergroups and channels all updates are received only for opened chats) @chat_id Chat identifier @@ -6750,10 +9493,10 @@ clickAnimatedEmojiMessage chat_id:int53 message_id:int53 = Sticker; //@description Returns an HTTPS or a tg: link with the given type. Can be called before authorization @type Expected type of the link @is_http Pass true to create an HTTPS link (only available for some link types); pass false to create a tg: link getInternalLink type:InternalLinkType is_http:Bool = HttpUrl; -//@description Returns information about the type of an internal link. Returns a 404 error if the link is not internal. Can be called before authorization @link The link +//@description Returns information about the type of internal link. Returns a 404 error if the link is not internal. Can be called before authorization @link The link getInternalLinkType link:string = InternalLinkType; -//@description Returns information about an action to be done when the current user clicks an external link. Don't use this method for links from secret chats if web page preview is disabled in secret chats @link The link +//@description Returns information about an action to be done when the current user clicks an external link. Don't use this method for links from secret chats if link preview is disabled in secret chats @link The link getExternalLinkInfo link:string = LoginUrlInfo; //@description Returns an HTTP URL which can be used to automatically authorize the current user on a website after clicking an HTTP link. Use the method getExternalLinkInfo to find whether a prior user confirmation is needed @@ -6787,11 +9530,11 @@ createSupergroupChat supergroup_id:int53 force:Bool = Chat; //@description Returns an existing chat corresponding to a known secret chat @secret_chat_id Secret chat identifier createSecretChat secret_chat_id:int32 = Chat; -//@description Creates a new basic group and sends a corresponding messageBasicGroupChatCreate. Returns the newly created chat +//@description Creates a new basic group and sends a corresponding messageBasicGroupChatCreate. Returns information about the newly created chat //@user_ids Identifiers of users to be added to the basic group; may be empty to create a basic group without other members //@title Title of the new basic group; 1-128 characters //@message_auto_delete_time Message auto-delete time value, in seconds; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically -createNewBasicGroupChat user_ids:vector<int53> title:string message_auto_delete_time:int32 = Chat; +createNewBasicGroupChat user_ids:vector<int53> title:string message_auto_delete_time:int32 = CreatedBasicGroupChat; //@description Creates a new supergroup or channel and sends a corresponding messageSupergroupChatCreate. Returns the newly created chat //@title Title of the new chat; 1-128 characters @@ -6800,13 +9543,13 @@ createNewBasicGroupChat user_ids:vector<int53> title:string message_auto_delete_ //@param_description Chat description; 0-255 characters //@location Chat location if a location-based supergroup is being created; pass null to create an ordinary supergroup chat //@message_auto_delete_time Message auto-delete time value, in seconds; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically -//@for_import Pass true to create a supergroup for importing messages using importMessage +//@for_import Pass true to create a supergroup for importing messages using importMessages createNewSupergroupChat title:string is_forum:Bool is_channel:Bool description:string location:chatLocation message_auto_delete_time:int32 for_import:Bool = Chat; //@description Creates a new secret chat. Returns the newly created chat @user_id Identifier of the target user createNewSecretChat user_id:int53 = Chat; -//@description Creates a new supergroup from an existing basic group and sends a corresponding messageChatUpgradeTo and messageChatUpgradeFrom; requires creator privileges. Deactivates the original basic group @chat_id Identifier of the chat to upgrade +//@description Creates a new supergroup from an existing basic group and sends a corresponding messageChatUpgradeTo and messageChatUpgradeFrom; requires owner privileges. Deactivates the original basic group @chat_id Identifier of the chat to upgrade upgradeBasicGroupChatToSupergroupChat chat_id:int53 = Chat; @@ -6833,9 +9576,15 @@ deleteChatFolder chat_folder_id:int32 leave_chat_ids:vector<int53> = Ok; //@description Returns identifiers of pinned or always included chats from a chat folder, which are suggested to be left when the chat folder is deleted @chat_folder_id Chat folder identifier getChatFolderChatsToLeave chat_folder_id:int32 = Chats; +//@description Returns approximate number of chats in a being created chat folder. Main and archive chat lists must be fully preloaded for this function to work correctly @folder The new chat folder +getChatFolderChatCount folder:chatFolder = Count; + //@description Changes the order of chat folders @chat_folder_ids Identifiers of chat folders in the new correct order @main_chat_list_position Position of the main chat list among chat folders, 0-based. Can be non-zero only for Premium users reorderChatFolders chat_folder_ids:vector<int32> main_chat_list_position:int32 = Ok; +//@description Toggles whether chat folder tags are enabled @are_tags_enabled Pass true to enable folder tags; pass false to disable them +toggleChatFolderTags are_tags_enabled:Bool = Ok; + //@description Returns recommended chat folders for the current user getRecommendedChatFolders = RecommendedChatFolders; @@ -6878,39 +9627,74 @@ getChatFolderNewChats chat_folder_id:int32 = Chats; //@description Process new chats added to a shareable chat folder by its owner @chat_folder_id Chat folder identifier @added_chat_ids Identifiers of the new chats, which are added to the chat folder. The chats are automatically joined if they aren't joined yet processChatFolderNewChats chat_folder_id:int32 added_chat_ids:vector<int53> = Ok; +//@description Returns settings for automatic moving of chats to and from the Archive chat lists +getArchiveChatListSettings = ArchiveChatListSettings; + +//@description Changes settings for automatic moving of chats to and from the Archive chat lists @settings New settings +setArchiveChatListSettings settings:archiveChatListSettings = Ok; + -//@description Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right +//@description Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info member right //@chat_id Chat identifier //@title New title of the chat; 1-128 characters setChatTitle chat_id:int53 title:string = Ok; -//@description Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right +//@description Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info member right //@chat_id Chat identifier //@photo New chat photo; pass null to delete the chat photo setChatPhoto chat_id:int53 photo:InputChatPhoto = Ok; -//@description Changes the message auto-delete or self-destruct (for secret chats) time in a chat. Requires change_info administrator right in basic groups, supergroups and channels +//@description Changes accent color and background custom emoji of a channel chat. Requires can_change_info administrator right +//@chat_id Chat identifier +//@accent_color_id Identifier of the accent color to use. The chat must have at least accentColor.min_channel_chat_boost_level boost level to pass the corresponding color +//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none. Use chatBoostLevelFeatures.can_set_background_custom_emoji to check whether a custom emoji can be set +setChatAccentColor chat_id:int53 accent_color_id:int32 background_custom_emoji_id:int64 = Ok; + +//@description Changes accent color and background custom emoji for profile of a supergroup or channel chat. Requires can_change_info administrator right +//@chat_id Chat identifier +//@profile_accent_color_id Identifier of the accent color to use for profile; pass -1 if none. The chat must have at least profileAccentColor.min_supergroup_chat_boost_level for supergroups +//-or profileAccentColor.min_channel_chat_boost_level for channels boost level to pass the corresponding color +//@profile_background_custom_emoji_id Identifier of a custom emoji to be shown on the chat's profile photo background; 0 if none. Use chatBoostLevelFeatures.can_set_profile_background_custom_emoji to check whether a custom emoji can be set +setChatProfileAccentColor chat_id:int53 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 = Ok; + +//@description Changes the message auto-delete or self-destruct (for secret chats) time in a chat. Requires change_info administrator right in basic groups, supergroups and channels. //-Message auto-delete time can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram). //@chat_id Chat identifier //@message_auto_delete_time New time value, in seconds; unless the chat is secret, it must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically setChatMessageAutoDeleteTime chat_id:int53 message_auto_delete_time:int32 = Ok; +//@description Changes the emoji status of a chat. Use chatBoostLevelFeatures.can_set_emoji_status to check whether an emoji status can be set. Requires can_change_info administrator right +//@chat_id Chat identifier +//@emoji_status New emoji status; pass null to remove emoji status +setChatEmojiStatus chat_id:int53 emoji_status:emojiStatus = Ok; + //@description Changes the chat members permissions. Supported only for basic groups and supergroups. Requires can_restrict_members administrator right //@chat_id Chat identifier //@permissions New non-administrator members permissions in the chat setChatPermissions chat_id:int53 permissions:chatPermissions = Ok; -//@description Changes the background in a specific chat. Supported only in private and secret chats with non-deleted users +//@description Sets the background in a specific chat. Supported only in private and secret chats with non-deleted users, and in chats with sufficient boost level and can_change_info administrator right //@chat_id Chat identifier -//@background The input background to use; pass null to create a new filled background or to remove the current background -//@type Background type; pass null to remove the current background -//@dark_theme_dimming Dimming of the background in dark themes, as a percentage; 0-100 -setChatBackground chat_id:int53 background:InputBackground type:BackgroundType dark_theme_dimming:int32 = Ok; +//@background The input background to use; pass null to create a new filled or chat theme background +//@type Background type; pass null to use default background type for the chosen background; backgroundTypeChatTheme isn't supported for private and secret chats. +//-Use chatBoostLevelFeatures.chat_theme_background_count and chatBoostLevelFeatures.can_set_custom_background to check whether the background type can be set in the boosted chat +//@dark_theme_dimming Dimming of the background in dark themes, as a percentage; 0-100. Applied only to Wallpaper and Fill types of background +//@only_for_self Pass true to set background only for self; pass false to set background for all chat users. Always false for backgrounds set in boosted chats. Background can be set for both users only by Telegram Premium users and if set background isn't of the type inputBackgroundPrevious +setChatBackground chat_id:int53 background:InputBackground type:BackgroundType dark_theme_dimming:int32 only_for_self:Bool = Ok; + +//@description Deletes background in a specific chat +//@chat_id Chat identifier +//@restore_previous Pass true to restore previously set background. Can be used only in private and secret chats with non-deleted users if userFullInfo.set_chat_background == true. +//-Supposed to be used from messageChatSetBackground messages with the currently set background that was set for both sides by the other user +deleteChatBackground chat_id:int53 restore_previous:Bool = Ok; //@description Changes the chat theme. Supported only in private and secret chats @chat_id Chat identifier @theme_name Name of the new chat theme; pass an empty string to return the default theme setChatTheme chat_id:int53 theme_name:string = Ok; -//@description Changes the draft message in a chat @chat_id Chat identifier @message_thread_id If not 0, a message thread identifier in which the draft was changed @draft_message New draft message; pass null to remove the draft +//@description Changes the draft message in a chat +//@chat_id Chat identifier +//@message_thread_id If not 0, the message thread identifier in which the draft was changed +//@draft_message New draft message; pass null to remove the draft. All files in draft message content must be of the type inputFileLocal. Media thumbnails and captions are ignored setChatDraftMessage chat_id:int53 message_thread_id:int53 draft_message:draftMessage = Ok; //@description Changes the notification settings of a chat. Notification settings of a chat with the current user (Saved Messages) can't be changed @@ -6923,7 +9707,10 @@ setChatNotificationSettings chat_id:int53 notification_settings:chatNotification //@has_protected_content New value of has_protected_content toggleChatHasProtectedContent chat_id:int53 has_protected_content:Bool = Ok; -//@description Changes the translatable state of a chat; for Telegram Premium users only @chat_id Chat identifier @is_translatable New value of is_translatable +//@description Changes the view_as_topics setting of a forum chat or Saved Messages @chat_id Chat identifier @view_as_topics New value of view_as_topics +toggleChatViewAsTopics chat_id:int53 view_as_topics:Bool = Ok; + +//@description Changes the translatable state of a chat @chat_id Chat identifier @is_translatable New value of is_translatable toggleChatIsTranslatable chat_id:int53 is_translatable:Bool = Ok; //@description Changes the marked as unread state of a chat @chat_id Chat identifier @is_marked_as_unread New value of is_marked_as_unread @@ -6932,17 +9719,19 @@ toggleChatIsMarkedAsUnread chat_id:int53 is_marked_as_unread:Bool = Ok; //@description Changes the value of the default disable_notification parameter, used when a message is sent to a chat @chat_id Chat identifier @default_disable_notification New value of default_disable_notification toggleChatDefaultDisableNotification chat_id:int53 default_disable_notification:Bool = Ok; -//@description Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right @chat_id Identifier of the chat @available_reactions Reactions available in the chat. All emoji reactions must be active +//@description Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info member right +//@chat_id Identifier of the chat +//@available_reactions Reactions available in the chat. All explicitly specified emoji reactions must be active. In channel chats up to the chat's boost level custom emoji reactions can be explicitly specified setChatAvailableReactions chat_id:int53 available_reactions:ChatAvailableReactions = Ok; //@description Changes application-specific data associated with a chat @chat_id Chat identifier @client_data New value of client_data setChatClientData chat_id:int53 client_data:string = Ok; -//@description Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right @chat_id Identifier of the chat @param_description New chat description; 0-255 characters +//@description Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info member right @chat_id Identifier of the chat @param_description New chat description; 0-255 characters setChatDescription chat_id:int53 description:string = Ok; //@description Changes the discussion group of a channel chat; requires can_change_info administrator right in the channel if it is specified -//@chat_id Identifier of the channel chat. Pass 0 to remove a link from the supergroup passed in the second argument to a linked channel chat (requires can_pin_messages rights in the supergroup) +//@chat_id Identifier of the channel chat. Pass 0 to remove a link from the supergroup passed in the second argument to a linked channel chat (requires can_pin_messages member right in the supergroup) //@discussion_chat_id Identifier of a new channel's discussion group. Use 0 to remove the discussion group. Use the method getSuitableDiscussionChats to find all suitable groups. //-Basic group chats must be first upgraded to supergroup chats. If new chat members don't have access to old messages in the supergroup, then toggleSupergroupIsAllHistoryAvailable must be used first to change that setChatDiscussionGroup chat_id:int53 discussion_chat_id:int53 = Ok; @@ -6950,23 +9739,23 @@ setChatDiscussionGroup chat_id:int53 discussion_chat_id:int53 = Ok; //@description Changes the location of a chat. Available only for some location-based supergroups, use supergroupFullInfo.can_set_location to check whether the method is allowed to use @chat_id Chat identifier @location New location for the chat; must be valid and not null setChatLocation chat_id:int53 location:chatLocation = Ok; -//@description Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members rights @chat_id Chat identifier @slow_mode_delay New slow mode delay for the chat, in seconds; must be one of 0, 10, 30, 60, 300, 900, 3600 +//@description Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members right @chat_id Chat identifier @slow_mode_delay New slow mode delay for the chat, in seconds; must be one of 0, 10, 30, 60, 300, 900, 3600 setChatSlowModeDelay chat_id:int53 slow_mode_delay:int32 = Ok; -//@description Pins a message in a chat; requires can_pin_messages rights or can_edit_messages rights in the channel +//@description Pins a message in a chat. A message can be pinned only if messageProperties.can_be_pinned //@chat_id Identifier of the chat //@message_id Identifier of the new pinned message //@disable_notification Pass true to disable notification about the pinned message. Notifications are always disabled in channels and private chats //@only_for_self Pass true to pin the message only for self; private chats only pinChatMessage chat_id:int53 message_id:int53 disable_notification:Bool only_for_self:Bool = Ok; -//@description Removes a pinned message from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel @chat_id Identifier of the chat @message_id Identifier of the removed pinned message +//@description Removes a pinned message from a chat; requires can_pin_messages member right if the chat is a basic group or supergroup, or can_edit_messages administrator right if the chat is a channel @chat_id Identifier of the chat @message_id Identifier of the removed pinned message unpinChatMessage chat_id:int53 message_id:int53 = Ok; -//@description Removes all pinned messages from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel @chat_id Identifier of the chat +//@description Removes all pinned messages from a chat; requires can_pin_messages member right if the chat is a basic group or supergroup, or can_edit_messages administrator right if the chat is a channel @chat_id Identifier of the chat unpinAllChatMessages chat_id:int53 = Ok; -//@description Removes all pinned messages from a forum topic; requires can_pin_messages rights in the supergroup +//@description Removes all pinned messages from a forum topic; requires can_pin_messages member right in the supergroup //@chat_id Identifier of the chat //@message_thread_id Message thread identifier in which messages will be unpinned unpinAllMessageThreadMessages chat_id:int53 message_thread_id:int53 = Ok; @@ -6978,24 +9767,27 @@ joinChat chat_id:int53 = Ok; //@description Removes the current user from chat members. Private and secret chats can't be left using this method @chat_id Chat identifier leaveChat chat_id:int53 = Ok; -//@description Adds a new member to a chat. Members can't be added to private or secret chats +//@description Adds a new member to a chat; requires can_invite_users member right. Members can't be added to private or secret chats. Returns information about members that weren't added //@chat_id Chat identifier //@user_id Identifier of the user //@forward_limit The number of earlier messages from the chat to be forwarded to the new member; up to 100. Ignored for supergroups and channels, or if the added user is a bot -addChatMember chat_id:int53 user_id:int53 forward_limit:int32 = Ok; +addChatMember chat_id:int53 user_id:int53 forward_limit:int32 = FailedToAddMembers; -//@description Adds multiple new members to a chat. Currently, this method is only available for supergroups and channels. This method can't be used to join a chat. Members can't be added to a channel if it has more than 200 members +//@description Adds multiple new members to a chat; requires can_invite_users member right. Currently, this method is only available for supergroups and channels. +//-This method can't be used to join a chat. Members can't be added to a channel if it has more than 200 members. Returns information about members that weren't added //@chat_id Chat identifier //@user_ids Identifiers of the users to be added to the chat. The maximum number of added users is 20 for supergroups and 100 for channels -addChatMembers chat_id:int53 user_ids:vector<int53> = Ok; +addChatMembers chat_id:int53 user_ids:vector<int53> = FailedToAddMembers; -//@description Changes the status of a chat member, needs appropriate privileges. This function is currently not suitable for transferring chat ownership; use transferChatOwnership instead. Use addChatMember or banChatMember if some additional parameters needs to be passed +//@description Changes the status of a chat member; requires can_invite_users member right to add a chat member, can_promote_members administrator right to change administrator rights of the member, +//-and can_restrict_members administrator right to change restrictions of a user. This function is currently not suitable for transferring chat ownership; use transferChatOwnership instead. +//-Use addChatMember or banChatMember if some additional parameters needs to be passed //@chat_id Chat identifier //@member_id Member identifier. Chats can be only banned and unbanned in supergroups and channels //@status The new status of the member in the chat setChatMemberStatus chat_id:int53 member_id:MessageSender status:ChatMemberStatus = Ok; -//@description Bans a member in a chat. Members can't be banned in private or secret chats. In supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first +//@description Bans a member in a chat; requires can_restrict_members administrator right. Members can't be banned in private or secret chats. In supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first //@chat_id Chat identifier //@member_id Member identifier //@banned_until_date Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Ignored in basic groups and if a chat is banned @@ -7005,7 +9797,7 @@ banChatMember chat_id:int53 member_id:MessageSender banned_until_date:int32 revo //@description Checks whether the current session can be used to transfer a chat ownership to another user canTransferOwnership = CanTransferOwnershipResult; -//@description Changes the owner of a chat. The current user must be a current owner of the chat. Use the method canTransferOwnership to check whether the ownership can be transferred from the current session. Available only for supergroups and channel chats +//@description Changes the owner of a chat; requires owner privileges in the chat. Use the method canTransferOwnership to check whether the ownership can be transferred from the current session. Available only for supergroups and channel chats //@chat_id Chat identifier //@user_id Identifier of the user to which transfer the ownership. The ownership can't be transferred to a bot or to a deleted user //@password The 2-step verification password of the current user @@ -7014,7 +9806,7 @@ transferChatOwnership chat_id:int53 user_id:int53 password:string = Ok; //@description Returns information about a single member of a chat @chat_id Chat identifier @member_id Member identifier getChatMember chat_id:int53 member_id:MessageSender = ChatMember; -//@description Searches for a specified query in the first name, last name and usernames of the members of a specified chat. Requires administrator rights in channels +//@description Searches for a specified query in the first name, last name and usernames of the members of a specified chat. Requires administrator rights if the chat is a channel //@chat_id Chat identifier //@query Query to search for //@limit The maximum number of users to be returned; up to 200 @@ -7032,7 +9824,7 @@ clearAllDraftMessages exclude_secret_chats:Bool = Ok; //@description Returns saved notification sound by its identifier. Returns a 404 error if there is no saved notification sound with the specified identifier @notification_sound_id Identifier of the notification sound getSavedNotificationSound notification_sound_id:int64 = NotificationSounds; -//@description Returns list of saved notification sounds. If a sound isn't in the list, then default sound needs to be used +//@description Returns the list of saved notification sounds. If a sound isn't in the list, then default sound needs to be used getSavedNotificationSounds = NotificationSounds; //@description Adds a new notification sound to the list of saved notification sounds. The new notification sound is added to the top of the list. If it is already in the list, its position isn't changed @sound Notification sound file to add @@ -7042,7 +9834,7 @@ addSavedNotificationSound sound:InputFile = NotificationSound; removeSavedNotificationSound notification_sound_id:int64 = Ok; -//@description Returns list of chats with non-default notification settings +//@description Returns the list of chats with non-default notification settings for new messages //@scope If specified, only chats from the scope will be returned; pass null to return chats from all scopes //@compare_sound Pass true to include in the response chats with only non-default sound getChatNotificationSettingsExceptions scope:NotificationSettingsScope compare_sound:Bool = Chats; @@ -7053,7 +9845,10 @@ getScopeNotificationSettings scope:NotificationSettingsScope = ScopeNotification //@description Changes notification settings for chats of a given type @scope Types of chats for which to change the notification settings @notification_settings The new notification settings for the given scope setScopeNotificationSettings scope:NotificationSettingsScope notification_settings:scopeNotificationSettings = Ok; -//@description Resets all notification settings to their default values. By default, all chats are unmuted and message previews are shown +//@description Changes notification settings for reactions @notification_settings The new notification settings for reactions +setReactionNotificationSettings notification_settings:reactionNotificationSettings = Ok; + +//@description Resets all chat and scope notification settings to their default values. By default, all chats are unmuted and message previews are shown resetAllNotificationSettings = Ok; @@ -7070,29 +9865,231 @@ setPinnedChats chat_list:ChatList chat_ids:vector<int53> = Ok; readChatList chat_list:ChatList = Ok; -//@description Returns information about a bot that can be added to attachment menu @bot_user_id Bot's user identifier +//@description Returns the current weather in the given location @location The location +getCurrentWeather location:location = CurrentWeather; + + +//@description Returns a story +//@story_sender_chat_id Identifier of the chat that posted the story +//@story_id Story identifier +//@only_local Pass true to get only locally available information without sending network requests +getStory story_sender_chat_id:int53 story_id:int32 only_local:Bool = Story; + +//@description Returns supergroup and channel chats in which the current user has the right to post stories. The chats must be rechecked with canSendStory before actually trying to post a story there +getChatsToSendStories = Chats; + +//@description Checks whether the current user can send a story on behalf of a chat; requires can_post_stories right for supergroup and channel chats +//@chat_id Chat identifier. Pass Saved Messages chat identifier when posting a story on behalf of the current user +canSendStory chat_id:int53 = CanSendStoryResult; + +//@description Sends a new story to a chat; requires can_post_stories right for supergroup and channel chats. Returns a temporary story +//@chat_id Identifier of the chat that will post the story. Pass Saved Messages chat identifier when posting a story on behalf of the current user +//@content Content of the story +//@areas Clickable rectangle areas to be shown on the story media; pass null if none +//@caption Story caption; pass null to use an empty caption; 0-getOption("story_caption_length_max") characters; can have entities only if getOption("can_use_text_entities_in_story_caption") +//@privacy_settings The privacy settings for the story; ignored for stories sent to supergroup and channel chats +//@active_period Period after which the story is moved to archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 for Telegram Premium users, and 86400 otherwise +//@from_story_full_id Full identifier of the original story, which content was used to create the story; pass null if the story isn't repost of another story +//@is_posted_to_chat_page Pass true to keep the story accessible after expiration +//@protect_content Pass true if the content of the story must be protected from forwarding and screenshotting +sendStory chat_id:int53 content:InputStoryContent areas:inputStoryAreas caption:formattedText privacy_settings:StoryPrivacySettings active_period:int32 from_story_full_id:storyFullId is_posted_to_chat_page:Bool protect_content:Bool = Story; + +//@description Changes content and caption of a story. Can be called only if story.can_be_edited == true +//@story_sender_chat_id Identifier of the chat that posted the story +//@story_id Identifier of the story to edit +//@content New content of the story; pass null to keep the current content +//@areas New clickable rectangle areas to be shown on the story media; pass null to keep the current areas. Areas can't be edited if story content isn't changed +//@caption New story caption; pass null to keep the current caption +editStory story_sender_chat_id:int53 story_id:int32 content:InputStoryContent areas:inputStoryAreas caption:formattedText = Ok; + +//@description Changes cover of a video story. Can be called only if story.can_be_edited == true and the story isn't being edited now +//@story_sender_chat_id Identifier of the chat that posted the story +//@story_id Identifier of the story to edit +//@cover_frame_timestamp New timestamp of the frame, which will be used as video thumbnail +editStoryCover story_sender_chat_id:int53 story_id:int32 cover_frame_timestamp:double = Ok; + +//@description Changes privacy settings of a story. The method can be called only for stories posted on behalf of the current user and if story.can_be_edited == true +//@story_id Identifier of the story +//@privacy_settings The new privacy settigs for the story +setStoryPrivacySettings story_id:int32 privacy_settings:StoryPrivacySettings = Ok; + +//@description Toggles whether a story is accessible after expiration. Can be called only if story.can_toggle_is_posted_to_chat_page == true +//@story_sender_chat_id Identifier of the chat that posted the story +//@story_id Identifier of the story +//@is_posted_to_chat_page Pass true to make the story accessible after expiration; pass false to make it private +toggleStoryIsPostedToChatPage story_sender_chat_id:int53 story_id:int32 is_posted_to_chat_page:Bool = Ok; + +//@description Deletes a previously sent story. Can be called only if story.can_be_deleted == true +//@story_sender_chat_id Identifier of the chat that posted the story +//@story_id Identifier of the story to delete +deleteStory story_sender_chat_id:int53 story_id:int32 = Ok; + +//@description Returns the list of chats with non-default notification settings for stories +getStoryNotificationSettingsExceptions = Chats; + +//@description Loads more active stories from a story list. The loaded stories will be sent through updates. Active stories are sorted by +//-the pair (active_stories.order, active_stories.story_sender_chat_id) in descending order. Returns a 404 error if all active stories have been loaded +//@story_list The story list in which to load active stories +loadActiveStories story_list:StoryList = Ok; + +//@description Changes story list in which stories from the chat are shown @chat_id Identifier of the chat that posted stories @story_list New list for active stories posted by the chat +setChatActiveStoriesList chat_id:int53 story_list:StoryList = Ok; + +//@description Returns the list of active stories posted by the given chat @chat_id Chat identifier +getChatActiveStories chat_id:int53 = ChatActiveStories; + +//@description Returns the list of stories that posted by the given chat to its chat page. If from_story_id == 0, then pinned stories are returned first. +//-Then, stories are returned in reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib +//@chat_id Chat identifier +//@from_story_id Identifier of the story starting from which stories must be returned; use 0 to get results from pinned and the newest story +//@limit The maximum number of stories to be returned. +//-For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit +getChatPostedToChatPageStories chat_id:int53 from_story_id:int32 limit:int32 = Stories; + +//@description Returns the list of all stories posted by the given chat; requires can_edit_stories right in the chat. +//-The stories are returned in reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib +//@chat_id Chat identifier +//@from_story_id Identifier of the story starting from which stories must be returned; use 0 to get results from the last story +//@limit The maximum number of stories to be returned. +//-For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit +getChatArchivedStories chat_id:int53 from_story_id:int32 limit:int32 = Stories; + +//@description Changes the list of pinned stories on a chat page; requires can_edit_stories right in the chat +//@chat_id Identifier of the chat that posted the stories +//@story_ids New list of pinned stories. All stories must be posted to the chat page first. There can be up to getOption("pinned_story_count_max") pinned stories on a chat page +setChatPinnedStories chat_id:int53 story_ids:vector<int32> = Ok; + +//@description Informs TDLib that a story is opened and is being viewed by the user +//@story_sender_chat_id The identifier of the sender of the opened story +//@story_id The identifier of the story +openStory story_sender_chat_id:int53 story_id:int32 = Ok; + +//@description Informs TDLib that a story is closed by the user +//@story_sender_chat_id The identifier of the sender of the story to close +//@story_id The identifier of the story +closeStory story_sender_chat_id:int53 story_id:int32 = Ok; + +//@description Returns reactions, which can be chosen for a story @row_size Number of reaction per row, 5-25 +getStoryAvailableReactions row_size:int32 = AvailableReactions; + +//@description Changes chosen reaction on a story that has already been sent +//@story_sender_chat_id The identifier of the sender of the story +//@story_id The identifier of the story +//@reaction_type Type of the reaction to set; pass null to remove the reaction. Custom emoji reactions can be used only by Telegram Premium users. Paid reactions can't be set +//@update_recent_reactions Pass true if the reaction needs to be added to recent reactions +setStoryReaction story_sender_chat_id:int53 story_id:int32 reaction_type:ReactionType update_recent_reactions:Bool = Ok; + +//@description Returns interactions with a story. The method can be called only for stories posted on behalf of the current user +//@story_id Story identifier +//@query Query to search for in names, usernames and titles; may be empty to get all relevant interactions +//@only_contacts Pass true to get only interactions by contacts; pass false to get all relevant interactions +//@prefer_forwards Pass true to get forwards and reposts first, then reactions, then other views; pass false to get interactions sorted just by interaction date +//@prefer_with_reaction Pass true to get interactions with reaction first; pass false to get interactions sorted just by interaction date. Ignored if prefer_forwards == true +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of story interactions to return +getStoryInteractions story_id:int32 query:string only_contacts:Bool prefer_forwards:Bool prefer_with_reaction:Bool offset:string limit:int32 = StoryInteractions; + +//@description Returns interactions with a story posted in a chat. Can be used only if story is posted on behalf of a chat and the user is an administrator in the chat +//@story_sender_chat_id The identifier of the sender of the story +//@story_id Story identifier +//@reaction_type Pass the default heart reaction or a suggested reaction type to receive only interactions with the specified reaction type; pass null to receive all interactions; reactionTypePaid isn't supported +//@prefer_forwards Pass true to get forwards and reposts first, then reactions, then other views; pass false to get interactions sorted just by interaction date +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of story interactions to return +getChatStoryInteractions story_sender_chat_id:int53 story_id:int32 reaction_type:ReactionType prefer_forwards:Bool offset:string limit:int32 = StoryInteractions; + +//@description Reports a story to the Telegram moderators +//@story_sender_chat_id The identifier of the sender of the story to report +//@story_id The identifier of the story to report +//@reason The reason for reporting the story +//@text Additional report details; 0-1024 characters +reportStory story_sender_chat_id:int53 story_id:int32 reason:ReportReason text:string = Ok; + +//@description Activates stealth mode for stories, which hides all views of stories from the current user in the last "story_stealth_mode_past_period" seconds +//-and for the next "story_stealth_mode_future_period" seconds; for Telegram Premium users only +activateStoryStealthMode = Ok; + +//@description Returns forwards of a story as a message to public chats and reposts by public channels. Can be used only if the story is posted on behalf of the current user or story.can_get_statistics == true. +//-For optimal performance, the number of returned messages and stories is chosen by TDLib +//@story_sender_chat_id The identifier of the sender of the story +//@story_id The identifier of the story +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of messages and stories to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit +getStoryPublicForwards story_sender_chat_id:int53 story_id:int32 offset:string limit:int32 = PublicForwards; + + +//@description Returns the list of features available on the specific chat boost level; this is an offline request +//@is_channel Pass true to get the list of features for channels; pass false to get the list of features for supergroups +//@level Chat boost level +getChatBoostLevelFeatures is_channel:Bool level:int32 = ChatBoostLevelFeatures; + +//@description Returns the list of features available for different chat boost levels; this is an offline request +//@is_channel Pass true to get the list of features for channels; pass false to get the list of features for supergroups +getChatBoostFeatures is_channel:Bool = ChatBoostFeatures; + +//@description Returns the list of available chat boost slots for the current user +getAvailableChatBoostSlots = ChatBoostSlots; + +//@description Returns the current boost status for a supergroup or a channel chat @chat_id Identifier of the chat +getChatBoostStatus chat_id:int53 = ChatBoostStatus; + +//@description Boosts a chat and returns the list of available chat boost slots for the current user after the boost +//@chat_id Identifier of the chat +//@slot_ids Identifiers of boost slots of the current user from which to apply boosts to the chat +boostChat chat_id:int53 slot_ids:vector<int32> = ChatBoostSlots; + +//@description Returns an HTTPS link to boost the specified supergroup or channel chat @chat_id Identifier of the chat +getChatBoostLink chat_id:int53 = ChatBoostLink; + +//@description Returns information about a link to boost a chat. Can be called for any internal link of the type internalLinkTypeChatBoost @url The link to boost a chat +getChatBoostLinkInfo url:string = ChatBoostLinkInfo; + +//@description Returns the list of boosts applied to a chat; requires administrator rights in the chat +//@chat_id Identifier of the chat +//@only_gift_codes Pass true to receive only boosts received from gift codes and giveaways created by the chat +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of boosts to be returned; up to 100. For optimal performance, the number of returned boosts can be smaller than the specified limit +getChatBoosts chat_id:int53 only_gift_codes:Bool offset:string limit:int32 = FoundChatBoosts; + +//@description Returns the list of boosts applied to a chat by a given user; requires administrator rights in the chat; for bots only +//@chat_id Identifier of the chat +//@user_id Identifier of the user +getUserChatBoosts chat_id:int53 user_id:int53 = FoundChatBoosts; + + +//@description Returns information about a bot that can be added to attachment or side menu @bot_user_id Bot's user identifier getAttachmentMenuBot bot_user_id:int53 = AttachmentMenuBot; -//@description Adds or removes a bot to attachment menu. Bot can be added to attachment menu, only if userTypeBot.can_be_added_to_attachment_menu == true +//@description Adds or removes a bot to attachment and side menu. Bot can be added to the menu, only if userTypeBot.can_be_added_to_attachment_menu == true //@bot_user_id Bot's user identifier //@is_added Pass true to add the bot to attachment menu; pass false to remove the bot from attachment menu //@allow_write_access Pass true if the current user allowed the bot to send them messages. Ignored if is_added is false toggleBotIsAddedToAttachmentMenu bot_user_id:int53 is_added:Bool allow_write_access:Bool = Ok; -//@description Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list +//@description Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list for self status getThemedEmojiStatuses = EmojiStatuses; -//@description Returns recent emoji statuses +//@description Returns recent emoji statuses for self status getRecentEmojiStatuses = EmojiStatuses; -//@description Returns default emoji statuses +//@description Returns default emoji statuses for self status getDefaultEmojiStatuses = EmojiStatuses; -//@description Clears the list of recently used emoji statuses +//@description Clears the list of recently used emoji statuses for self status clearRecentEmojiStatuses = Ok; +//@description Returns up to 8 emoji statuses, which must be shown in the emoji status list for chats +getThemedChatEmojiStatuses = EmojiStatuses; + +//@description Returns default emoji statuses for chats +getDefaultChatEmojiStatuses = EmojiStatuses; + +//@description Returns the list of emoji statuses, which can't be used as chat emoji status, even they are from a sticker set with is_allowed_as_chat_emoji_status == true +getDisallowedChatEmojiStatuses = EmojiStatuses; + + //@description Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates //@file_id Identifier of the file to download //@priority Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first @@ -7110,8 +10107,9 @@ cancelDownloadFile file_id:int32 only_if_pending:Bool = Ok; //@description Returns suggested name for saving a file in a given directory @file_id Identifier of the file @directory Directory in which the file is supposed to be saved getSuggestedFileName file_id:int32 directory:string = Text; -//@description Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. Updates updateFile will be used -//-to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message +//@description Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. +//-In all other cases there is no need to preliminary upload a file. Updates updateFile will be used to notify about upload progress. +//-The upload will not be completed until the file is sent in a message //@file File to upload //@file_type File type; pass null if unknown //@priority Priority of the upload (1-32). The higher the priority, the earlier the file will be uploaded. If the priorities of two files are equal, then the first one for which preliminaryUploadFile was called will be uploaded first @@ -7147,7 +10145,7 @@ readFilePart file_id:int32 offset:int53 count:int53 = FilePart; deleteFile file_id:int32 = Ok; //@description Adds a file from a message to the list of file downloads. Download progress and completion of the download will be notified through updateFile updates. -//-If message database is used, the list of file downloads is persistent across application restarts. The downloading is independent from download using downloadFile, i.e. it continues if downloadFile is canceled or is used to download a part of the file +//-If message database is used, the list of file downloads is persistent across application restarts. The downloading is independent of download using downloadFile, i.e. it continues if downloadFile is canceled or is used to download a part of the file //@file_id Identifier of the file to download //@chat_id Chat identifier of the message with the file //@message_id Message identifier @@ -7180,15 +10178,22 @@ removeAllFilesFromDownloads only_active:Bool only_completed:Bool delete_from_cac searchFileDownloads query:string only_active:Bool only_completed:Bool offset:string limit:int32 = FoundFileDownloads; +//@description Application verification has been completed. Can be called before authorization +//@verification_id Unique identifier for the verification process as received from updateApplicationVerificationRequired +//@token Play Integrity API token for the Android application, or secret from push notification for the iOS application; +//-pass an empty string to abort verification and receive error VERIFICATION_FAILED for the request +setApplicationVerificationToken verification_id:int53 token:string = Ok; + + //@description Returns information about a file with messages exported from another application @message_file_head Beginning of the message file; up to 100 first lines getMessageFileType message_file_head:string = MessageFileType; //@description Returns a confirmation text to be shown to the user before starting message import -//@chat_id Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info administrator right +//@chat_id Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info member right getMessageImportConfirmationText chat_id:int53 = Text; //@description Imports messages exported from another app -//@chat_id Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info administrator right +//@chat_id Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info member right //@message_file File with messages to import. Only inputFileLocal and inputFileGenerated are supported. The file must not be previously uploaded //@attached_files Files used in the imported messages. Only inputFileLocal and inputFileGenerated are supported. The files must not be previously uploaded importMessages chat_id:int53 message_file:InputFile attached_files:vector<InputFile> = Ok; @@ -7205,7 +10210,16 @@ replacePrimaryChatInviteLink chat_id:int53 = ChatInviteLink; //@creates_join_request Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0 createChatInviteLink chat_id:int53 name:string expiration_date:int32 member_limit:int32 creates_join_request:Bool = ChatInviteLink; -//@description Edits a non-primary invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links +//@description Creates a new subscription invite link for a channel chat. Requires can_invite_users right in the chat +//@chat_id Chat identifier +//@name Invite link name; 0-32 characters +//@subscription_pricing Information about subscription plan that will be applied to the users joining the chat via the link. +//-Subscription period must be 2592000 in production environment, and 60 or 300 if Telegram test environment is used +createChatSubscriptionInviteLink chat_id:int53 name:string subscription_pricing:starSubscriptionPricing = ChatInviteLink; + +//@description Edits a non-primary invite link for a chat. Available for basic groups, supergroups, and channels. +//-If the link creates a subscription, then expiration_date, member_limit and creates_join_request must not be used. +//-Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links //@chat_id Chat identifier //@invite_link Invite link to be edited //@name Invite link name; 0-32 characters @@ -7214,12 +10228,18 @@ createChatInviteLink chat_id:int53 name:string expiration_date:int32 member_limi //@creates_join_request Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0 editChatInviteLink chat_id:int53 invite_link:string name:string expiration_date:int32 member_limit:int32 creates_join_request:Bool = ChatInviteLink; +//@description Edits a subscription invite link for a channel chat. Requires can_invite_users right in the chat for own links and owner privileges for other links +//@chat_id Chat identifier +//@invite_link Invite link to be edited +//@name Invite link name; 0-32 characters +editChatSubscriptionInviteLink chat_id:int53 invite_link:string name:string = ChatInviteLink; + //@description Returns information about an invite link. Requires administrator privileges and can_invite_users right in the chat to get own links and owner privileges to get other links //@chat_id Chat identifier //@invite_link Invite link to get getChatInviteLink chat_id:int53 invite_link:string = ChatInviteLink; -//@description Returns list of chat administrators with number of their invite links. Requires owner privileges in the chat @chat_id Chat identifier +//@description Returns the list of chat administrators with number of their invite links. Requires owner privileges in the chat @chat_id Chat identifier getChatInviteLinkCounts chat_id:int53 = ChatInviteLinkCounts; //@description Returns invite links for a chat created by specified administrator. Requires administrator privileges and can_invite_users right in the chat to get own links and owner privileges to get other links @@ -7234,9 +10254,10 @@ getChatInviteLinks chat_id:int53 creator_user_id:int53 is_revoked:Bool offset_da //@description Returns chat members joined a chat via an invite link. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links //@chat_id Chat identifier //@invite_link Invite link for which to return chat members +//@only_with_expired_subscription Pass true if the link is a subscription link and only members with expired subscription must be returned //@offset_member A chat member from which to return next chat members; pass null to get results from the beginning //@limit The maximum number of chat members to return; up to 100 -getChatInviteLinkMembers chat_id:int53 invite_link:string offset_member:chatInviteLinkMember limit:int32 = ChatInviteLinkMembers; +getChatInviteLinkMembers chat_id:int53 invite_link:string only_with_expired_subscription:Bool offset_member:chatInviteLinkMember limit:int32 = ChatInviteLinkMembers; //@description Revokes invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links. //-If a primary link is revoked, then additionally to the revoked link returns new primary link @@ -7307,23 +10328,23 @@ sendCallDebugInformation call_id:int32 debug_information:string = Ok; sendCallLog call_id:int32 log_file:InputFile = Ok; -//@description Returns list of participant identifiers, on whose behalf a video chat in the chat can be joined @chat_id Chat identifier +//@description Returns the list of participant identifiers, on whose behalf a video chat in the chat can be joined @chat_id Chat identifier getVideoChatAvailableParticipants chat_id:int53 = MessageSenders; //@description Changes default participant identifier, on whose behalf a video chat in the chat will be joined @chat_id Chat identifier @default_participant_id Default group call participant identifier to join the video chats setVideoChatDefaultParticipant chat_id:int53 default_participant_id:MessageSender = Ok; -//@description Creates a video chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires can_manage_video_chats rights +//@description Creates a video chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires can_manage_video_chats administrator right //@chat_id Identifier of a chat in which the video chat will be created //@title Group call title; if empty, chat title will be used //@start_date Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 to start the video chat immediately. The date must be at least 10 seconds and at most 8 days in the future -//@is_rtmp_stream Pass true to create an RTMP stream instead of an ordinary video chat; requires creator privileges +//@is_rtmp_stream Pass true to create an RTMP stream instead of an ordinary video chat; requires owner privileges createVideoChat chat_id:int53 title:string start_date:int32 is_rtmp_stream:Bool = GroupCallId; -//@description Returns RTMP URL for streaming to the chat; requires creator privileges @chat_id Chat identifier +//@description Returns RTMP URL for streaming to the chat; requires owner privileges @chat_id Chat identifier getVideoChatRtmpUrl chat_id:int53 = RtmpUrl; -//@description Replaces the current RTMP URL for streaming to the chat; requires creator privileges @chat_id Chat identifier +//@description Replaces the current RTMP URL for streaming to the chat; requires owner privileges @chat_id Chat identifier replaceVideoChatRtmpUrl chat_id:int53 = RtmpUrl; //@description Returns information about a group call @group_call_id Group call identifier @@ -7332,7 +10353,7 @@ getGroupCall group_call_id:int32 = GroupCall; //@description Starts a scheduled group call @group_call_id Group call identifier startScheduledGroupCall group_call_id:int32 = Ok; -//@description Toggles whether the current user will receive a notification when the group call will start; scheduled group calls only +//@description Toggles whether the current user will receive a notification when the group call starts; scheduled group calls only //@group_call_id Group call identifier //@enabled_start_notification New value of the enabled_start_notification setting toggleGroupCallEnabledStartNotification group_call_id:int32 enabled_start_notification:Bool = Ok; @@ -7367,7 +10388,7 @@ setGroupCallTitle group_call_id:int32 title:string = Ok; //@mute_new_participants New value of the mute_new_participants setting toggleGroupCallMuteNewParticipants group_call_id:int32 mute_new_participants:Bool = Ok; -//@description Invites users to an active group call. Sends a service message of type messageInviteToGroupCall for video chats +//@description Invites users to an active group call. Sends a service message of type messageInviteVideoChatParticipants for video chats //@group_call_id Group call identifier //@user_ids User identifiers. At most 10 users can be invited simultaneously inviteGroupCallParticipants group_call_id:int32 user_ids:vector<int53> = Ok; @@ -7405,7 +10426,7 @@ setGroupCallParticipantIsSpeaking group_call_id:int32 audio_source:int32 is_spea //@description Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves //@group_call_id Group call identifier //@participant_id Participant identifier -//@is_muted Pass true to mute the user; pass false to unmute the them +//@is_muted Pass true to mute the user; pass false to unmute them toggleGroupCallParticipantIsMuted group_call_id:int32 participant_id:MessageSender is_muted:Bool = Ok; //@description Changes volume level of a participant of an active group call. If the current user can manage the group call, then the participant's volume level will be changed for all users with the default volume level @@ -7443,8 +10464,10 @@ getGroupCallStreams group_call_id:int32 = GroupCallStreams; getGroupCallStreamSegment group_call_id:int32 time_offset:int53 scale:int32 channel_id:int32 video_quality:GroupCallVideoQuality = FilePart; -//@description Changes the block state of a message sender. Currently, only users and supergroup chats can be blocked @sender_id Identifier of a message sender to block/unblock @is_blocked New value of is_blocked -toggleMessageSenderIsBlocked sender_id:MessageSender is_blocked:Bool = Ok; +//@description Changes the block list of a message sender. Currently, only users and supergroup chats can be blocked +//@sender_id Identifier of a message sender to block/unblock +//@block_list New block list for the message sender; pass null to unblock the message sender +setMessageSenderBlockList sender_id:MessageSender block_list:BlockList = Ok; //@description Blocks an original sender of a message in the Replies chat //@message_id The identifier of an incoming message in the Replies chat @@ -7453,8 +10476,11 @@ toggleMessageSenderIsBlocked sender_id:MessageSender is_blocked:Bool = Ok; //@report_spam Pass true to report the sender to the Telegram moderators blockMessageSenderFromReplies message_id:int53 delete_message:Bool delete_all_messages:Bool report_spam:Bool = Ok; -//@description Returns users and chats that were blocked by the current user @offset Number of users and chats to skip in the result; must be non-negative @limit The maximum number of users and chats to return; up to 100 -getBlockedMessageSenders offset:int32 limit:int32 = MessageSenders; +//@description Returns users and chats that were blocked by the current user +//@block_list Block list from which to return users +//@offset Number of users and chats to skip in the result; must be non-negative +//@limit The maximum number of users and chats to return; up to 100 +getBlockedMessageSenders block_list:BlockList offset:int32 limit:int32 = MessageSenders; //@description Adds a user to the contact list or edits an existing contact by their user identifier @@ -7466,7 +10492,7 @@ addContact contact:contact share_phone_number:Bool = Ok; //@description Adds new contacts or edits existing contacts by their phone numbers; contacts' user identifiers are ignored @contacts The list of contacts to import or edit; contacts' vCard are ignored and are not imported importContacts contacts:vector<contact> = ImportedContacts; -//@description Returns all user contacts +//@description Returns all contacts of the user getContacts = Users; //@description Searches for the specified query in the first names, last names and usernames of the known user contacts @@ -7488,6 +10514,12 @@ changeImportedContacts contacts:vector<contact> = ImportedContacts; //@description Clears all imported contacts, contact list remains unchanged clearImportedContacts = Ok; +//@description Changes the list of close friends of the current user @user_ids User identifiers of close friends; the users must be contacts of the current user +setCloseFriends user_ids:vector<int53> = Ok; + +//@description Returns all close friends of the current user +getCloseFriends = Users; + //@description Changes a personal profile photo of a contact user @user_id User identifier @photo Profile photo to set; pass null to delete the photo; inputChatPhotoPrevious isn't supported in this function setUserPersonalProfilePhoto user_id:int53 photo:InputChatPhoto = Ok; @@ -7495,8 +10527,10 @@ setUserPersonalProfilePhoto user_id:int53 photo:InputChatPhoto = Ok; suggestUserProfilePhoto user_id:int53 photo:InputChatPhoto = Ok; -//@description Searches a user by their phone number. Returns a 404 error if the user can't be found @phone_number Phone number to search for -searchUserByPhoneNumber phone_number:string = User; +//@description Searches a user by their phone number. Returns a 404 error if the user can't be found +//@phone_number Phone number to search for +//@only_local Pass true to get only locally available information without sending network requests +searchUserByPhoneNumber phone_number:string only_local:Bool = User; //@description Shares the phone number of the current user with a mutual contact. Supposed to be called when the user clicks on chatActionBarSharePhoneNumber @user_id Identifier of the user with whom to share the phone number. The user must be a mutual contact sharePhoneNumber user_id:int53 = Ok; @@ -7508,24 +10542,37 @@ getUserProfilePhotos user_id:int53 offset:int32 limit:int32 = ChatPhotos; //@description Returns stickers from the installed sticker sets that correspond to any of the given emoji or can be found by sticker-specific keywords. If the query is non-empty, then favorite, recently used or trending stickers may also be returned //@sticker_type Type of the stickers to return -//@query Search query; a space-separated list of emoji or a keyword prefix. If empty, returns all known installed stickers +//@query Search query; a space-separated list of emojis or a keyword prefix. If empty, returns all known installed stickers //@limit The maximum number of stickers to be returned //@chat_id Chat identifier for which to return stickers. Available custom emoji stickers may be different for different chats getStickers sticker_type:StickerType query:string limit:int32 chat_id:int53 = Stickers; +//@description Returns unique emoji that correspond to stickers to be found by the getStickers(sticker_type, query, 1000000, chat_id) +//@sticker_type Type of the stickers to search for +//@query Search query +//@chat_id Chat identifier for which to find stickers +//@return_only_main_emoji Pass true if only main emoji for each found sticker must be included in the result +getAllStickerEmojis sticker_type:StickerType query:string chat_id:int53 return_only_main_emoji:Bool = Emojis; + //@description Searches for stickers from public sticker sets that correspond to any of the given emoji //@sticker_type Type of the stickers to return -//@emojis Space-separated list of emoji to search for; must be non-empty +//@emojis Space-separated list of emojis to search for; must be non-empty //@limit The maximum number of stickers to be returned; 0-100 searchStickers sticker_type:StickerType emojis:string limit:int32 = Stickers; +//@description Returns greeting stickers from regular sticker sets that can be used for the start page of other users +getGreetingStickers = Stickers; + //@description Returns premium stickers from regular sticker sets @limit The maximum number of stickers to be returned; 0-100 getPremiumStickers limit:int32 = Stickers; //@description Returns a list of installed sticker sets @sticker_type Type of the sticker sets to return getInstalledStickerSets sticker_type:StickerType = StickerSets; -//@description Returns a list of archived sticker sets @sticker_type Type of the sticker sets to return @offset_sticker_set_id Identifier of the sticker set from which to return the result @limit The maximum number of sticker sets to return; up to 100 +//@description Returns a list of archived sticker sets +//@sticker_type Type of the sticker sets to return +//@offset_sticker_set_id Identifier of the sticker set from which to return the result; use 0 to get results from the beginning +//@limit The maximum number of sticker sets to return; up to 100 getArchivedStickerSets sticker_type:StickerType offset_sticker_set_id:int64 limit:int32 = StickerSets; //@description Returns a list of trending sticker sets. For optimal performance, the number of returned sticker sets is chosen by TDLib @@ -7540,14 +10587,19 @@ getAttachedStickerSets file_id:int32 = StickerSets; //@description Returns information about a sticker set by its identifier @set_id Identifier of the sticker set getStickerSet set_id:int64 = StickerSet; +//@description Returns name of a sticker set by its identifier @set_id Identifier of the sticker set +getStickerSetName set_id:int64 = Text; + //@description Searches for a sticker set by its name @name Name of the sticker set searchStickerSet name:string = StickerSet; //@description Searches for installed sticker sets by looking for specified query in their title and name @sticker_type Type of the sticker sets to search for @query Query to search for @limit The maximum number of sticker sets to return searchInstalledStickerSets sticker_type:StickerType query:string limit:int32 = StickerSets; -//@description Searches for ordinary sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results @query Query to search for -searchStickerSets query:string = StickerSets; +//@description Searches for sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results +//@sticker_type Type of the sticker sets to return +//@query Query to search for +searchStickerSets sticker_type:StickerType query:string = StickerSets; //@description Installs/uninstalls or activates/archives a sticker set @set_id Identifier of the sticker set @is_installed The new value of is_installed @is_archived The new value of is_archived. A sticker set can't be installed and archived simultaneously changeStickerSet set_id:int64 is_installed:Bool is_archived:Bool = Ok; @@ -7562,7 +10614,7 @@ reorderInstalledStickerSets sticker_type:StickerType sticker_set_ids:vector<int6 getRecentStickers is_attached:Bool = Stickers; //@description Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. -//-Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to recent stickers +//-Only stickers belonging to a sticker set or in WEBP or WEBM format can be added to this list. Emoji stickers can't be added to recent stickers //@is_attached Pass true to add the sticker to the list of stickers recently attached to photo or video files; pass false to add the sticker to the list of recently sent stickers //@sticker Sticker file to add addRecentSticker is_attached:Bool sticker:InputFile = Stickers; @@ -7577,7 +10629,7 @@ clearRecentStickers is_attached:Bool = Ok; getFavoriteStickers = Stickers; //@description Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. -//-Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to favorite stickers +//-Only stickers belonging to a sticker set or in WEBP or WEBM format can be added to this list. Emoji stickers can't be added to favorite stickers //@sticker Sticker file to add addFavoriteSticker sticker:InputFile = Ok; @@ -7587,22 +10639,28 @@ removeFavoriteSticker sticker:InputFile = Ok; //@description Returns emoji corresponding to a sticker. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object @sticker Sticker file identifier getStickerEmojis sticker:InputFile = Emojis; -//@description Searches for emojis by keywords. Supported only if the file database is enabled +//@description Searches for emojis by keywords. Supported only if the file database is enabled. Order of results is unspecified +//@text Text to search for +//@input_language_codes List of possible IETF language tags of the user's input language; may be empty if unknown +searchEmojis text:string input_language_codes:vector<string> = EmojiKeywords; + +//@description Return emojis matching the keyword. Supported only if the file database is enabled. Order of results is unspecified //@text Text to search for -//@exact_match Pass true if only emojis, which exactly match the text, needs to be returned //@input_language_codes List of possible IETF language tags of the user's input language; may be empty if unknown -searchEmojis text:string exact_match:Bool input_language_codes:vector<string> = Emojis; +getKeywordEmojis text:string input_language_codes:vector<string> = Emojis; -//@description Returns available emojis categories @type Type of emoji categories to return; pass null to get default emoji categories +//@description Returns available emoji categories @type Type of emoji categories to return; pass null to get default emoji categories getEmojiCategories type:EmojiCategoryType = EmojiCategories; //@description Returns an animated emoji corresponding to a given emoji. Returns a 404 error if the emoji has no animated emoji @emoji The emoji getAnimatedEmoji emoji:string = AnimatedEmoji; -//@description Returns an HTTP URL which can be used to automatically log in to the translation platform and suggest new emoji replacements. The URL will be valid for 30 seconds after generation @language_code Language code for which the emoji replacements will be suggested +//@description Returns an HTTP URL which can be used to automatically log in to the translation platform and suggest new emoji replacements. The URL will be valid for 30 seconds after generation +//@language_code Language code for which the emoji replacements will be suggested getEmojiSuggestionsUrl language_code:string = HttpUrl; -//@description Returns list of custom emoji stickers by their identifiers. Stickers are returned in arbitrary order. Only found stickers are returned @custom_emoji_ids Identifiers of custom emoji stickers. At most 200 custom emoji stickers can be received simultaneously +//@description Returns the list of custom emoji stickers by their identifiers. Stickers are returned in arbitrary order. Only found stickers are returned +//@custom_emoji_ids Identifiers of custom emoji stickers. At most 200 custom emoji stickers can be received simultaneously getCustomEmojiStickers custom_emoji_ids:vector<int64> = Stickers; //@description Returns default list of custom emoji stickers for placing on a chat photo @@ -7611,11 +10669,15 @@ getDefaultChatPhotoCustomEmojiStickers = Stickers; //@description Returns default list of custom emoji stickers for placing on a profile photo getDefaultProfilePhotoCustomEmojiStickers = Stickers; +//@description Returns default list of custom emoji stickers for reply background +getDefaultBackgroundCustomEmojiStickers = Stickers; + //@description Returns saved animations getSavedAnimations = Animations; -//@description Manually adds a new animation to the list of saved animations. The new animation is added to the beginning of the list. If the animation was already in the list, it is removed first. Only non-secret video animations with MIME type "video/mp4" can be added to the list +//@description Manually adds a new animation to the list of saved animations. The new animation is added to the beginning of the list. If the animation was already in the list, it is removed first. +//-Only non-secret video animations with MIME type "video/mp4" can be added to the list //@animation The animation file to be added. Only animations known to the server (i.e., successfully sent via a message) can be added to the list addSavedAnimation animation:InputFile = Ok; @@ -7634,8 +10696,10 @@ searchHashtags prefix:string limit:int32 = Hashtags; removeRecentHashtag hashtag:string = Ok; -//@description Returns a web page preview by the text of the message. Do not call this function too often. Returns a 404 error if the web page has no preview @text Message text with formatting -getWebPagePreview text:formattedText = WebPage; +//@description Returns a link preview by the text of a message. Do not call this function too often. Returns a 404 error if the text has no link preview +//@text Message text with formatting +//@link_preview_options Options to be used for generation of the link preview; pass null to use default link preview options +getLinkPreview text:formattedText link_preview_options:linkPreviewOptions = LinkPreview; //@description Returns an instant view version of a web page if available. Returns a 404 error if the web page has no instant view page @url The web page URL @force_full Pass true to get full instant view for the web page getWebPageInstantView url:string force_full:Bool = WebPageInstantView; @@ -7649,6 +10713,16 @@ setProfilePhoto photo:InputChatPhoto is_public:Bool = Ok; //@description Deletes a profile photo @profile_photo_id Identifier of the profile photo to delete deleteProfilePhoto profile_photo_id:int64 = Ok; +//@description Changes accent color and background custom emoji for the current user; for Telegram Premium users only +//@accent_color_id Identifier of the accent color to use +//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none +setAccentColor accent_color_id:int32 background_custom_emoji_id:int64 = Ok; + +//@description Changes accent color and background custom emoji for profile of the current user; for Telegram Premium users only +//@profile_accent_color_id Identifier of the accent color to use for profile; pass -1 if none +//@profile_background_custom_emoji_id Identifier of a custom emoji to be shown on the user's profile photo background; 0 if none +setProfileAccentColor profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 = Ok; + //@description Changes the first and last name of the current user @first_name The new value of the first name for the current user; 1-64 characters @last_name The new value of the optional last name for the current user; 0-64 characters setName first_name:string last_name:string = Ok; @@ -7667,24 +10741,93 @@ toggleUsernameIsActive username:string is_active:Bool = Ok; //@description Changes order of active usernames of the current user @usernames The new order of active usernames. All currently active usernames must be specified reorderActiveUsernames usernames:vector<string> = Ok; -//@description Changes the emoji status of the current user; for Telegram Premium users only -//@emoji_status New emoji status; pass null to switch to the default badge -//@duration Duration of the status, in seconds; pass 0 to keep the status active until it will be changed manually -setEmojiStatus emoji_status:emojiStatus duration:int32 = Ok; +//@description Changes the birthdate of the current user @birthdate The new value of the current user's birthdate; pass null to remove the birthdate +setBirthdate birthdate:birthdate = Ok; + +//@description Changes the personal chat of the current user @chat_id Identifier of the new personal chat; pass 0 to remove the chat. Use getSuitablePersonalChats to get suitable chats +setPersonalChat chat_id:int53 = Ok; -//@description Changes the location of the current user. Needs to be called if getOption("is_location_visible") is true and location changes for more than 1 kilometer @location The new location of the user +//@description Changes the emoji status of the current user; for Telegram Premium users only @emoji_status New emoji status; pass null to switch to the default badge +setEmojiStatus emoji_status:emojiStatus = Ok; + +//@description Changes the location of the current user. Needs to be called if getOption("is_location_visible") is true and location changes for more than 1 kilometer. Must not be called if the user has a business location @location The new location of the user setLocation location:location = Ok; -//@description Changes the phone number of the user and sends an authentication code to the user's new phone number; for official Android and iOS applications only. On success, returns information about the sent code -//@phone_number The new phone number of the user in international format +//@description Toggles whether the current user has sponsored messages enabled. The setting has no effect for users without Telegram Premium for which sponsored messages are always enabled +//@has_sponsored_messages_enabled Pass true to enable sponsored messages for the current user; false to disable them +toggleHasSponsoredMessagesEnabled has_sponsored_messages_enabled:Bool = Ok; + +//@description Changes the business location of the current user. Requires Telegram Business subscription @location The new location of the business; pass null to remove the location +setBusinessLocation location:businessLocation = Ok; + +//@description Changes the business opening hours of the current user. Requires Telegram Business subscription +//@opening_hours The new opening hours of the business; pass null to remove the opening hours; up to 28 time intervals can be specified +setBusinessOpeningHours opening_hours:businessOpeningHours = Ok; + +//@description Changes the business greeting message settings of the current user. Requires Telegram Business subscription @greeting_message_settings The new settings for the greeting message of the business; pass null to disable the greeting message +setBusinessGreetingMessageSettings greeting_message_settings:businessGreetingMessageSettings = Ok; + +//@description Changes the business away message settings of the current user. Requires Telegram Business subscription @away_message_settings The new settings for the away message of the business; pass null to disable the away message +setBusinessAwayMessageSettings away_message_settings:businessAwayMessageSettings = Ok; + +//@description Changes the business start page of the current user. Requires Telegram Business subscription @start_page The new start page of the business; pass null to remove custom start page +setBusinessStartPage start_page:inputBusinessStartPage = Ok; + + +//@description Sends a code to the specified phone number. Aborts previous phone number verification if there was one. On success, returns information about the sent code +//@phone_number The phone number, in international format //@settings Settings for the authentication of the user's phone number; pass null to use default settings -changePhoneNumber phone_number:string settings:phoneNumberAuthenticationSettings = AuthenticationCodeInfo; +//@type Type of the request for which the code is sent +sendPhoneNumberCode phone_number:string settings:phoneNumberAuthenticationSettings type:PhoneNumberCodeType = AuthenticationCodeInfo; + +//@description Sends Firebase Authentication SMS to the specified phone number. Works only when received a code of the type authenticationCodeTypeFirebaseAndroid or authenticationCodeTypeFirebaseIos +//@token Play Integrity API or SafetyNet Attestation API token for the Android application, or secret from push notification for the iOS application +sendPhoneNumberFirebaseSms token:string = Ok; + +//@description Reports that authentication code wasn't delivered via SMS to the specified phone number; for official mobile applications only @mobile_network_code Current mobile network code +reportPhoneNumberCodeMissing mobile_network_code:string = Ok; + +//@description Resends the authentication code sent to a phone number. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified timeout has passed +//@reason Reason of code resending; pass null if unknown +resendPhoneNumberCode reason:ResendCodeReason = AuthenticationCodeInfo; + +//@description Check the authentication code and completes the request for which the code was sent if appropriate @code Authentication code to check +checkPhoneNumberCode code:string = Ok; + + +//@description Returns the business bot that is connected to the current user account. Returns a 404 error if there is no connected bot +getBusinessConnectedBot = BusinessConnectedBot; + +//@description Adds or changes business bot that is connected to the current user account @bot Connection settings for the bot +setBusinessConnectedBot bot:businessConnectedBot = Ok; + +//@description Deletes the business bot that is connected to the current user account @bot_user_id Unique user identifier for the bot +deleteBusinessConnectedBot bot_user_id:int53 = Ok; + +//@description Pauses or resumes the connected business bot in a specific chat @chat_id Chat identifier @is_paused Pass true to pause the connected bot in the chat; pass false to resume the bot +toggleBusinessConnectedBotChatIsPaused chat_id:int53 is_paused:Bool = Ok; + +//@description Removes the connected business bot from a specific chat by adding the chat to businessRecipients.excluded_chat_ids @chat_id Chat identifier +removeBusinessConnectedBotFromChat chat_id:int53 = Ok; -//@description Resends the authentication code sent to confirm a new phone number for the current user. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified timeout has passed -resendChangePhoneNumberCode = AuthenticationCodeInfo; -//@description Checks the authentication code sent to confirm a new phone number of the user @code Authentication code to check -checkChangePhoneNumberCode code:string = Ok; +//@description Returns business chat links created for the current account +getBusinessChatLinks = BusinessChatLinks; + +//@description Creates a business chat link for the current account. Requires Telegram Business subscription. There can be up to getOption("business_chat_link_count_max") links created. Returns the created link +//@link_info Information about the link to create +createBusinessChatLink link_info:inputBusinessChatLink = BusinessChatLink; + +//@description Edits a business chat link of the current account. Requires Telegram Business subscription. Returns the edited link +//@link The link to edit +//@link_info New description of the link +editBusinessChatLink link:string link_info:inputBusinessChatLink = BusinessChatLink; + +//@description Deletes a business chat link of the current account @link The link to delete +deleteBusinessChatLink link:string = Ok; + +//@description Returns information about a business chat link @link_name Name of the link +getBusinessChatLinkInfo link_name:string = BusinessChatLinkInfo; //@description Returns an HTTPS link, which can be used to get information about the current user @@ -7705,7 +10848,7 @@ setCommands scope:BotCommandScope language_code:string commands:vector<botComman //@language_code A two-letter ISO 639-1 language code or an empty string deleteCommands scope:BotCommandScope language_code:string = Ok; -//@description Returns list of commands supported by the bot for the given user scope and language; for bots only +//@description Returns the list of commands supported by the bot for the given user scope and language; for bots only //@scope The scope to which the commands are relevant; pass null to get commands in the default bot command scope //@language_code A two-letter ISO 639-1 language code or an empty string getCommands scope:BotCommandScope language_code:string = BotCommands; @@ -7718,13 +10861,61 @@ setMenuButton user_id:int53 menu_button:botMenuButton = Ok; //@description Returns menu button set by the bot for the given user; for bots only @user_id Identifier of the user or 0 to get the default menu button getMenuButton user_id:int53 = BotMenuButton; -//@description Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only @default_group_administrator_rights Default administrator rights for adding the bot to basic group and supergroup chats; may be null +//@description Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only @default_group_administrator_rights Default administrator rights for adding the bot to basic group and supergroup chats; pass null to remove default rights setDefaultGroupAdministratorRights default_group_administrator_rights:chatAdministratorRights = Ok; -//@description Sets default administrator rights for adding the bot to channel chats; for bots only @default_channel_administrator_rights Default administrator rights for adding the bot to channels; may be null +//@description Sets default administrator rights for adding the bot to channel chats; for bots only @default_channel_administrator_rights Default administrator rights for adding the bot to channels; pass null to remove default rights setDefaultChannelAdministratorRights default_channel_administrator_rights:chatAdministratorRights = Ok; +//@description Checks whether the specified bot can send messages to the user. Returns a 404 error if can't and the access can be granted by call to allowBotToSendMessages @bot_user_id Identifier of the target bot +canBotSendMessages bot_user_id:int53 = Ok; + +//@description Allows the specified bot to send messages to the user @bot_user_id Identifier of the target bot +allowBotToSendMessages bot_user_id:int53 = Ok; + +//@description Sends a custom request from a Web App +//@bot_user_id Identifier of the bot +//@method The method name +//@parameters JSON-serialized method parameters +sendWebAppCustomRequest bot_user_id:int53 method:string parameters:string = CustomRequestResult; + + +//@description Returns the list of media previews of a bot @bot_user_id Identifier of the target bot. The bot must have the main Web App +getBotMediaPreviews bot_user_id:int53 = BotMediaPreviews; + +//@description Returns the list of media previews for the given language and the list of languages for which the bot has dedicated previews +//@bot_user_id Identifier of the target bot. The bot must be owned and must have the main Web App +//@language_code A two-letter ISO 639-1 language code for which to get previews. If empty, then default previews are returned +getBotMediaPreviewInfo bot_user_id:int53 language_code:string = BotMediaPreviewInfo; + +//@description Adds a new media preview to the beginning of the list of media previews of a bot. Returns the added preview after addition is completed server-side. The total number of previews must not exceed getOption("bot_media_preview_count_max") for the given language +//@bot_user_id Identifier of the target bot. The bot must be owned and must have the main Web App +//@language_code A two-letter ISO 639-1 language code for which preview is added. If empty, then the preview will be shown to all users for whose languages there are no dedicated previews. +//-If non-empty, then there must be an official language pack of the same name, which is returned by getLocalizationTargetInfo +//@content Content of the added preview +addBotMediaPreview bot_user_id:int53 language_code:string content:InputStoryContent = BotMediaPreview; + +//@description Replaces media preview in the list of media previews of a bot. Returns the new preview after edit is completed server-side +//@bot_user_id Identifier of the target bot. The bot must be owned and must have the main Web App +//@language_code Language code of the media preview to edit +//@file_id File identifier of the media to replace +//@content Content of the new preview +editBotMediaPreview bot_user_id:int53 language_code:string file_id:int32 content:InputStoryContent = BotMediaPreview; + +//@description Changes order of media previews in the list of media previews of a bot +//@bot_user_id Identifier of the target bot. The bot must be owned and must have the main Web App +//@language_code Language code of the media previews to reorder +//@file_ids File identifiers of the media in the new order +reorderBotMediaPreviews bot_user_id:int53 language_code:string file_ids:vector<int32> = Ok; + +//@description Delete media previews from the list of media previews of a bot +//@bot_user_id Identifier of the target bot. The bot must be owned and must have the main Web App +//@language_code Language code of the media previews to delete +//@file_ids File identifiers of the media to delete +deleteBotMediaPreviews bot_user_id:int53 language_code:string file_ids:vector<int32> = Ok; + + //@description Sets the name of a bot. Can be called only if userTypeBot.can_be_edited == true //@bot_user_id Identifier of the target bot //@language_code A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose languages there is no dedicated name @@ -7746,7 +10937,7 @@ setBotProfilePhoto bot_user_id:int53 photo:InputChatPhoto = Ok; toggleBotUsernameIsActive bot_user_id:int53 username:string is_active:Bool = Ok; //@description Changes order of active usernames of a bot. Can be called only if userTypeBot.can_be_edited == true @bot_user_id Identifier of the target bot @usernames The new order of active usernames. All currently active usernames must be specified -reorderActiveBotUsernames bot_user_id:int53 usernames:vector<string> = Ok; +reorderBotActiveUsernames bot_user_id:int53 usernames:vector<string> = Ok; //@description Sets the text shown in the chat with a bot if the chat is empty. Can be called only if userTypeBot.can_be_edited == true //@bot_user_id Identifier of the target bot @@ -7780,6 +10971,9 @@ terminateSession session_id:int64 = Ok; //@description Terminates all other sessions of the current user terminateAllOtherSessions = Ok; +//@description Confirms an unconfirmed session of the current user from another device @session_id Session identifier +confirmSession session_id:int64 = Ok; + //@description Toggles whether a session can accept incoming calls @session_id Session identifier @can_accept_calls Pass true to allow accepting incoming calls by the session; pass false otherwise toggleSessionCanAcceptCalls session_id:int64 can_accept_calls:Bool = Ok; @@ -7815,24 +11009,48 @@ toggleSupergroupUsernameIsActive supergroup_id:int53 username:string is_active:B //@description Disables all active non-editable usernames of a supergroup or channel, requires owner privileges in the supergroup or channel @supergroup_id Identifier of the supergroup or channel disableAllSupergroupUsernames supergroup_id:int53 = Ok; -//@description Changes order of active usernames of a supergroup or channel, requires owner privileges in the supergroup or channel @supergroup_id Identifier of the supergroup or channel @usernames The new order of active usernames. All currently active usernames must be specified +//@description Changes order of active usernames of a supergroup or channel, requires owner privileges in the supergroup or channel +//@supergroup_id Identifier of the supergroup or channel +//@usernames The new order of active usernames. All currently active usernames must be specified reorderSupergroupActiveUsernames supergroup_id:int53 usernames:vector<string> = Ok; //@description Changes the sticker set of a supergroup; requires can_change_info administrator right @supergroup_id Identifier of the supergroup @sticker_set_id New value of the supergroup sticker set identifier. Use 0 to remove the supergroup sticker set setSupergroupStickerSet supergroup_id:int53 sticker_set_id:int64 = Ok; -//@description Toggles whether sender signature is added to sent messages in a channel; requires can_change_info administrator right @supergroup_id Identifier of the channel @sign_messages New value of sign_messages -toggleSupergroupSignMessages supergroup_id:int53 sign_messages:Bool = Ok; +//@description Changes the custom emoji sticker set of a supergroup; requires can_change_info administrator right. The chat must have at least chatBoostFeatures.min_custom_emoji_sticker_set_boost_level boost level to pass the corresponding color +//@supergroup_id Identifier of the supergroup +//@custom_emoji_sticker_set_id New value of the custom emoji sticker set identifier for the supergroup. Use 0 to remove the custom emoji sticker set in the supergroup +setSupergroupCustomEmojiStickerSet supergroup_id:int53 custom_emoji_sticker_set_id:int64 = Ok; -//@description Toggles whether joining is mandatory to send messages to a discussion supergroup; requires can_restrict_members administrator right @supergroup_id Identifier of the supergroup @join_to_send_messages New value of join_to_send_messages +//@description Changes the number of times the supergroup must be boosted by a user to ignore slow mode and chat permission restrictions; requires can_restrict_members administrator right +//@supergroup_id Identifier of the supergroup +//@unrestrict_boost_count New value of the unrestrict_boost_count supergroup setting; 0-8. Use 0 to remove the setting +setSupergroupUnrestrictBoostCount supergroup_id:int53 unrestrict_boost_count:int32 = Ok; + +//@description Toggles whether sender signature or link to the account is added to sent messages in a channel; requires can_change_info member right +//@supergroup_id Identifier of the channel +//@sign_messages New value of sign_messages +//@show_message_sender New value of show_message_sender +toggleSupergroupSignMessages supergroup_id:int53 sign_messages:Bool show_message_sender:Bool = Ok; + +//@description Toggles whether joining is mandatory to send messages to a discussion supergroup; requires can_restrict_members administrator right +//@supergroup_id Identifier of the supergroup that isn't a broadcast group +//@join_to_send_messages New value of join_to_send_messages toggleSupergroupJoinToSendMessages supergroup_id:int53 join_to_send_messages:Bool = Ok; -//@description Toggles whether all users directly joining the supergroup need to be approved by supergroup administrators; requires can_restrict_members administrator right @supergroup_id Identifier of the channel @join_by_request New value of join_by_request +//@description Toggles whether all users directly joining the supergroup need to be approved by supergroup administrators; requires can_restrict_members administrator right +//@supergroup_id Identifier of the supergroup that isn't a broadcast group +//@join_by_request New value of join_by_request toggleSupergroupJoinByRequest supergroup_id:int53 join_by_request:Bool = Ok; -//@description Toggles whether the message history of a supergroup is available to new members; requires can_change_info administrator right @supergroup_id The identifier of the supergroup @is_all_history_available The new value of is_all_history_available +//@description Toggles whether the message history of a supergroup is available to new members; requires can_change_info member right @supergroup_id The identifier of the supergroup @is_all_history_available The new value of is_all_history_available toggleSupergroupIsAllHistoryAvailable supergroup_id:int53 is_all_history_available:Bool = Ok; +//@description Toggles whether sponsored messages are shown in the channel chat; requires owner privileges in the channel. The chat must have at least chatBoostFeatures.min_sponsored_message_disable_boost_level boost level to disable sponsored messages +//@supergroup_id The identifier of the channel +//@can_have_sponsored_messages The new value of can_have_sponsored_messages +toggleSupergroupCanHaveSponsoredMessages supergroup_id:int53 can_have_sponsored_messages:Bool = Ok; + //@description Toggles whether non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers. Can be called only if supergroupFullInfo.can_hide_members == true //@supergroup_id Identifier of the supergroup //@has_hidden_members New value of has_hidden_members @@ -7849,19 +11067,21 @@ toggleSupergroupIsForum supergroup_id:int53 is_forum:Bool = Ok; //@description Upgrades supergroup to a broadcast group; requires owner privileges in the supergroup @supergroup_id Identifier of the supergroup toggleSupergroupIsBroadcastGroup supergroup_id:int53 = Ok; -//@description Reports messages in a supergroup as spam; requires administrator rights in the supergroup @supergroup_id Supergroup identifier @message_ids Identifiers of messages to report +//@description Reports messages in a supergroup as spam; requires administrator rights in the supergroup +//@supergroup_id Supergroup identifier +//@message_ids Identifiers of messages to report. Use messageProperties.can_be_reported to check whether the message can be reported reportSupergroupSpam supergroup_id:int53 message_ids:vector<int53> = Ok; //@description Reports a false deletion of a message by aggressive anti-spam checks; requires administrator rights in the supergroup. Can be called only for messages from chatEventMessageDeleted with can_report_anti_spam_false_positive == true //@supergroup_id Supergroup identifier -//@message_id Identifier of the erroneously deleted message +//@message_id Identifier of the erroneously deleted message from chatEventMessageDeleted reportSupergroupAntiSpamFalsePositive supergroup_id:int53 message_id:int53 = Ok; //@description Returns information about members or banned users in a supergroup or channel. Can be used only if supergroupFullInfo.can_get_members == true; additionally, administrator privileges may be required for some filters //@supergroup_id Identifier of the supergroup or channel //@filter The type of users to return; pass null to use supergroupMembersFilterRecent //@offset Number of users to skip -//@limit The maximum number of users be returned; up to 200 +//@limit The maximum number of users to be returned; up to 200 getSupergroupMembers supergroup_id:int53 filter:SupergroupMembersFilter offset:int32 limit:int32 = ChatMembers; @@ -7879,7 +11099,11 @@ closeSecretChat secret_chat_id:int32 = Ok; getChatEventLog chat_id:int53 query:string from_event_id:int64 limit:int32 filters:chatEventLogFilters user_ids:vector<int53> = ChatEvents; -//@description Returns an invoice payment form. This method must be called when the user presses inlineKeyboardButtonBuy +//@description Returns the list of supported time zones +getTimeZones = TimeZones; + + +//@description Returns an invoice payment form. This method must be called when the user presses inline button of the type inlineKeyboardButtonTypeBuy, or wants to buy access to media in a messagePaidMedia message //@input_invoice The invoice //@theme Preferred payment form theme; pass null to use the default theme getPaymentForm input_invoice:InputInvoice theme:themeParameters = PaymentForm; @@ -7895,7 +11119,7 @@ validateOrderInfo input_invoice:InputInvoice order_info:orderInfo allow_save:Boo //@payment_form_id Payment form identifier returned by getPaymentForm //@order_info_id Identifier returned by validateOrderInfo, or an empty string //@shipping_option_id Identifier of a chosen shipping option, if applicable -//@credentials The credentials chosen by user for payment +//@credentials The credentials chosen by user for payment; pass null for a payment in Telegram Stars //@tip_amount Chosen by the user amount of tip in the smallest units of the currency sendPaymentForm input_invoice:InputInvoice payment_form_id:int64 order_info_id:string shipping_option_id:string credentials:InputCredentials tip_amount:int53 = PaymentResult; @@ -7915,31 +11139,39 @@ deleteSavedCredentials = Ok; //@description Creates a link for the given invoice; for bots only @invoice Information about the invoice of the type inputMessageInvoice createInvoiceLink invoice:InputMessageContent = HttpUrl; +//@description Refunds a previously done payment in Telegram Stars +//@user_id Identifier of the user that did the payment +//@telegram_payment_charge_id Telegram payment identifier +refundStarPayment user_id:int53 telegram_payment_charge_id:string = Ok; + //@description Returns a user that can be contacted to get support getSupportUser = User; -//@description Returns backgrounds installed by the user @for_dark_theme Pass true to order returned backgrounds for a dark theme -getBackgrounds for_dark_theme:Bool = Backgrounds; - -//@description Constructs a persistent HTTP URL for a background @name Background name @type Background type +//@description Constructs a persistent HTTP URL for a background @name Background name @type Background type; backgroundTypeChatTheme isn't supported getBackgroundUrl name:string type:BackgroundType = HttpUrl; //@description Searches for a background by its name @name The name of the background searchBackground name:string = Background; -//@description Changes the background selected by the user; adds background to the list of installed backgrounds -//@background The input background to use; pass null to create a new filled background or to remove the current background -//@type Background type; pass null to use the default type of the remote background or to remove the current background -//@for_dark_theme Pass true if the background is changed for a dark theme -setBackground background:InputBackground type:BackgroundType for_dark_theme:Bool = Background; +//@description Sets default background for chats; adds the background to the list of installed backgrounds +//@background The input background to use; pass null to create a new filled background +//@type Background type; pass null to use the default type of the remote background; backgroundTypeChatTheme isn't supported +//@for_dark_theme Pass true if the background is set for a dark theme +setDefaultBackground background:InputBackground type:BackgroundType for_dark_theme:Bool = Background; + +//@description Deletes default background for chats @for_dark_theme Pass true if the background is deleted for a dark theme +deleteDefaultBackground for_dark_theme:Bool = Ok; + +//@description Returns backgrounds installed by the user @for_dark_theme Pass true to order returned backgrounds for a dark theme +getInstalledBackgrounds for_dark_theme:Bool = Backgrounds; //@description Removes background from the list of installed backgrounds @background_id The background identifier -removeBackground background_id:int64 = Ok; +removeInstalledBackground background_id:int64 = Ok; //@description Resets list of installed backgrounds to its default value -resetBackgrounds = Ok; +resetInstalledBackgrounds = Ok; //@description Returns information about the current localization target. This is an offline request if only_local is true. Can be called before authorization @only_local Pass true to get only locally available information without sending network requests @@ -7953,14 +11185,16 @@ getLanguagePackInfo language_pack_id:string = LanguagePackInfo; //@keys Language pack keys of the strings to be returned; leave empty to request all available strings getLanguagePackStrings language_pack_id:string keys:vector<string> = LanguagePackStrings; -//@description Fetches the latest versions of all strings from a language pack in the current localization target from the server. This method doesn't need to be called explicitly for the current used/base language packs. Can be called before authorization @language_pack_id Language pack identifier +//@description Fetches the latest versions of all strings from a language pack in the current localization target from the server. +//-This method doesn't need to be called explicitly for the current used/base language packs. Can be called before authorization +//@language_pack_id Language pack identifier synchronizeLanguagePack language_pack_id:string = Ok; //@description Adds a custom server language pack to the list of installed language packs in current localization target. Can be called before authorization @language_pack_id Identifier of a language pack to be added addCustomServerLanguagePack language_pack_id:string = Ok; //@description Adds or changes a custom local language pack to the current localization target -//@info Information about the language pack. Language pack ID must start with 'X', consist only of English letters, digits and hyphens, and must not exceed 64 characters. Can be called before authorization +//@info Information about the language pack. Language pack identifier must start with 'X', consist only of English letters, digits and hyphens, and must not exceed 64 characters. Can be called before authorization //@strings Strings of the new language pack setCustomLanguagePack info:languagePackInfo strings:vector<languagePackString> = Ok; @@ -7997,6 +11231,24 @@ setUserPrivacySettingRules setting:UserPrivacySetting rules:userPrivacySettingRu //@description Returns the current privacy settings @setting The privacy setting getUserPrivacySettingRules setting:UserPrivacySetting = UserPrivacySettingRules; +//@description Changes privacy settings for message read date @settings New settings +setReadDatePrivacySettings settings:readDatePrivacySettings = Ok; + +//@description Returns privacy settings for message read date +getReadDatePrivacySettings = ReadDatePrivacySettings; + +//@description Changes privacy settings for new chat creation; can be used only if getOption("can_set_new_chat_privacy_settings") @settings New settings +setNewChatPrivacySettings settings:newChatPrivacySettings = Ok; + +//@description Returns privacy settings for new chat creation +getNewChatPrivacySettings = NewChatPrivacySettings; + + +//@description Check whether the current user can message another user or try to create a chat with them +//@user_id Identifier of the other user +//@only_local Pass true to get only locally available information without sending network requests +canSendMessageToUser user_id:int53 only_local:Bool = CanSendMessageToUserResult; + //@description Returns the value of an option by its name. (Check the list of available options on https://core.telegram.org/tdlib/options.) Can be called before authorization. Can be called synchronously for options "version" and "commit_hash" //@name The name of the option @@ -8017,7 +11269,7 @@ getAccountTtl = AccountTtl; //@description Deletes the account of the current user, deleting all information associated with the user from the server. The phone number of the account can be used to create a new account. //-Can be called before authorization when the current authorization state is authorizationStateWaitPassword //@reason The reason why the account was deleted; optional -//@password The 2-step verification password of the current user. If not specified, account deletion can be canceled within one week +//@password The 2-step verification password of the current user. If the current user isn't authorized, then an empty string can be passed and account deletion can be canceled within one week deleteAccount reason:string password:string = Ok; @@ -8033,31 +11285,72 @@ removeChatActionBar chat_id:int53 = Ok; //@description Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if chat.can_be_reported //@chat_id Chat identifier -//@message_ids Identifiers of reported messages; may be empty to report the whole chat +//@message_ids Identifiers of reported messages; may be empty to report the whole chat. Use messageProperties.can_be_reported to check whether the message can be reported //@reason The reason for reporting the chat //@text Additional report details; 0-1024 characters -reportChat chat_id:int53 message_ids:vector<int53> reason:ChatReportReason text:string = Ok; +reportChat chat_id:int53 message_ids:vector<int53> reason:ReportReason text:string = Ok; //@description Reports a chat photo to the Telegram moderators. A chat photo can be reported only if chat.can_be_reported //@chat_id Chat identifier //@file_id Identifier of the photo to report. Only full photos from chatPhoto can be reported //@reason The reason for reporting the chat photo //@text Additional report details; 0-1024 characters -reportChatPhoto chat_id:int53 file_id:int32 reason:ChatReportReason text:string = Ok; +reportChatPhoto chat_id:int53 file_id:int32 reason:ReportReason text:string = Ok; -//@description Reports reactions set on a message to the Telegram moderators. Reactions on a message can be reported only if message.can_report_reactions +//@description Reports reactions set on a message to the Telegram moderators. Reactions on a message can be reported only if messageProperties.can_report_reactions //@chat_id Chat identifier //@message_id Message identifier //@sender_id Identifier of the sender, which added the reaction reportMessageReactions chat_id:int53 message_id:int53 sender_id:MessageSender = Ok; +//@description Returns detailed revenue statistics about a chat. Currently, this method can be used only for channels if supergroupFullInfo.can_get_revenue_statistics == true @chat_id Chat identifier @is_dark Pass true if a dark theme is used by the application +getChatRevenueStatistics chat_id:int53 is_dark:Bool = ChatRevenueStatistics; + +//@description Returns a URL for chat revenue withdrawal; requires owner privileges in the chat. Currently, this method can be used only for channels if supergroupFullInfo.can_get_revenue_statistics == true and getOption("can_withdraw_chat_revenue") +//@chat_id Chat identifier +//@password The 2-step verification password of the current user +getChatRevenueWithdrawalUrl chat_id:int53 password:string = HttpUrl; + +//@description Returns the list of revenue transactions for a chat. Currently, this method can be used only for channels if supergroupFullInfo.can_get_revenue_statistics == true +//@chat_id Chat identifier +//@offset Number of transactions to skip +//@limit The maximum number of transactions to be returned; up to 200 +getChatRevenueTransactions chat_id:int53 offset:int32 limit:int32 = ChatRevenueTransactions; + + +//@description Returns detailed Telegram Star revenue statistics +//@owner_id Identifier of the owner of the Telegram Stars; can be identifier of an owned bot, or identifier of a channel chat with supergroupFullInfo.can_get_star_revenue_statistics == true +//@is_dark Pass true if a dark theme is used by the application +getStarRevenueStatistics owner_id:MessageSender is_dark:Bool = StarRevenueStatistics; + +//@description Returns a URL for Telegram Star withdrawal +//@owner_id Identifier of the owner of the Telegram Stars; can be identifier of an owned bot, or identifier of an owned channel chat +//@star_count The number of Telegram Stars to withdraw. Must be at least getOption("star_withdrawal_count_min") +//@password The 2-step verification password of the current user +getStarWithdrawalUrl owner_id:MessageSender star_count:int53 password:string = HttpUrl; + +//@description Returns a URL for a Telegram Ad platform account that can be used to set up advertisements for the chat paid in the owned Telegram Stars +//@owner_id Identifier of the owner of the Telegram Stars; can be identifier of an owned bot, or identifier of an owned channel chat +getStarAdAccountUrl owner_id:MessageSender = HttpUrl; + + //@description Returns detailed statistics about a chat. Currently, this method can be used only for supergroups and channels. Can be used only if supergroupFullInfo.can_get_statistics == true @chat_id Chat identifier @is_dark Pass true if a dark theme is used by the application getChatStatistics chat_id:int53 is_dark:Bool = ChatStatistics; -//@description Returns detailed statistics about a message. Can be used only if message.can_get_statistics == true @chat_id Chat identifier @message_id Message identifier @is_dark Pass true if a dark theme is used by the application +//@description Returns detailed statistics about a message. Can be used only if messageProperties.can_get_statistics == true @chat_id Chat identifier @message_id Message identifier @is_dark Pass true if a dark theme is used by the application getMessageStatistics chat_id:int53 message_id:int53 is_dark:Bool = MessageStatistics; +//@description Returns forwarded copies of a channel message to different public channels and public reposts as a story. Can be used only if messageProperties.can_get_statistics == true. For optimal performance, the number of returned messages and stories is chosen by TDLib +//@chat_id Chat identifier of the message +//@message_id Message identifier +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of messages and stories to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit +getMessagePublicForwards chat_id:int53 message_id:int53 offset:string limit:int32 = PublicForwards; + +//@description Returns detailed statistics about a story. Can be used only if story.can_get_statistics == true @chat_id Chat identifier @story_id Story identifier @is_dark Pass true if a dark theme is used by the application +getStoryStatistics chat_id:int53 story_id:int32 is_dark:Bool = StoryStatistics; + //@description Loads an asynchronous or a zoomed in statistical graph @chat_id Chat identifier @token The token for graph loading @x X-value for zoomed in graph or 0 otherwise getStatisticalGraph chat_id:int53 token:string x:int53 = StatisticalGraph; @@ -8141,18 +11434,6 @@ setPassportElementErrors user_id:int53 errors:vector<inputPassportElementError> getPreferredCountryLanguage country_code:string = Text; -//@description Sends a code to verify a phone number to be added to a user's Telegram Passport -//@phone_number The phone number of the user, in international format -//@settings Settings for the authentication of the user's phone number; pass null to use default settings -sendPhoneNumberVerificationCode phone_number:string settings:phoneNumberAuthenticationSettings = AuthenticationCodeInfo; - -//@description Resends the code to verify a phone number to be added to a user's Telegram Passport -resendPhoneNumberVerificationCode = AuthenticationCodeInfo; - -//@description Checks the phone number verification code for Telegram Passport @code Verification code to check -checkPhoneNumberVerificationCode code:string = Ok; - - //@description Sends a code to verify an email address to be added to a user's Telegram Passport @email_address Email address sendEmailAddressVerificationCode email_address:string = EmailAddressAuthenticationCodeInfo; @@ -8181,19 +11462,6 @@ getPassportAuthorizationFormAvailableElements authorization_form_id:int32 passwo sendPassportAuthorizationForm authorization_form_id:int32 types:vector<PassportElementType> = Ok; -//@description Sends phone number confirmation code to handle links of the type internalLinkTypePhoneNumberConfirmation -//@hash Hash value from the link -//@phone_number Phone number value from the link -//@settings Settings for the authentication of the user's phone number; pass null to use default settings -sendPhoneNumberConfirmationCode hash:string phone_number:string settings:phoneNumberAuthenticationSettings = AuthenticationCodeInfo; - -//@description Resends phone number confirmation code -resendPhoneNumberConfirmationCode = AuthenticationCodeInfo; - -//@description Checks phone number confirmation code @code Confirmation code to check -checkPhoneNumberConfirmationCode code:string = Ok; - - //@description Informs the server about the number of pending bot updates if they haven't been processed for a long time; for bots only @pending_update_count The number of pending updates @error_message The last error message setBotUpdatesStatus pending_update_count:int32 error_message:string = Ok; @@ -8214,61 +11482,73 @@ checkStickerSetName name:string = CheckStickerSetNameResult; //@description Creates a new sticker set. Returns the newly created sticker set //@user_id Sticker set owner; ignored for regular users //@title Sticker set title; 1-64 characters -//@name Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_<bot username>"* (*<bot_username>* is case insensitive) for bots; 1-64 characters -//@sticker_format Format of the stickers in the set +//@name Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_<bot username>"* (*<bot_username>* is case insensitive) for bots; 0-64 characters. +//-If empty, then the name returned by getSuggestedStickerSetName will be used automatically //@sticker_type Type of the stickers in the set //@needs_repainting Pass true if stickers in the sticker set must be repainted; for custom emoji sticker sets only -//@stickers List of stickers to be added to the set; must be non-empty. All stickers must have the same format. For TGS stickers, uploadStickerFile must be used before the sticker is shown +//@stickers List of stickers to be added to the set; 1-200 stickers for custom emoji sticker sets, and 1-120 stickers otherwise. For TGS stickers, uploadStickerFile must be used before the sticker is shown //@source Source of the sticker set; may be empty if unknown -createNewStickerSet user_id:int53 title:string name:string sticker_format:StickerFormat sticker_type:StickerType needs_repainting:Bool stickers:vector<inputSticker> source:string = StickerSet; - +createNewStickerSet user_id:int53 title:string name:string sticker_type:StickerType needs_repainting:Bool stickers:vector<inputSticker> source:string = StickerSet; -//@description Adds a new sticker to a set; for bots only -//@user_id Sticker set owner -//@name Sticker set name +//@description Adds a new sticker to a set +//@user_id Sticker set owner; ignored for regular users +//@name Sticker set name. The sticker set must be owned by the current user, and contain less than 200 stickers for custom emoji sticker sets and less than 120 otherwise //@sticker Sticker to add to the set addStickerToSet user_id:int53 name:string sticker:inputSticker = Ok; -//@description Sets a sticker set thumbnail; for bots only -//@user_id Sticker set owner -//@name Sticker set name -//@thumbnail Thumbnail to set in PNG, TGS, or WEBM format; pass null to remove the sticker set thumbnail. Thumbnail format must match the format of stickers in the set -setStickerSetThumbnail user_id:int53 name:string thumbnail:InputFile = Ok; +//@description Replaces existing sticker in a set. The function is equivalent to removeStickerFromSet, then addStickerToSet, then setStickerPositionInSet +//@user_id Sticker set owner; ignored for regular users +//@name Sticker set name. The sticker set must be owned by the current user +//@old_sticker Sticker to remove from the set +//@new_sticker Sticker to add to the set +replaceStickerInSet user_id:int53 name:string old_sticker:InputFile new_sticker:inputSticker = Ok; + +//@description Sets a sticker set thumbnail +//@user_id Sticker set owner; ignored for regular users +//@name Sticker set name. The sticker set must be owned by the current user +//@thumbnail Thumbnail to set; pass null to remove the sticker set thumbnail +//@format Format of the thumbnail; pass null if thumbnail is removed +setStickerSetThumbnail user_id:int53 name:string thumbnail:InputFile format:StickerFormat = Ok; -//@description Sets a custom emoji sticker set thumbnail; for bots only -//@name Sticker set name +//@description Sets a custom emoji sticker set thumbnail +//@name Sticker set name. The sticker set must be owned by the current user //@custom_emoji_id Identifier of the custom emoji from the sticker set, which will be set as sticker set thumbnail; pass 0 to remove the sticker set thumbnail setCustomEmojiStickerSetThumbnail name:string custom_emoji_id:int64 = Ok; -//@description Sets a sticker set title; for bots only @name Sticker set name @title New sticker set title +//@description Sets a sticker set title @name Sticker set name. The sticker set must be owned by the current user @title New sticker set title setStickerSetTitle name:string title:string = Ok; -//@description Deleted a sticker set; for bots only @name Sticker set name +//@description Completely deletes a sticker set @name Sticker set name. The sticker set must be owned by the current user deleteStickerSet name:string = Ok; -//@description Changes the position of a sticker in the set to which it belongs; for bots only. The sticker set must have been created by the bot +//@description Changes the position of a sticker in the set to which it belongs. The sticker set must be owned by the current user //@sticker Sticker //@position New position of the sticker in the set, 0-based setStickerPositionInSet sticker:InputFile position:int32 = Ok; -//@description Removes a sticker from the set to which it belongs; for bots only. The sticker set must have been created by the bot @sticker Sticker +//@description Removes a sticker from the set to which it belongs. The sticker set must be owned by the current user @sticker Sticker to remove from the set removeStickerFromSet sticker:InputFile = Ok; -//@description Changes the list of emoji corresponding to a sticker; for bots only. The sticker must belong to a regular or custom emoji sticker set created by the bot +//@description Changes the list of emojis corresponding to a sticker. The sticker must belong to a regular or custom emoji sticker set that is owned by the current user //@sticker Sticker //@emojis New string with 1-20 emoji corresponding to the sticker setStickerEmojis sticker:InputFile emojis:string = Ok; -//@description Changes the list of keywords of a sticker; for bots only. The sticker must belong to a regular or custom emoji sticker set created by the bot +//@description Changes the list of keywords of a sticker. The sticker must belong to a regular or custom emoji sticker set that is owned by the current user //@sticker Sticker //@keywords List of up to 20 keywords with total length up to 64 characters, which can be used to find the sticker setStickerKeywords sticker:InputFile keywords:vector<string> = Ok; -//@description Changes the mask position of a mask sticker; for bots only. The sticker must belong to a mask sticker set created by the bot +//@description Changes the mask position of a mask sticker. The sticker must belong to a mask sticker set that is owned by the current user //@sticker Sticker //@mask_position Position where the mask is placed; pass null to remove mask position setStickerMaskPosition sticker:InputFile mask_position:maskPosition = Ok; +//@description Returns sticker sets owned by the current user +//@offset_sticker_set_id Identifier of the sticker set from which to return owned sticker sets; use 0 to get results from the beginning +//@limit The maximum number of sticker sets to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit +getOwnedStickerSets offset_sticker_set_id:int64 limit:int32 = StickerSets; + //@description Returns information about a file with a map thumbnail in PNG format. Only map thumbnail files with size less than 1MB can be downloaded //@location Location of the map center @@ -8298,8 +11578,53 @@ clickPremiumSubscriptionButton = Ok; //@description Returns state of Telegram Premium subscription and promotion videos for Premium features getPremiumState = PremiumState; -//@description Checks whether Telegram Premium purchase is possible. Must be called before in-store Premium purchase @purpose Transaction purpose -canPurchasePremium purpose:StorePaymentPurpose = Ok; +//@description Returns available options for Telegram Premium gift code or Telegram Premium giveaway creation +//@boosted_chat_id Identifier of the supergroup or channel chat, which will be automatically boosted by receivers of the gift codes and which is administered by the user; 0 if none +getPremiumGiftCodePaymentOptions boosted_chat_id:int53 = PremiumGiftCodePaymentOptions; + +//@description Return information about a Telegram Premium gift code @code The code to check +checkPremiumGiftCode code:string = PremiumGiftCodeInfo; + +//@description Applies a Telegram Premium gift code @code The code to apply +applyPremiumGiftCode code:string = Ok; + +//@description Launches a prepaid giveaway +//@giveaway_id Unique identifier of the prepaid giveaway +//@parameters Giveaway parameters +//@winner_count The number of users to receive giveaway prize +//@star_count The number of Telegram Stars to be distributed through the giveaway; pass 0 for Telegram Premium giveaways +launchPrepaidGiveaway giveaway_id:int64 parameters:giveawayParameters winner_count:int32 star_count:int53 = Ok; + +//@description Returns information about a giveaway +//@chat_id Identifier of the channel chat which started the giveaway +//@message_id Identifier of the giveaway or a giveaway winners message in the chat +getGiveawayInfo chat_id:int53 message_id:int53 = GiveawayInfo; + +//@description Returns available options for Telegram Stars purchase +getStarPaymentOptions = StarPaymentOptions; + +//@description Returns available options for Telegram Stars gifting @user_id Identifier of the user that will receive Telegram Stars; pass 0 to get options for an unspecified user +getStarGiftPaymentOptions user_id:int53 = StarPaymentOptions; + +//@description Returns available options for Telegram Star giveaway creation +getStarGiveawayPaymentOptions = StarGiveawayPaymentOptions; + +//@description Returns the list of Telegram Star transactions for the specified owner +//@owner_id Identifier of the owner of the Telegram Stars; can be the identifier of the current user, identifier of an owned bot, +//-or identifier of a channel chat with supergroupFullInfo.can_get_star_revenue_statistics == true +//@subscription_id If non-empty, only transactions related to the Star Subscription will be returned +//@direction Direction of the transactions to receive; pass null to get all transactions +//@offset Offset of the first transaction to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of transactions to return +getStarTransactions owner_id:MessageSender subscription_id:string direction:StarTransactionDirection offset:string limit:int32 = StarTransactions; + +//@description Returns the list of Telegram Star subscriptions for the current user +//@only_expiring Pass true to receive only expiring subscriptions for which there are no enough Telegram Stars to extend +//@offset Offset of the first subscription to return as received from the previous request; use empty string to get the first chunk of results +getStarSubscriptions only_expiring:Bool offset:string = StarSubscriptions; + +//@description Checks whether an in-store purchase is possible. Must be called before any in-store purchase @purpose Transaction purpose +canPurchaseFromStore purpose:StorePaymentPurpose = Ok; //@description Informs server about a purchase through App Store. For official applications only @receipt App Store receipt @purpose Transaction purpose assignAppStoreTransaction receipt:bytes purpose:StorePaymentPurpose = Ok; @@ -8311,11 +11636,31 @@ assignAppStoreTransaction receipt:bytes purpose:StorePaymentPurpose = Ok; //@purpose Transaction purpose assignGooglePlayTransaction package_name:string store_product_id:string purchase_token:string purpose:StorePaymentPurpose = Ok; +//@description Cancels or reenables Telegram Star subscription to a channel +//@subscription_id Identifier of the subscription to change +//@is_canceled New value of is_canceled +editStarSubscription subscription_id:string is_canceled:Bool = Ok; + +//@description Reuses an active subscription and joins the subscribed chat again @subscription_id Identifier of the subscription +reuseStarSubscription subscription_id:string = Ok; + + +//@description Returns information about features, available to Business users @source Source of the request; pass null if the method is called from settings or some non-standard source +getBusinessFeatures source:BusinessFeature = BusinessFeatures; + //@description Accepts Telegram terms of services @terms_of_service_id Terms of service identifier acceptTermsOfService terms_of_service_id:string = Ok; +//@description Searches specified query by word prefixes in the provided strings. Returns 0-based positions of strings that matched. Can be called synchronously +//@strings The strings to search in for the query +//@query Query to search for +//@limit The maximum number of objects to return +//@return_none_for_empty_query Pass true to receive no results for an empty query +searchStringsByPrefix strings:vector<string> query:string limit:int32 return_none_for_empty_query:Bool = FoundPositions; + + //@description Sends a custom request; for bots only @method The method name @parameters JSON-serialized method parameters sendCustomRequest method:string parameters:string = CustomRequestResult; @@ -8342,6 +11687,11 @@ getPhoneNumberInfo phone_number_prefix:string = PhoneNumberInfo; getPhoneNumberInfoSync language_code:string phone_number_prefix:string = PhoneNumberInfo; +//@description Returns information about a given collectible item that was purchased at https://fragment.com +//@type Type of the collectible item. The item must be used by a user and must be visible to the current user +getCollectibleItemInfo type:CollectibleItemType = CollectibleItemInfo; + + //@description Returns information about a tg:// deep link. Use "tg://need_update_for_some_feature" or "tg:some_unsupported_feature" for testing. Returns a 404 error for unknown links. Can be called before authorization @link The link getDeepLinkInfo link:string = DeepLinkInfo; @@ -8349,9 +11699,6 @@ getDeepLinkInfo link:string = DeepLinkInfo; //@description Returns application config, provided by the server. Can be called before authorization getApplicationConfig = JsonValue; -//@description Adds server-provided application changelog as messages to the chat 777000 (Telegram); for official applications only. Returns a 404 error if nothing changed @previous_application_version The previous application version -addApplicationChangelog previous_application_version:string = Ok; - //@description Saves application log event on the server. Can be called before authorization @type Event type @chat_id Optional chat identifier, associated with the event @data The log event data saveApplicationLogEvent type:string chat_id:int53 data:JsonValue = Ok; @@ -8360,7 +11707,7 @@ getApplicationDownloadLink = HttpUrl; //@description Adds a proxy server for network requests. Can be called before authorization -//@server Proxy server IP address +//@server Proxy server domain or IP address //@port Proxy server port //@enable Pass true to immediately enable the proxy //@type Proxy type @@ -8368,7 +11715,7 @@ addProxy server:string port:int32 enable:Bool type:ProxyType = Proxy; //@description Edits an existing proxy server for network requests. Can be called before authorization //@proxy_id Proxy identifier -//@server Proxy server IP address +//@server Proxy server domain or IP address //@port Proxy server port //@enable Pass true to immediately enable the proxy //@type Proxy type @@ -8383,7 +11730,7 @@ disableProxy = Ok; //@description Removes a proxy server. Can be called before authorization @proxy_id Proxy identifier removeProxy proxy_id:int32 = Ok; -//@description Returns list of proxies that are currently set up. Can be called before authorization +//@description Returns the list of proxies that are currently set up. Can be called before authorization getProxies = Proxies; //@description Returns an HTTPS link, which can be used to add a proxy. Available only for SOCKS5 and MTProto proxies. Can be called before authorization @proxy_id Proxy identifier @@ -8407,7 +11754,7 @@ setLogVerbosityLevel new_verbosity_level:int32 = Ok; //@description Returns current verbosity level of the internal logging of TDLib. Can be called synchronously getLogVerbosityLevel = LogVerbosityLevel; -//@description Returns list of available TDLib internal log tags, for example, ["actor", "binlog", "connections", "notifications", "proxy"]. Can be called synchronously +//@description Returns the list of available TDLib internal log tags, for example, ["actor", "binlog", "connections", "notifications", "proxy"]. Can be called synchronously getLogTags = LogTags; //@description Sets the verbosity level for a specified TDLib internal log tag. Can be called synchronously @@ -8462,7 +11809,7 @@ testSquareInt x:int32 = TestInt; testNetwork = Ok; //@description Sends a simple network request to the Telegram servers via proxy; for testing only. Can be called before authorization -//@server Proxy server IP address +//@server Proxy server domain or IP address //@port Proxy server port //@type Proxy type //@dc_id Identifier of a datacenter with which to test connection diff --git a/protocols/Telegram/tdlib/td/td/generate/scheme/telegram_api.tl b/protocols/Telegram/tdlib/td/td/generate/scheme/telegram_api.tl index 00b46b7213..1a02c77f07 100644 --- a/protocols/Telegram/tdlib/td/td/generate/scheme/telegram_api.tl +++ b/protocols/Telegram/tdlib/td/td/generate/scheme/telegram_api.tl @@ -24,10 +24,13 @@ inputStickerSetThumbLegacy#dbaeae9 stickerset:InputStickerSet volume_id:long loc ---functions--- -test.useError = Error; test.useConfigSimple = help.ConfigSimple; test.parseInputAppEvent = InputAppEvent; +invokeWithBusinessConnectionPrefix#dd289f8e connection_id:string = Error; +invokeWithGooglePlayIntegrityPrefix#1df92984 nonce:string token:string = Error; +invokeWithApnsSecretPrefix#0dae54f8 nonce:string secret:string = Error; + ---types--- inputPeerEmpty#7f3b18ea = InputPeer; @@ -47,6 +50,7 @@ inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_na inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile; inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile; +inputFileStoryDocument#62dc8b48 id:InputDocument = InputFile; inputMediaEmpty#9664f57f = InputMedia; inputMediaUploadedPhoto#1e287d04 flags:# spoiler:flags.2?true file:InputFile stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia; @@ -59,10 +63,13 @@ inputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string pro inputMediaPhotoExternal#e5bbfe1a flags:# spoiler:flags.1?true url:string ttl_seconds:flags.0?int = InputMedia; inputMediaDocumentExternal#fb52dc99 flags:# spoiler:flags.1?true url:string ttl_seconds:flags.0?int = InputMedia; inputMediaGame#d33f43f3 id:InputGame = InputMedia; -inputMediaInvoice#8eb5a6d5 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:flags.1?string extended_media:flags.2?InputMedia = InputMedia; +inputMediaInvoice#405fef0d flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:flags.3?string provider_data:DataJSON start_param:flags.1?string extended_media:flags.2?InputMedia = InputMedia; inputMediaGeoLive#971fa843 flags:# stopped:flags.0?true geo_point:InputGeoPoint heading:flags.2?int period:flags.1?int proximity_notification_radius:flags.3?int = InputMedia; inputMediaPoll#f94e5f1 flags:# poll:Poll correct_answers:flags.0?Vector<bytes> solution:flags.1?string solution_entities:flags.1?Vector<MessageEntity> = InputMedia; inputMediaDice#e66fbf7b emoticon:string = InputMedia; +inputMediaStory#89fdd778 peer:InputPeer id:int = InputMedia; +inputMediaWebPage#c21b8849 flags:# force_large_media:flags.0?true force_small_media:flags.1?true optional:flags.2?true url:string = InputMedia; +inputMediaPaidMedia#c4103386 flags:# stars_amount:long extended_media:Vector<InputMedia> payload:flags.0?string = InputMedia; inputChatPhotoEmpty#1ca48f57 = InputChatPhoto; inputChatUploadedPhoto#bdcdaec0 flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double video_emoji_markup:flags.3?VideoSize = InputChatPhoto; @@ -101,7 +108,7 @@ storage.fileMp4#b3cea0e4 = storage.FileType; storage.fileWebp#1081464c = storage.FileType; userEmpty#d3bc4b7a id:long = User; -user#8f97c628 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# bot_can_edit:flags2.1?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector<Username> = User; +user#83314fca flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# bot_can_edit:flags2.1?true close_friend:flags2.2?true stories_hidden:flags2.3?true stories_unavailable:flags2.4?true contact_require_premium:flags2.10?true bot_business:flags2.11?true bot_has_main_app:flags2.13?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector<Username> stories_max_id:flags2.5?int color:flags2.8?PeerColor profile_color:flags2.9?PeerColor bot_active_users:flags2.12?int = User; userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto; userProfilePhoto#82d1f706 flags:# has_video:flags.0?true personal:flags.2?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto; @@ -109,18 +116,18 @@ userProfilePhoto#82d1f706 flags:# has_video:flags.0?true personal:flags.2?true p userStatusEmpty#9d05049 = UserStatus; userStatusOnline#edb93949 expires:int = UserStatus; userStatusOffline#8c703f was_online:int = UserStatus; -userStatusRecently#e26f42f1 = UserStatus; -userStatusLastWeek#7bf09fc = UserStatus; -userStatusLastMonth#77ebc742 = UserStatus; +userStatusRecently#7b197dc8 flags:# by_me:flags.0?true = UserStatus; +userStatusLastWeek#541a1d1a flags:# by_me:flags.0?true = UserStatus; +userStatusLastMonth#65899777 flags:# by_me:flags.0?true = UserStatus; chatEmpty#29562865 id:long = Chat; chat#41cbf256 flags:# creator:flags.0?true left:flags.2?true deactivated:flags.5?true call_active:flags.23?true call_not_empty:flags.24?true noforwards:flags.25?true id:long title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel admin_rights:flags.14?ChatAdminRights default_banned_rights:flags.18?ChatBannedRights = Chat; chatForbidden#6592a1a7 id:long title:string = Chat; -channel#83259464 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector<RestrictionReason> admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int usernames:flags2.0?Vector<Username> = Chat; +channel#fe4478bd flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# stories_hidden:flags2.1?true stories_hidden_min:flags2.2?true stories_unavailable:flags2.3?true signature_profiles:flags2.12?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector<RestrictionReason> admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int usernames:flags2.0?Vector<Username> stories_max_id:flags2.4?int color:flags2.7?PeerColor profile_color:flags2.8?PeerColor emoji_status:flags2.9?EmojiStatus level:flags2.10?int subscription_until_date:flags2.11?int = Chat; channelForbidden#17d493d5 flags:# broadcast:flags.5?true megagroup:flags.8?true id:long access_hash:long title:string until_date:flags.16?int = Chat; -chatFull#c9d31138 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true translations_disabled:flags.19?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector<BotInfo> pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string requests_pending:flags.17?int recent_requesters:flags.17?Vector<long> available_reactions:flags.18?ChatReactions = ChatFull; -channelFull#f2355507 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true participants_hidden:flags2.2?true translations_disabled:flags2.3?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector<long> default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions = ChatFull; +chatFull#2633421b flags:# can_set_username:flags.7?true has_scheduled:flags.8?true translations_disabled:flags.19?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector<BotInfo> pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string requests_pending:flags.17?int recent_requesters:flags.17?Vector<long> available_reactions:flags.18?ChatReactions reactions_limit:flags.20?int = ChatFull; +channelFull#bbab348d flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true participants_hidden:flags2.2?true translations_disabled:flags2.3?true stories_pinned_available:flags2.5?true view_forum_as_messages:flags2.6?true restricted_sponsored:flags2.11?true can_view_revenue:flags2.12?true paid_media_allowed:flags2.14?true can_view_stars_revenue:flags2.15?true paid_reactions_available:flags2.16?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector<long> default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions reactions_limit:flags2.13?int stories:flags2.4?PeerStories wallpaper:flags2.7?WallPaper boosts_applied:flags2.8?int boosts_unrestrict:flags2.9?int emojiset:flags2.10?StickerSet = ChatFull; chatParticipant#c02d4007 user_id:long inviter_id:long date:int = ChatParticipant; chatParticipantCreator#e46bcee4 user_id:long = ChatParticipant; @@ -133,7 +140,7 @@ chatPhotoEmpty#37c1011c = ChatPhoto; chatPhoto#1c6e1c11 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = ChatPhoto; messageEmpty#90a6ca84 flags:# id:int peer_id:flags.0?Peer = Message; -message#38116ee0 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int = Message; +message#94345242 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true invert_media:flags.27?true flags2:# offline:flags2.1?true id:int from_id:flags.8?Peer from_boosts_applied:flags.29?int peer_id:Peer saved_peer_id:flags.28?Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long via_business_bot_id:flags2.0?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int quick_reply_shortcut_id:flags.30?int effect:flags2.2?long factcheck:flags2.3?FactCheck = Message; messageService#2b085862 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction ttl_period:flags.25?int = Message; messageMediaEmpty#3ded6320 = MessageMedia; @@ -141,14 +148,18 @@ messageMediaPhoto#695150d7 flags:# spoiler:flags.3?true photo:flags.0?Photo ttl_ messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia; messageMediaContact#70322949 phone_number:string first_name:string last_name:string vcard:string user_id:long = MessageMedia; messageMediaUnsupported#9f84f49e = MessageMedia; -messageMediaDocument#9cb070d7 flags:# nopremium:flags.3?true spoiler:flags.4?true document:flags.0?Document ttl_seconds:flags.2?int = MessageMedia; -messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia; +messageMediaDocument#4cf4d72d flags:# nopremium:flags.3?true spoiler:flags.4?true video:flags.6?true round:flags.7?true voice:flags.8?true document:flags.0?Document alt_document:flags.5?Document ttl_seconds:flags.2?int = MessageMedia; +messageMediaWebPage#ddf10c3b flags:# force_large_media:flags.0?true force_small_media:flags.1?true manual:flags.3?true safe:flags.4?true webpage:WebPage = MessageMedia; messageMediaVenue#2ec0533f geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MessageMedia; messageMediaGame#fdb19008 game:Game = MessageMedia; messageMediaInvoice#f6a548d3 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument receipt_msg_id:flags.2?int currency:string total_amount:long start_param:string extended_media:flags.4?MessageExtendedMedia = MessageMedia; messageMediaGeoLive#b940c666 flags:# geo:GeoPoint heading:flags.0?int period:int proximity_notification_radius:flags.1?int = MessageMedia; messageMediaPoll#4bd6e798 poll:Poll results:PollResults = MessageMedia; messageMediaDice#3f7ee58b value:int emoticon:string = MessageMedia; +messageMediaStory#68cb6283 flags:# via_mention:flags.1?true peer:Peer id:int story:flags.0?StoryItem = MessageMedia; +messageMediaGiveaway#aa073beb flags:# only_new_subscribers:flags.0?true winners_are_visible:flags.2?true channels:Vector<long> countries_iso2:flags.1?Vector<string> prize_description:flags.3?string quantity:int months:flags.4?int stars:flags.5?long until_date:int = MessageMedia; +messageMediaGiveawayResults#ceaa3ea1 flags:# only_new_subscribers:flags.0?true refunded:flags.2?true channel_id:long additional_peers_count:flags.3?int launch_msg_id:int winners_count:int unclaimed_count:int winners:Vector<long> months:flags.4?int stars:flags.5?long prize_description:flags.1?string until_date:int = MessageMedia; +messageMediaPaidMedia#a8852491 stars_amount:long extended_media:Vector<MessageExtendedMedia> = MessageMedia; messageActionEmpty#b6aef7b0 = MessageAction; messageActionChatCreate#bd47cbad title:string users:Vector<long> = MessageAction; @@ -169,7 +180,7 @@ messageActionPaymentSent#96163f56 flags:# recurring_init:flags.2?true recurring_ messageActionPhoneCall#80e11a7f flags:# video:flags.2?true call_id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = MessageAction; messageActionScreenshotTaken#4792929b = MessageAction; messageActionCustomAction#fae69f56 message:string = MessageAction; -messageActionBotAllowed#c516d679 flags:# attach_menu:flags.1?true domain:flags.0?string app:flags.2?BotApp = MessageAction; +messageActionBotAllowed#c516d679 flags:# attach_menu:flags.1?true from_request:flags.3?true domain:flags.0?string app:flags.2?BotApp = MessageAction; messageActionSecureValuesSentMe#1b287353 values:Vector<SecureValue> credentials:SecureCredentialsEncrypted = MessageAction; messageActionSecureValuesSent#d95c6154 types:Vector<SecureValueType> = MessageAction; messageActionContactSignUp#f3f25f76 = MessageAction; @@ -186,11 +197,18 @@ messageActionGiftPremium#c83d6aec flags:# currency:string amount:long months:int messageActionTopicCreate#d999256 flags:# title:string icon_color:int icon_emoji_id:flags.0?long = MessageAction; messageActionTopicEdit#c0944820 flags:# title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = MessageAction; messageActionSuggestProfilePhoto#57de635e photo:Photo = MessageAction; -messageActionRequestedPeer#fe77345d button_id:int peer:Peer = MessageAction; -messageActionSetChatWallPaper#bc44a927 wallpaper:WallPaper = MessageAction; -messageActionSetSameChatWallPaper#c0787d6d wallpaper:WallPaper = MessageAction; - -dialog#d58a08c6 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int ttl_period:flags.5?int = Dialog; +messageActionRequestedPeer#31518e9b button_id:int peers:Vector<Peer> = MessageAction; +messageActionSetChatWallPaper#5060a3f4 flags:# same:flags.0?true for_both:flags.1?true wallpaper:WallPaper = MessageAction; +messageActionGiftCode#678c2e09 flags:# via_giveaway:flags.0?true unclaimed:flags.2?true boost_peer:flags.1?Peer months:int slug:string currency:flags.2?string amount:flags.2?long crypto_currency:flags.3?string crypto_amount:flags.3?long = MessageAction; +messageActionGiveawayLaunch#a80f51e4 flags:# stars:flags.0?long = MessageAction; +messageActionGiveawayResults#87e2f155 flags:# stars:flags.0?true winners_count:int unclaimed_count:int = MessageAction; +messageActionBoostApply#cc02aa6d boosts:int = MessageAction; +messageActionRequestedPeerSentMe#93b31848 button_id:int peers:Vector<RequestedPeer> = MessageAction; +messageActionPaymentRefunded#41b3e202 flags:# peer:Peer currency:string total_amount:long payload:flags.0?bytes charge:PaymentCharge = MessageAction; +messageActionGiftStars#45d5b021 flags:# currency:string amount:long stars:long crypto_currency:flags.0?string crypto_amount:flags.0?long transaction_id:flags.1?string = MessageAction; +messageActionPrizeStars#b00c47a2 flags:# unclaimed:flags.0?true stars:long transaction_id:string boost_peer:Peer giveaway_msg_id:int = MessageAction; + +dialog#d58a08c6 flags:# pinned:flags.2?true unread_mark:flags.3?true view_forum_as_messages:flags.6?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int ttl_period:flags.5?int = Dialog; dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog; photoEmpty#2331b22d id:long = Photo; @@ -220,11 +238,11 @@ inputNotifyChats#4a95e84e = InputNotifyPeer; inputNotifyBroadcasts#b1db7c7e = InputNotifyPeer; inputNotifyForumTopic#5c467992 peer:InputPeer top_msg_id:int = InputNotifyPeer; -inputPeerNotifySettings#df1f002b flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?NotificationSound = InputPeerNotifySettings; +inputPeerNotifySettings#cacb6ae2 flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?NotificationSound stories_muted:flags.6?Bool stories_hide_sender:flags.7?Bool stories_sound:flags.8?NotificationSound = InputPeerNotifySettings; -peerNotifySettings#a83b0426 flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int ios_sound:flags.3?NotificationSound android_sound:flags.4?NotificationSound other_sound:flags.5?NotificationSound = PeerNotifySettings; +peerNotifySettings#99622c0c flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int ios_sound:flags.3?NotificationSound android_sound:flags.4?NotificationSound other_sound:flags.5?NotificationSound stories_muted:flags.6?Bool stories_hide_sender:flags.7?Bool stories_ios_sound:flags.8?NotificationSound stories_android_sound:flags.9?NotificationSound stories_other_sound:flags.10?NotificationSound = PeerNotifySettings; -peerSettings#a518110d flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true autoarchived:flags.7?true invite_members:flags.8?true request_chat_broadcast:flags.10?true geo_distance:flags.6?int request_chat_title:flags.9?string request_chat_date:flags.9?int = PeerSettings; +peerSettings#acd66c5e flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true autoarchived:flags.7?true invite_members:flags.8?true request_chat_broadcast:flags.10?true business_bot_paused:flags.11?true business_bot_can_reply:flags.12?true geo_distance:flags.6?int request_chat_title:flags.9?string request_chat_date:flags.9?int business_bot_id:flags.13?long business_bot_manage_url:flags.13?string = PeerSettings; wallPaper#a437c3ed id:long flags:# creator:flags.0?true default:flags.1?true pattern:flags.3?true dark:flags.4?true access_hash:long slug:string document:Document settings:flags.2?WallPaperSettings = WallPaper; wallPaperNoFile#e0804116 id:long flags:# default:flags.1?true dark:flags.4?true settings:flags.2?WallPaperSettings = WallPaper; @@ -240,7 +258,7 @@ inputReportReasonFake#f5ddd6e7 = ReportReason; inputReportReasonIllegalDrugs#a8eb2be = ReportReason; inputReportReasonPersonalDetails#9ec7863d = ReportReason; -userFull#93eadb53 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights premium_gifts:flags.19?Vector<PremiumGiftOption> wallpaper:flags.24?WallPaper = UserFull; +userFull#cc997720 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights premium_gifts:flags.19?Vector<PremiumGiftOption> wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int = UserFull; contact#145ade0b user_id:long mutual:Bool = Contact; @@ -298,6 +316,7 @@ updateChatUserTyping#83487af0 chat_id:long from_id:Peer action:SendMessageAction updateChatParticipants#7761198 participants:ChatParticipants = Update; updateUserStatus#e5bdf8de user_id:long status:UserStatus = Update; updateUserName#a7848924 user_id:long first_name:string last_name:string usernames:Vector<Username> = Update; +updateNewAuthorization#8951abef flags:# unconfirmed:flags.0?true hash:long date:flags.0?int device:flags.0?string location:flags.0?string = Update; updateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update; updateEncryptedChatTyping#1710f156 chat_id:int = Update; updateEncryption#b4a2e88d chat:EncryptedChat date:int = Update; @@ -306,13 +325,13 @@ updateChatParticipantAdd#3dda5451 chat_id:long user_id:long inviter_id:long date updateChatParticipantDelete#e32f3d77 chat_id:long user_id:long version:int = Update; updateDcOptions#8e5e9873 dc_options:Vector<DcOption> = Update; updateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update; -updateServiceNotification#ebe46819 flags:# popup:flags.0?true inbox_date:flags.1?int type:string message:string media:MessageMedia entities:Vector<MessageEntity> = Update; +updateServiceNotification#ebe46819 flags:# popup:flags.0?true invert_media:flags.2?true inbox_date:flags.1?int type:string message:string media:MessageMedia entities:Vector<MessageEntity> = Update; updatePrivacy#ee3b272a key:PrivacyKey rules:Vector<PrivacyRule> = Update; updateUserPhone#5492a13 user_id:long phone:string = Update; updateReadHistoryInbox#9c974fdf flags:# folder_id:flags.0?int peer:Peer max_id:int still_unread_count:int pts:int pts_count:int = Update; updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update; updateWebPage#7f891213 webpage:WebPage pts:int pts_count:int = Update; -updateReadMessagesContents#68c13933 messages:Vector<int> pts:int pts_count:int = Update; +updateReadMessagesContents#f8227181 flags:# messages:Vector<int> pts:int pts_count:int date:flags.0?int = Update; updateChannelTooLong#108d941f flags:# channel_id:long pts:flags.0?int = Update; updateChannel#635b4c09 channel_id:long = Update; updateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update; @@ -361,7 +380,7 @@ updateDeleteScheduledMessages#90866cee peer:Peer messages:Vector<int> = Update; updateTheme#8216fba3 theme:Theme = Update; updateGeoLiveViewed#871fb939 peer:Peer msg_id:int = Update; updateLoginToken#564fe691 = Update; -updateMessagePollVote#106395c9 poll_id:long user_id:long options:Vector<bytes> qts:int = Update; +updateMessagePollVote#24f40e77 poll_id:long peer:Peer options:Vector<bytes> qts:int = Update; updateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update; updateDialogFilterOrder#a5d72105 order:Vector<int> = Update; updateDialogFilters#3504914f = Update; @@ -369,7 +388,7 @@ updatePhoneCallSignalingData#2661bf09 phone_call_id:long data:bytes = Update; updateChannelMessageForwards#d29a27f4 channel_id:long id:int forwards:int = Update; updateReadChannelDiscussionInbox#d6b19546 flags:# channel_id:long top_msg_id:int read_max_id:int broadcast_id:flags.0?long broadcast_post:flags.0?int = Update; updateReadChannelDiscussionOutbox#695c9e7c channel_id:long top_msg_id:int read_max_id:int = Update; -updatePeerBlocked#246a4b22 peer_id:Peer blocked:Bool = Update; +updatePeerBlocked#ebe07752 flags:# blocked:flags.0?true blocked_my_stories_from:flags.1?true peer_id:Peer = Update; updateChannelUserTyping#8c88c923 flags:# channel_id:long top_msg_id:flags.0?int from_id:Peer action:SendMessageAction = Update; updatePinnedMessages#ed85eab5 flags:# pinned:flags.0?true peer:Peer messages:Vector<int> pts:int pts_count:int = Update; updatePinnedChannelMessages#5bb98608 flags:# pinned:flags.0?true channel_id:long messages:Vector<int> pts:int pts_count:int = Update; @@ -395,12 +414,41 @@ updateUserEmojiStatus#28373599 user_id:long emoji_status:EmojiStatus = Update; updateRecentEmojiStatuses#30f443db = Update; updateRecentReactions#6f7863f4 = Update; updateMoveStickerSetToTop#86fccf85 flags:# masks:flags.0?true emojis:flags.1?true stickerset:long = Update; -updateMessageExtendedMedia#5a73a98c peer:Peer msg_id:int extended_media:MessageExtendedMedia = Update; +updateMessageExtendedMedia#d5a41724 peer:Peer msg_id:int extended_media:Vector<MessageExtendedMedia> = Update; updateChannelPinnedTopic#192efbe3 flags:# pinned:flags.0?true channel_id:long topic_id:int = Update; updateChannelPinnedTopics#fe198602 flags:# channel_id:long order:flags.0?Vector<int> = Update; updateUser#20529438 user_id:long = Update; updateAutoSaveSettings#ec05b097 = Update; -updateGroupInvitePrivacyForbidden#ccf08ad6 user_id:long = Update; +updateStory#75b3b798 peer:Peer story:StoryItem = Update; +updateReadStories#f74e932b peer:Peer max_id:int = Update; +updateStoryID#1bf335b9 id:int random_id:long = Update; +updateStoriesStealthMode#2c084dc1 stealth_mode:StoriesStealthMode = Update; +updateSentStoryReaction#7d627683 peer:Peer story_id:int reaction:Reaction = Update; +updateBotChatBoost#904dd49c peer:Peer boost:Boost qts:int = Update; +updateChannelViewForumAsMessages#7b68920 channel_id:long enabled:Bool = Update; +updatePeerWallpaper#ae3f101d flags:# wallpaper_overridden:flags.1?true peer:Peer wallpaper:flags.0?WallPaper = Update; +updateBotMessageReaction#ac21d3ce peer:Peer msg_id:int date:int actor:Peer old_reactions:Vector<Reaction> new_reactions:Vector<Reaction> qts:int = Update; +updateBotMessageReactions#9cb7759 peer:Peer msg_id:int date:int reactions:Vector<ReactionCount> qts:int = Update; +updateSavedDialogPinned#aeaf9e74 flags:# pinned:flags.0?true peer:DialogPeer = Update; +updatePinnedSavedDialogs#686c85a6 flags:# order:flags.0?Vector<DialogPeer> = Update; +updateSavedReactionTags#39c67432 = Update; +updateSmsJob#f16269d4 job_id:string = Update; +updateQuickReplies#f9470ab2 quick_replies:Vector<QuickReply> = Update; +updateNewQuickReply#f53da717 quick_reply:QuickReply = Update; +updateDeleteQuickReply#53e6f1ec shortcut_id:int = Update; +updateQuickReplyMessage#3e050d0f message:Message = Update; +updateDeleteQuickReplyMessages#566fe7cd shortcut_id:int messages:Vector<int> = Update; +updateBotBusinessConnect#8ae5c97a connection:BotBusinessConnection qts:int = Update; +updateBotNewBusinessMessage#9ddb347c flags:# connection_id:string message:Message reply_to_message:flags.0?Message qts:int = Update; +updateBotEditBusinessMessage#7df587c flags:# connection_id:string message:Message reply_to_message:flags.0?Message qts:int = Update; +updateBotDeleteBusinessMessage#a02a982e connection_id:string peer:Peer messages:Vector<int> qts:int = Update; +updateNewStoryReaction#1824e40b story_id:int peer:Peer reaction:Reaction = Update; +updateBroadcastRevenueTransactions#dfd961f5 peer:Peer balances:BroadcastRevenueBalances = Update; +updateStarsBalance#fb85198 balance:long = Update; +updateBusinessBotCallbackQuery#1ea2fda7 flags:# query_id:long user_id:long connection_id:string message:Message reply_to_message:flags.2?Message chat_instance:long data:flags.0?bytes = Update; +updateStarsRevenueStatus#a584b019 peer:Peer status:StarsRevenueStatus = Update; +updateBotPurchasedPaidMedia#283bd312 user_id:long payload:string qts:int = Update; +updatePaidReactionPrivacy#51ca7aec private:Bool = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -505,6 +553,8 @@ inputPrivacyKeyProfilePhoto#5719bacc = InputPrivacyKey; inputPrivacyKeyPhoneNumber#352dafa = InputPrivacyKey; inputPrivacyKeyAddedByPhone#d1219bdd = InputPrivacyKey; inputPrivacyKeyVoiceMessages#aee69d68 = InputPrivacyKey; +inputPrivacyKeyAbout#3823cc40 = InputPrivacyKey; +inputPrivacyKeyBirthday#d65a11cc = InputPrivacyKey; privacyKeyStatusTimestamp#bc2eab30 = PrivacyKey; privacyKeyChatInvite#500e6dfa = PrivacyKey; @@ -515,6 +565,8 @@ privacyKeyProfilePhoto#96151fed = PrivacyKey; privacyKeyPhoneNumber#d19ae46d = PrivacyKey; privacyKeyAddedByPhone#42ffd42b = PrivacyKey; privacyKeyVoiceMessages#697f414 = PrivacyKey; +privacyKeyAbout#a486b761 = PrivacyKey; +privacyKeyBirthday#2000a518 = PrivacyKey; inputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule; inputPrivacyValueAllowAll#184b35ce = InputPrivacyRule; @@ -524,6 +576,8 @@ inputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule; inputPrivacyValueDisallowUsers#90110467 users:Vector<InputUser> = InputPrivacyRule; inputPrivacyValueAllowChatParticipants#840649cf chats:Vector<long> = InputPrivacyRule; inputPrivacyValueDisallowChatParticipants#e94f0f86 chats:Vector<long> = InputPrivacyRule; +inputPrivacyValueAllowCloseFriends#2f453e49 = InputPrivacyRule; +inputPrivacyValueAllowPremium#77cdc9f1 = InputPrivacyRule; privacyValueAllowContacts#fffe1bac = PrivacyRule; privacyValueAllowAll#65427b82 = PrivacyRule; @@ -533,6 +587,8 @@ privacyValueDisallowAll#8b73e763 = PrivacyRule; privacyValueDisallowUsers#e4621141 users:Vector<long> = PrivacyRule; privacyValueAllowChatParticipants#6b134e8e chats:Vector<long> = PrivacyRule; privacyValueDisallowChatParticipants#41c87565 chats:Vector<long> = PrivacyRule; +privacyValueAllowCloseFriends#f7e8d89b = PrivacyRule; +privacyValueAllowPremium#ece9814b = PrivacyRule; account.privacyRules#50a04e45 rules:Vector<PrivacyRule> chats:Vector<Chat> users:Vector<User> = account.PrivacyRules; @@ -541,7 +597,7 @@ accountDaysTTL#b8d0afdf days:int = AccountDaysTTL; documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute; documentAttributeAnimated#11b58939 = DocumentAttribute; documentAttributeSticker#6319d612 flags:# mask:flags.1?true alt:string stickerset:InputStickerSet mask_coords:flags.0?MaskCoords = DocumentAttribute; -documentAttributeVideo#ef02ce6 flags:# round_message:flags.0?true supports_streaming:flags.1?true duration:int w:int h:int = DocumentAttribute; +documentAttributeVideo#17399fad flags:# round_message:flags.0?true supports_streaming:flags.1?true nosound:flags.3?true duration:double w:int h:int preload_prefix_size:flags.2?int video_start_ts:flags.4?double = DocumentAttribute; documentAttributeAudio#9852f9c6 flags:# voice:flags.10?true duration:int title:flags.0?string performer:flags.1?string waveform:flags.2?bytes = DocumentAttribute; documentAttributeFilename#15590068 file_name:string = DocumentAttribute; documentAttributeHasStickers#9801d2f7 = DocumentAttribute; @@ -557,12 +613,12 @@ messages.allStickers#cdbbcebb hash:long sets:Vector<StickerSet> = messages.AllSt messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages; -webPageEmpty#eb1477e8 id:long = WebPage; -webPagePending#c586da1c id:long date:int = WebPage; -webPage#e89c45b2 flags:# id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document cached_page:flags.10?Page attributes:flags.12?Vector<WebPageAttribute> = WebPage; +webPageEmpty#211a1788 flags:# id:long url:flags.0?string = WebPage; +webPagePending#b0d13e47 flags:# id:long url:flags.0?string date:int = WebPage; +webPage#e89c45b2 flags:# has_large_media:flags.13?true id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document cached_page:flags.10?Page attributes:flags.12?Vector<WebPageAttribute> = WebPage; webPageNotModified#7311ca11 flags:# cached_page_views:flags.0?int = WebPage; -authorization#ad01d61d flags:# current:flags.0?true official_app:flags.1?true password_pending:flags.2?true encrypted_requests_disabled:flags.3?true call_requests_disabled:flags.4?true hash:long device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization; +authorization#ad01d61d flags:# current:flags.0?true official_app:flags.1?true password_pending:flags.2?true encrypted_requests_disabled:flags.3?true call_requests_disabled:flags.4?true unconfirmed:flags.5?true hash:long device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization; account.authorizations#4bff8ea0 authorization_ttl_days:int authorizations:Vector<Authorization> = account.Authorizations; @@ -576,11 +632,11 @@ auth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery; receivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage; -chatInviteExported#ab4a819 flags:# revoked:flags.0?true permanent:flags.5?true request_needed:flags.6?true link:string admin_id:long date:int start_date:flags.4?int expire_date:flags.1?int usage_limit:flags.2?int usage:flags.3?int requested:flags.7?int title:flags.8?string = ExportedChatInvite; +chatInviteExported#a22cbd96 flags:# revoked:flags.0?true permanent:flags.5?true request_needed:flags.6?true link:string admin_id:long date:int start_date:flags.4?int expire_date:flags.1?int usage_limit:flags.2?int usage:flags.3?int requested:flags.7?int subscription_expired:flags.10?int title:flags.8?string subscription_pricing:flags.9?StarsSubscriptionPricing = ExportedChatInvite; chatInvitePublicJoinRequests#ed107ab7 = ExportedChatInvite; chatInviteAlready#5a686d7c chat:Chat = ChatInvite; -chatInvite#300c44c1 flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true request_needed:flags.6?true title:string about:flags.5?string photo:Photo participants_count:int participants:flags.4?Vector<User> = ChatInvite; +chatInvite#fe65389d flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true request_needed:flags.6?true verified:flags.7?true scam:flags.8?true fake:flags.9?true can_refulfill_subscription:flags.11?true title:string about:flags.5?string photo:Photo participants_count:int participants:flags.4?Vector<User> color:int subscription_pricing:flags.10?StarsSubscriptionPricing subscription_form_id:flags.12?long = ChatInvite; chatInvitePeek#61695cb0 chat:Chat expires:int = ChatInvite; inputStickerSetEmpty#ffb62b95 = InputStickerSet; @@ -593,15 +649,16 @@ inputStickerSetPremiumGifts#c88b3b02 = InputStickerSet; inputStickerSetEmojiGenericAnimations#4c4d4ce = InputStickerSet; inputStickerSetEmojiDefaultStatuses#29d0f5ee = InputStickerSet; inputStickerSetEmojiDefaultTopicIcons#44c1f8e9 = InputStickerSet; +inputStickerSetEmojiChannelDefaultStatuses#49748553 = InputStickerSet; -stickerSet#2dd14edc flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?true videos:flags.6?true emojis:flags.7?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector<PhotoSize> thumb_dc_id:flags.4?int thumb_version:flags.4?int thumb_document_id:flags.8?long count:int hash:int = StickerSet; +stickerSet#2dd14edc flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true emojis:flags.7?true text_color:flags.9?true channel_emoji_status:flags.10?true creator:flags.11?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector<PhotoSize> thumb_dc_id:flags.4?int thumb_version:flags.4?int thumb_document_id:flags.8?long count:int hash:int = StickerSet; messages.stickerSet#6e153f16 set:StickerSet packs:Vector<StickerPack> keywords:Vector<StickerKeyword> documents:Vector<Document> = messages.StickerSet; messages.stickerSetNotModified#d3f924eb = messages.StickerSet; botCommand#c27ac8c7 command:string description:string = BotCommand; -botInfo#8f300b57 flags:# user_id:flags.0?long description:flags.1?string description_photo:flags.4?Photo description_document:flags.5?Document commands:flags.2?Vector<BotCommand> menu_button:flags.3?BotMenuButton = BotInfo; +botInfo#82437e74 flags:# has_preview_medias:flags.6?true user_id:flags.0?long description:flags.1?string description_photo:flags.4?Photo description_document:flags.5?Document commands:flags.2?Vector<BotCommand> menu_button:flags.3?BotMenuButton privacy_policy_url:flags.7?string = BotInfo; keyboardButton#a2fa4880 text:string = KeyboardButton; keyboardButtonUrl#258aff05 text:string url:string = KeyboardButton; @@ -618,7 +675,8 @@ inputKeyboardButtonUserProfile#e988037b text:string user_id:InputUser = Keyboard keyboardButtonUserProfile#308660c1 text:string user_id:long = KeyboardButton; keyboardButtonWebView#13767230 text:string url:string = KeyboardButton; keyboardButtonSimpleWebView#a0c0505c text:string url:string = KeyboardButton; -keyboardButtonRequestPeer#d0b468c text:string button_id:int peer_type:RequestPeerType = KeyboardButton; +keyboardButtonRequestPeer#53d7bfd8 text:string button_id:int peer_type:RequestPeerType max_quantity:int = KeyboardButton; +inputKeyboardButtonRequestPeer#c9662d05 flags:# name_requested:flags.0?true username_requested:flags.1?true photo_requested:flags.2?true text:string button_id:int peer_type:RequestPeerType max_quantity:int = KeyboardButton; keyboardButtonRow#77608b83 buttons:Vector<KeyboardButton> = KeyboardButtonRow; @@ -644,10 +702,10 @@ messageEntityPhone#9b69e34b offset:int length:int = MessageEntity; messageEntityCashtag#4c4e743f offset:int length:int = MessageEntity; messageEntityUnderline#9c4e7e8b offset:int length:int = MessageEntity; messageEntityStrike#bf0693d4 offset:int length:int = MessageEntity; -messageEntityBlockquote#20df5d0 offset:int length:int = MessageEntity; messageEntityBankCard#761e6af4 offset:int length:int = MessageEntity; messageEntitySpoiler#32ca960f offset:int length:int = MessageEntity; messageEntityCustomEmoji#c8cf05f8 offset:int length:int document_id:long = MessageEntity; +messageEntityBlockquote#f1ccaaac flags:# collapsed:flags.0?true offset:int length:int = MessageEntity; inputChannelEmpty#ee8c1e86 = InputChannel; inputChannel#f35aec28 channel_id:long access_hash:long = InputChannel; @@ -664,8 +722,8 @@ updates.channelDifference#2064674e flags:# final:flags.0?true pts:int timeout:fl channelMessagesFilterEmpty#94d42ee7 = ChannelMessagesFilter; channelMessagesFilter#cd77d957 flags:# exclude_new_messages:flags.1?true ranges:Vector<MessageRange> = ChannelMessagesFilter; -channelParticipant#c00c07c0 user_id:long date:int = ChannelParticipant; -channelParticipantSelf#35a8bfa7 flags:# via_request:flags.0?true user_id:long inviter_id:long date:int = ChannelParticipant; +channelParticipant#cb397619 flags:# user_id:long date:int subscription_until_date:flags.0?int = ChannelParticipant; +channelParticipantSelf#4f607bef flags:# via_request:flags.0?true user_id:long inviter_id:long date:int subscription_until_date:flags.1?int = ChannelParticipant; channelParticipantCreator#2fe601d3 flags:# user_id:long admin_rights:ChatAdminRights rank:flags.0?string = ChannelParticipant; channelParticipantAdmin#34c3bb53 flags:# can_edit:flags.0?true self:flags.1?true user_id:long inviter_id:flags.1?long promoted_by:long date:int admin_rights:ChatAdminRights rank:flags.2?string = ChannelParticipant; channelParticipantBanned#6df8014e flags:# left:flags.0?true peer:Peer kicked_by:long date:int banned_rights:ChatBannedRights = ChannelParticipant; @@ -690,25 +748,27 @@ help.termsOfService#780a0310 flags:# popup:flags.0?true id:DataJSON text:string messages.savedGifsNotModified#e8025ca2 = messages.SavedGifs; messages.savedGifs#84a02a0d hash:long gifs:Vector<Document> = messages.SavedGifs; -inputBotInlineMessageMediaAuto#3380c786 flags:# message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; -inputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; +inputBotInlineMessageMediaAuto#3380c786 flags:# invert_media:flags.3?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; +inputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true invert_media:flags.3?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; inputBotInlineMessageMediaGeo#96929a85 flags:# geo_point:InputGeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; inputBotInlineMessageMediaVenue#417bbf11 flags:# geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; inputBotInlineMessageMediaContact#a6edbffd flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; inputBotInlineMessageGame#4b425864 flags:# reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; inputBotInlineMessageMediaInvoice#d7e78225 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; +inputBotInlineMessageMediaWebPage#bddcc510 flags:# invert_media:flags.3?true force_large_media:flags.4?true force_small_media:flags.5?true optional:flags.6?true message:string entities:flags.1?Vector<MessageEntity> url:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; inputBotInlineResult#88bf9319 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?InputWebDocument content:flags.5?InputWebDocument send_message:InputBotInlineMessage = InputBotInlineResult; inputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult; inputBotInlineResultDocument#fff8fdc4 flags:# id:string type:string title:flags.1?string description:flags.2?string document:InputDocument send_message:InputBotInlineMessage = InputBotInlineResult; inputBotInlineResultGame#4fa417f2 id:string short_name:string send_message:InputBotInlineMessage = InputBotInlineResult; -botInlineMessageMediaAuto#764cf810 flags:# message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage; -botInlineMessageText#8c7f65e2 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage; +botInlineMessageMediaAuto#764cf810 flags:# invert_media:flags.3?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage; +botInlineMessageText#8c7f65e2 flags:# no_webpage:flags.0?true invert_media:flags.3?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage; botInlineMessageMediaGeo#51846fd flags:# geo:GeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = BotInlineMessage; botInlineMessageMediaVenue#8a86659c flags:# geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage; botInlineMessageMediaContact#18d1cdc2 flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage; botInlineMessageMediaInvoice#354a9b09 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument currency:string total_amount:long reply_markup:flags.2?ReplyMarkup = BotInlineMessage; +botInlineMessageMediaWebPage#809ad9a6 flags:# invert_media:flags.3?true force_large_media:flags.4?true force_small_media:flags.5?true manual:flags.7?true safe:flags.8?true message:string entities:flags.1?Vector<MessageEntity> url:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage; botInlineResult#11965f3a flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?WebDocument content:flags.5?WebDocument send_message:BotInlineMessage = BotInlineResult; botInlineMediaResult#17db940b flags:# id:string type:string photo:flags.0?Photo document:flags.1?Document title:flags.2?string description:flags.3?string send_message:BotInlineMessage = BotInlineResult; @@ -717,7 +777,7 @@ messages.botResults#e021f2f6 flags:# gallery:flags.0?true query_id:long next_off exportedMessageLink#5dab1af4 link:string html:string = ExportedMessageLink; -messageFwdHeader#5f777dce flags:# imported:flags.7?true from_id:flags.0?Peer from_name:flags.5?string date:int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int psa_type:flags.6?string = MessageFwdHeader; +messageFwdHeader#4e4df4bb flags:# imported:flags.7?true saved_out:flags.11?true from_id:flags.0?Peer from_name:flags.5?string date:int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int saved_from_id:flags.8?Peer saved_from_name:flags.9?string saved_date:flags.10?int psa_type:flags.6?string = MessageFwdHeader; auth.codeTypeSms#72a3158c = auth.CodeType; auth.codeTypeCall#741cd3e3 = auth.CodeType; @@ -733,7 +793,9 @@ auth.sentCodeTypeMissedCall#82006484 prefix:string length:int = auth.SentCodeTyp auth.sentCodeTypeEmailCode#f450f59b flags:# apple_signin_allowed:flags.0?true google_signin_allowed:flags.1?true email_pattern:string length:int reset_available_period:flags.3?int reset_pending_date:flags.4?int = auth.SentCodeType; auth.sentCodeTypeSetUpEmailRequired#a5491dea flags:# apple_signin_allowed:flags.0?true google_signin_allowed:flags.1?true = auth.SentCodeType; auth.sentCodeTypeFragmentSms#d9565c39 url:string length:int = auth.SentCodeType; -auth.sentCodeTypeFirebaseSms#e57b1432 flags:# nonce:flags.0?bytes receipt:flags.1?string push_timeout:flags.1?int length:int = auth.SentCodeType; +auth.sentCodeTypeFirebaseSms#9fd736 flags:# nonce:flags.0?bytes play_integrity_project_id:flags.2?long play_integrity_nonce:flags.2?bytes receipt:flags.1?string push_timeout:flags.1?int length:int = auth.SentCodeType; +auth.sentCodeTypeSmsWord#a416ac81 flags:# beginning:flags.0?string = auth.SentCodeType; +auth.sentCodeTypeSmsPhrase#b37794af flags:# beginning:flags.0?string = auth.SentCodeType; messages.botCallbackAnswer#36585ea4 flags:# alert:flags.1?true has_url:flags.3?true native_ui:flags.4?true message:flags.0?string url:flags.2?string cache_time:int = messages.BotCallbackAnswer; @@ -756,6 +818,7 @@ topPeerCategoryChannels#161d9628 = TopPeerCategory; topPeerCategoryPhoneCalls#1e76a78c = TopPeerCategory; topPeerCategoryForwardUsers#a8406ca9 = TopPeerCategory; topPeerCategoryForwardChats#fbeec0f0 = TopPeerCategory; +topPeerCategoryBotsApp#fd9e7bec = TopPeerCategory; topPeerCategoryPeers#fb834291 category:TopPeerCategory count:int peers:Vector<TopPeer> = TopPeerCategoryPeers; @@ -764,7 +827,7 @@ contacts.topPeers#70b772a8 categories:Vector<TopPeerCategoryPeers> chats:Vector< contacts.topPeersDisabled#b52c939d = contacts.TopPeers; draftMessageEmpty#1b0c841a flags:# date:flags.0?int = DraftMessage; -draftMessage#fd8e711f flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int message:string entities:flags.3?Vector<MessageEntity> date:int = DraftMessage; +draftMessage#2d65321f flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia date:int effect:flags.7?long = DraftMessage; messages.featuredStickersNotModified#c6dc0c66 count:int = messages.FeaturedStickers; messages.featuredStickers#be382906 flags:# premium:flags.0?true hash:long count:int sets:Vector<StickerSetCovered> unread:Vector<long> = messages.FeaturedStickers; @@ -852,7 +915,7 @@ dataJSON#7d748d04 data:string = DataJSON; labeledPrice#cb296bf8 label:string amount:long = LabeledPrice; -invoice#3e85a91b flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true recurring:flags.9?true currency:string prices:Vector<LabeledPrice> max_tip_amount:flags.8?long suggested_tip_amounts:flags.8?Vector<long> recurring_terms_url:flags.9?string = Invoice; +invoice#5db95a15 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true recurring:flags.9?true currency:string prices:Vector<LabeledPrice> max_tip_amount:flags.8?long suggested_tip_amounts:flags.8?Vector<long> terms_url:flags.10?string = Invoice; paymentCharge#ea02c27e id:string provider_charge_id:string = PaymentCharge; @@ -874,6 +937,7 @@ inputWebFileAudioAlbumThumbLocation#f46fe924 flags:# small:flags.2?true document upload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile; payments.paymentForm#a0058751 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:long title:string description:string photo:flags.5?WebDocument invoice:Invoice provider_id:long url:string native_provider:flags.4?string native_params:flags.4?DataJSON additional_methods:flags.6?Vector<PaymentFormMethod> saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?Vector<PaymentSavedCredentials> users:Vector<User> = payments.PaymentForm; +payments.paymentFormStars#7bf6b15c flags:# form_id:long bot_id:long title:string description:string photo:flags.5?WebDocument invoice:Invoice users:Vector<User> = payments.PaymentForm; payments.validatedRequestedInfo#d1451883 flags:# id:flags.0?string shipping_options:flags.1?Vector<ShippingOption> = payments.ValidatedRequestedInfo; @@ -881,6 +945,7 @@ payments.paymentResult#4e5f810d updates:Updates = payments.PaymentResult; payments.paymentVerificationNeeded#d8411139 url:string = payments.PaymentResult; payments.paymentReceipt#70c4fe03 flags:# date:int bot_id:long provider_id:long title:string description:string photo:flags.2?WebDocument invoice:Invoice info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption tip_amount:flags.3?long currency:string total_amount:long credentials_title:string users:Vector<User> = payments.PaymentReceipt; +payments.paymentReceiptStars#dabbf83a flags:# date:int bot_id:long title:string description:string photo:flags.2?WebDocument invoice:Invoice currency:string total_amount:long transaction_id:string users:Vector<User> = payments.PaymentReceipt; payments.savedInfo#fb8fe43c flags:# has_saved_credentials:flags.1?true saved_info:flags.0?PaymentRequestedInfo = payments.SavedInfo; @@ -901,7 +966,7 @@ phoneCallEmpty#5366c915 id:long = PhoneCall; phoneCallWaiting#c5226f17 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall; phoneCallRequested#14b0ed0c flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall; phoneCallAccepted#3660c311 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_b:bytes protocol:PhoneCallProtocol = PhoneCall; -phoneCall#967f7c67 flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector<PhoneConnection> start_date:int = PhoneCall; +phoneCall#30535af5 flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector<PhoneConnection> start_date:int custom_parameters:flags.7?DataJSON = PhoneCall; phoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.6?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall; phoneConnection#9cc123c7 flags:# tcp:flags.0?true id:long ip:string ipv6:string port:int peer_tag:bytes = PhoneConnection; @@ -969,12 +1034,19 @@ channelAdminLogEventActionEditTopic#f06fe208 prev_topic:ForumTopic new_topic:For channelAdminLogEventActionDeleteTopic#ae168909 topic:ForumTopic = ChannelAdminLogEventAction; channelAdminLogEventActionPinTopic#5d8d353b flags:# prev_topic:flags.0?ForumTopic new_topic:flags.1?ForumTopic = ChannelAdminLogEventAction; channelAdminLogEventActionToggleAntiSpam#64f36dfc new_value:Bool = ChannelAdminLogEventAction; +channelAdminLogEventActionChangePeerColor#5796e780 prev_value:PeerColor new_value:PeerColor = ChannelAdminLogEventAction; +channelAdminLogEventActionChangeProfilePeerColor#5e477b25 prev_value:PeerColor new_value:PeerColor = ChannelAdminLogEventAction; +channelAdminLogEventActionChangeWallpaper#31bb5d52 prev_value:WallPaper new_value:WallPaper = ChannelAdminLogEventAction; +channelAdminLogEventActionChangeEmojiStatus#3ea9feb1 prev_value:EmojiStatus new_value:EmojiStatus = ChannelAdminLogEventAction; +channelAdminLogEventActionChangeEmojiStickerSet#46d840ab prev_stickerset:InputStickerSet new_stickerset:InputStickerSet = ChannelAdminLogEventAction; +channelAdminLogEventActionToggleSignatureProfiles#60a79c79 new_value:Bool = ChannelAdminLogEventAction; +channelAdminLogEventActionParticipantSubExtend#64642db3 prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction; channelAdminLogEvent#1fad68cd id:long date:int user_id:long action:ChannelAdminLogEventAction = ChannelAdminLogEvent; channels.adminLogResults#ed8af74d events:Vector<ChannelAdminLogEvent> chats:Vector<Chat> users:Vector<User> = channels.AdminLogResults; -channelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true invites:flags.15?true send:flags.16?true forums:flags.17?true = ChannelAdminLogEventsFilter; +channelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true invites:flags.15?true send:flags.16?true forums:flags.17?true sub_extend:flags.18?true = ChannelAdminLogEventsFilter; popularContact#5ce14175 client_id:long importers:int = PopularContact; @@ -1120,19 +1192,19 @@ help.supportName#8c05f1c9 name:string = help.SupportName; help.userInfoEmpty#f3ae2eed = help.UserInfo; help.userInfo#1eb3758 message:string entities:Vector<MessageEntity> author:string date:int = help.UserInfo; -pollAnswer#6ca9c2e9 text:string option:bytes = PollAnswer; +pollAnswer#ff16e2ca text:TextWithEntities option:bytes = PollAnswer; -poll#86e18161 id:long flags:# closed:flags.0?true public_voters:flags.1?true multiple_choice:flags.2?true quiz:flags.3?true question:string answers:Vector<PollAnswer> close_period:flags.4?int close_date:flags.5?int = Poll; +poll#58747131 id:long flags:# closed:flags.0?true public_voters:flags.1?true multiple_choice:flags.2?true quiz:flags.3?true question:TextWithEntities answers:Vector<PollAnswer> close_period:flags.4?int close_date:flags.5?int = Poll; pollAnswerVoters#3b6ddad2 flags:# chosen:flags.0?true correct:flags.1?true option:bytes voters:int = PollAnswerVoters; -pollResults#dcb82ea3 flags:# min:flags.0?true results:flags.1?Vector<PollAnswerVoters> total_voters:flags.2?int recent_voters:flags.3?Vector<long> solution:flags.4?string solution_entities:flags.4?Vector<MessageEntity> = PollResults; +pollResults#7adf2420 flags:# min:flags.0?true results:flags.1?Vector<PollAnswerVoters> total_voters:flags.2?int recent_voters:flags.3?Vector<Peer> solution:flags.4?string solution_entities:flags.4?Vector<MessageEntity> = PollResults; chatOnlines#f041e250 onlines:int = ChatOnlines; statsURL#47a971e0 url:string = StatsURL; -chatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true manage_topics:flags.13?true = ChatAdminRights; +chatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true manage_topics:flags.13?true post_stories:flags.14?true edit_stories:flags.15?true delete_stories:flags.16?true = ChatAdminRights; chatBannedRights#9f120418 flags:# view_messages:flags.0?true send_messages:flags.1?true send_media:flags.2?true send_stickers:flags.3?true send_gifs:flags.4?true send_games:flags.5?true send_inline:flags.6?true embed_links:flags.7?true send_polls:flags.8?true change_info:flags.10?true invite_users:flags.15?true pin_messages:flags.17?true manage_topics:flags.18?true send_photos:flags.19?true send_videos:flags.20?true send_roundvideos:flags.21?true send_audios:flags.22?true send_voices:flags.23?true send_docs:flags.24?true send_plain:flags.25?true until_date:int = ChatBannedRights; @@ -1143,11 +1215,11 @@ inputWallPaperNoFile#967a462e id:long = InputWallPaper; account.wallPapersNotModified#1c199183 = account.WallPapers; account.wallPapers#cdc3858c hash:long wallpapers:Vector<WallPaper> = account.WallPapers; -codeSettings#ad253d78 flags:# allow_flashcall:flags.0?true current_number:flags.1?true allow_app_hash:flags.4?true allow_missed_call:flags.5?true allow_firebase:flags.7?true logout_tokens:flags.6?Vector<bytes> token:flags.8?string app_sandbox:flags.8?Bool = CodeSettings; +codeSettings#ad253d78 flags:# allow_flashcall:flags.0?true current_number:flags.1?true allow_app_hash:flags.4?true allow_missed_call:flags.5?true allow_firebase:flags.7?true unknown_number:flags.9?true logout_tokens:flags.6?Vector<bytes> token:flags.8?string app_sandbox:flags.8?Bool = CodeSettings; -wallPaperSettings#1dc1bca4 flags:# blur:flags.1?true motion:flags.2?true background_color:flags.0?int second_background_color:flags.4?int third_background_color:flags.5?int fourth_background_color:flags.6?int intensity:flags.3?int rotation:flags.4?int = WallPaperSettings; +wallPaperSettings#372efcd0 flags:# blur:flags.1?true motion:flags.2?true background_color:flags.0?int second_background_color:flags.4?int third_background_color:flags.5?int fourth_background_color:flags.6?int intensity:flags.3?int rotation:flags.4?int emoticon:flags.7?string = WallPaperSettings; -autoDownloadSettings#8efab953 flags:# disabled:flags.0?true video_preload_large:flags.1?true audio_preload_next:flags.2?true phonecalls_less_data:flags.3?true photo_size_max:int video_size_max:long file_size_max:long video_upload_maxbitrate:int = AutoDownloadSettings; +autoDownloadSettings#baa57628 flags:# disabled:flags.0?true video_preload_large:flags.1?true audio_preload_next:flags.2?true phonecalls_less_data:flags.3?true stories_preload:flags.4?true photo_size_max:int video_size_max:long file_size_max:long video_upload_maxbitrate:int small_queue_active_operations_max:int large_queue_active_operations_max:int = AutoDownloadSettings; account.autoDownloadSettings#63cacf26 low:AutoDownloadSettings medium:AutoDownloadSettings high:AutoDownloadSettings = account.AutoDownloadSettings; @@ -1207,20 +1279,18 @@ inputThemeSettings#8fde504f flags:# message_colors_animated:flags.2?true base_th themeSettings#fa58b6d4 flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int outbox_accent_color:flags.3?int message_colors:flags.0?Vector<int> wallpaper:flags.1?WallPaper = ThemeSettings; webPageAttributeTheme#54b56617 flags:# documents:flags.0?Vector<Document> settings:flags.1?ThemeSettings = WebPageAttribute; +webPageAttributeStory#2e94c3e7 flags:# peer:Peer id:int story:flags.0?StoryItem = WebPageAttribute; +webPageAttributeStickerSet#50cc03d3 flags:# emojis:flags.0?true text_color:flags.1?true stickers:Vector<Document> = WebPageAttribute; -messageUserVote#34d247b4 user_id:long option:bytes date:int = MessageUserVote; -messageUserVoteInputOption#3ca5b0ec user_id:long date:int = MessageUserVote; -messageUserVoteMultiple#8a65e557 user_id:long options:Vector<bytes> date:int = MessageUserVote; - -messages.votesList#823f649 flags:# count:int votes:Vector<MessageUserVote> users:Vector<User> next_offset:flags.0?string = messages.VotesList; +messages.votesList#4899484e flags:# count:int votes:Vector<MessagePeerVote> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = messages.VotesList; bankCardOpenUrl#f568028a url:string name:string = BankCardOpenUrl; payments.bankCardData#3e24e573 title:string open_urls:Vector<BankCardOpenUrl> = payments.BankCardData; -dialogFilter#7438f7e8 flags:# contacts:flags.0?true non_contacts:flags.1?true groups:flags.2?true broadcasts:flags.3?true bots:flags.4?true exclude_muted:flags.11?true exclude_read:flags.12?true exclude_archived:flags.13?true id:int title:string emoticon:flags.25?string pinned_peers:Vector<InputPeer> include_peers:Vector<InputPeer> exclude_peers:Vector<InputPeer> = DialogFilter; +dialogFilter#5fb5523b flags:# contacts:flags.0?true non_contacts:flags.1?true groups:flags.2?true broadcasts:flags.3?true bots:flags.4?true exclude_muted:flags.11?true exclude_read:flags.12?true exclude_archived:flags.13?true id:int title:string emoticon:flags.25?string color:flags.27?int pinned_peers:Vector<InputPeer> include_peers:Vector<InputPeer> exclude_peers:Vector<InputPeer> = DialogFilter; dialogFilterDefault#363293ae = DialogFilter; -dialogFilterChatlist#d64a04a8 flags:# has_my_invites:flags.26?true id:int title:string emoticon:flags.25?string pinned_peers:Vector<InputPeer> include_peers:Vector<InputPeer> = DialogFilter; +dialogFilterChatlist#9fe28ea4 flags:# has_my_invites:flags.26?true id:int title:string emoticon:flags.25?string color:flags.27?int pinned_peers:Vector<InputPeer> include_peers:Vector<InputPeer> = DialogFilter; dialogFilterSuggested#77744d4a filter:DialogFilter description:string = DialogFilterSuggested; @@ -1234,9 +1304,7 @@ statsGraphAsync#4a27eb2d token:string = StatsGraph; statsGraphError#bedc9822 error:string = StatsGraph; statsGraph#8ea464b6 flags:# json:DataJSON zoom_token:flags.0?string = StatsGraph; -messageInteractionCounters#ad4fc9bd msg_id:int views:int forwards:int = MessageInteractionCounters; - -stats.broadcastStats#bdf78394 period:StatsDateRangeDays followers:StatsAbsValueAndPrev views_per_post:StatsAbsValueAndPrev shares_per_post:StatsAbsValueAndPrev enabled_notifications:StatsPercentValue growth_graph:StatsGraph followers_graph:StatsGraph mute_graph:StatsGraph top_hours_graph:StatsGraph interactions_graph:StatsGraph iv_interactions_graph:StatsGraph views_by_source_graph:StatsGraph new_followers_by_source_graph:StatsGraph languages_graph:StatsGraph recent_message_interactions:Vector<MessageInteractionCounters> = stats.BroadcastStats; +stats.broadcastStats#396ca5fc period:StatsDateRangeDays followers:StatsAbsValueAndPrev views_per_post:StatsAbsValueAndPrev shares_per_post:StatsAbsValueAndPrev reactions_per_post:StatsAbsValueAndPrev views_per_story:StatsAbsValueAndPrev shares_per_story:StatsAbsValueAndPrev reactions_per_story:StatsAbsValueAndPrev enabled_notifications:StatsPercentValue growth_graph:StatsGraph followers_graph:StatsGraph mute_graph:StatsGraph top_hours_graph:StatsGraph interactions_graph:StatsGraph iv_interactions_graph:StatsGraph views_by_source_graph:StatsGraph new_followers_by_source_graph:StatsGraph languages_graph:StatsGraph reactions_by_emotion_graph:StatsGraph story_interactions_graph:StatsGraph story_reactions_by_emotion_graph:StatsGraph recent_posts_interactions:Vector<PostInteractionCounters> = stats.BroadcastStats; help.promoDataEmpty#98f6ac75 expires:int = help.PromoData; help.promoData#8c39793f flags:# proxy:flags.0?true expires:int peer:Peer chats:Vector<Chat> users:Vector<User> psa_type:flags.1?string psa_message:flags.2?string = help.PromoData; @@ -1253,7 +1321,7 @@ statsGroupTopInviter#535f779d user_id:long invitations:int = StatsGroupTopInvite stats.megagroupStats#ef7ff916 period:StatsDateRangeDays members:StatsAbsValueAndPrev messages:StatsAbsValueAndPrev viewers:StatsAbsValueAndPrev posters:StatsAbsValueAndPrev growth_graph:StatsGraph members_graph:StatsGraph new_members_by_source_graph:StatsGraph languages_graph:StatsGraph messages_graph:StatsGraph actions_graph:StatsGraph top_hours_graph:StatsGraph weekdays_graph:StatsGraph top_posters:Vector<StatsGroupTopPoster> top_admins:Vector<StatsGroupTopAdmin> top_inviters:Vector<StatsGroupTopInviter> users:Vector<User> = stats.MegagroupStats; -globalPrivacySettings#bea2f424 flags:# archive_and_mute_new_noncontact_peers:flags.0?Bool = GlobalPrivacySettings; +globalPrivacySettings#734c4ccb flags:# archive_and_mute_new_noncontact_peers:flags.0?true keep_archived_unmuted:flags.1?true keep_archived_folders:flags.2?true hide_read_marks:flags.3?true new_noncontact_peers_require_premium:flags.4?true = GlobalPrivacySettings; help.countryCode#4203c5ef flags:# country_code:string prefixes:flags.0?Vector<string> patterns:flags.1?Vector<string> = help.CountryCode; @@ -1268,13 +1336,14 @@ messages.messageViews#b6c4f543 views:Vector<MessageViews> chats:Vector<Chat> use messages.discussionMessage#a6341782 flags:# messages:Vector<Message> max_id:flags.0?int read_inbox_max_id:flags.1?int read_outbox_max_id:flags.2?int unread_count:int chats:Vector<Chat> users:Vector<User> = messages.DiscussionMessage; -messageReplyHeader#a6d57763 flags:# reply_to_scheduled:flags.2?true forum_topic:flags.3?true reply_to_msg_id:int reply_to_peer_id:flags.0?Peer reply_to_top_id:flags.1?int = MessageReplyHeader; +messageReplyHeader#afbc09db flags:# reply_to_scheduled:flags.2?true forum_topic:flags.3?true quote:flags.9?true reply_to_msg_id:flags.4?int reply_to_peer_id:flags.0?Peer reply_from:flags.5?MessageFwdHeader reply_media:flags.8?MessageMedia reply_to_top_id:flags.1?int quote_text:flags.6?string quote_entities:flags.7?Vector<MessageEntity> quote_offset:flags.10?int = MessageReplyHeader; +messageReplyStoryHeader#e5af939 peer:Peer story_id:int = MessageReplyHeader; messageReplies#83d60fc2 flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector<Peer> channel_id:flags.0?long max_id:flags.2?int read_max_id:flags.3?int = MessageReplies; peerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked; -stats.messageStats#8999f295 views_graph:StatsGraph = stats.MessageStats; +stats.messageStats#7fe91c14 views_graph:StatsGraph reactions_by_emotion_graph:StatsGraph = stats.MessageStats; groupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall; groupCall#d597650c flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int = GroupCall; @@ -1337,7 +1406,7 @@ account.resetPasswordFailedWait#e3779861 retry_date:int = account.ResetPasswordR account.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswordResult; account.resetPasswordOk#e926d63e = account.ResetPasswordResult; -sponsoredMessage#fc25b828 flags:# recommended:flags.5?true show_peer_photo:flags.6?true random_id:bytes from_id:flags.3?Peer chat_invite:flags.4?ChatInvite chat_invite_hash:flags.4?string channel_post:flags.2?int start_param:flags.0?string message:string entities:flags.1?Vector<MessageEntity> sponsor_info:flags.7?string additional_info:flags.8?string = SponsoredMessage; +sponsoredMessage#4d93a990 flags:# recommended:flags.5?true can_report:flags.12?true random_id:bytes url:string title:string message:string entities:flags.1?Vector<MessageEntity> photo:flags.6?Photo media:flags.14?MessageMedia color:flags.13?PeerColor button_text:string sponsor_info:flags.7?string additional_info:flags.8?string = SponsoredMessage; messages.sponsoredMessages#c9ee1d87 flags:# posts_between:flags.0?int messages:Vector<SponsoredMessage> chats:Vector<Chat> users:Vector<User> = messages.SponsoredMessages; messages.sponsoredMessagesEmpty#1839490f = messages.SponsoredMessages; @@ -1360,7 +1429,7 @@ auth.loggedOut#c3a2835f flags:# future_auth_token:flags.0?bytes = auth.LoggedOut reactionCount#a3d1cb80 flags:# chosen_order:flags.0?int reaction:Reaction count:int = ReactionCount; -messageReactions#4f2b9479 flags:# min:flags.0?true can_see_list:flags.2?true results:Vector<ReactionCount> recent_reactions:flags.1?Vector<MessagePeerReaction> = MessageReactions; +messageReactions#a339f0b flags:# min:flags.0?true can_see_list:flags.2?true reactions_as_tags:flags.3?true results:Vector<ReactionCount> recent_reactions:flags.1?Vector<MessagePeerReaction> top_reactors:flags.4?Vector<MessageReactor> = MessageReactions; messages.messageReactionsList#31bd492d flags:# count:int reactions:Vector<MessagePeerReaction> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = messages.MessageReactionsList; @@ -1369,7 +1438,7 @@ availableReaction#c077ec01 flags:# inactive:flags.0?true premium:flags.2?true re messages.availableReactionsNotModified#9f071957 = messages.AvailableReactions; messages.availableReactions#768e3aad hash:int reactions:Vector<AvailableReaction> = messages.AvailableReactions; -messagePeerReaction#8c79b63c flags:# big:flags.0?true unread:flags.1?true peer_id:Peer date:int reaction:Reaction = MessagePeerReaction; +messagePeerReaction#8c79b63c flags:# big:flags.0?true unread:flags.1?true my:flags.2?true peer_id:Peer date:int reaction:Reaction = MessagePeerReaction; groupCallStreamChannel#80eb48af channel:int scale:int last_timestamp_ms:long = GroupCallStreamChannel; @@ -1381,16 +1450,14 @@ attachMenuBotIconColor#4576f3f0 name:string color:int = AttachMenuBotIconColor; attachMenuBotIcon#b2a7386b flags:# name:string icon:Document colors:flags.0?Vector<AttachMenuBotIconColor> = AttachMenuBotIcon; -attachMenuBot#c8aa2cd2 flags:# inactive:flags.0?true has_settings:flags.1?true request_write_access:flags.2?true bot_id:long short_name:string peer_types:Vector<AttachMenuPeerType> icons:Vector<AttachMenuBotIcon> = AttachMenuBot; +attachMenuBot#d90d8dfe flags:# inactive:flags.0?true has_settings:flags.1?true request_write_access:flags.2?true show_in_attach_menu:flags.3?true show_in_side_menu:flags.4?true side_menu_disclaimer_needed:flags.5?true bot_id:long short_name:string peer_types:flags.3?Vector<AttachMenuPeerType> icons:Vector<AttachMenuBotIcon> = AttachMenuBot; attachMenuBotsNotModified#f1d88a5c = AttachMenuBots; attachMenuBots#3c4301c0 hash:long bots:Vector<AttachMenuBot> users:Vector<User> = AttachMenuBots; attachMenuBotsBot#93bf667f bot:AttachMenuBot users:Vector<User> = AttachMenuBotsBot; -webViewResultUrl#c14557c query_id:long url:string = WebViewResult; - -simpleWebViewResultUrl#882f76bb url:string = SimpleWebViewResult; +webViewResultUrl#4d22ff98 flags:# fullsize:flags.1?true query_id:flags.0?long url:string = WebViewResult; webViewMessageSent#c94511c flags:# msg_id:flags.0?InputBotInlineMessageID = WebViewMessageSent; @@ -1417,15 +1484,23 @@ attachMenuPeerTypeBroadcast#7bfbdefc = AttachMenuPeerType; inputInvoiceMessage#c5b56859 peer:InputPeer msg_id:int = InputInvoice; inputInvoiceSlug#c326caef slug:string = InputInvoice; +inputInvoicePremiumGiftCode#98986c0d purpose:InputStorePaymentPurpose option:PremiumGiftCodeOption = InputInvoice; +inputInvoiceStars#65f00ce3 purpose:InputStorePaymentPurpose = InputInvoice; +inputInvoiceChatInviteSubscription#34e793f1 hash:string = InputInvoice; payments.exportedInvoice#aed0cbd9 url:string = payments.ExportedInvoice; -messages.transcribedAudio#93752c52 flags:# pending:flags.0?true transcription_id:long text:string = messages.TranscribedAudio; +messages.transcribedAudio#cfb9d957 flags:# pending:flags.0?true transcription_id:long text:string trial_remains_num:flags.1?int trial_remains_until_date:flags.1?int = messages.TranscribedAudio; help.premiumPromo#5334759c status_text:string status_entities:Vector<MessageEntity> video_sections:Vector<string> videos:Vector<Document> period_options:Vector<PremiumSubscriptionOption> users:Vector<User> = help.PremiumPromo; inputStorePaymentPremiumSubscription#a6751e66 flags:# restore:flags.0?true upgrade:flags.1?true = InputStorePaymentPurpose; inputStorePaymentGiftPremium#616f7fe8 user_id:InputUser currency:string amount:long = InputStorePaymentPurpose; +inputStorePaymentPremiumGiftCode#a3805f3f flags:# users:Vector<InputUser> boost_peer:flags.0?InputPeer currency:string amount:long = InputStorePaymentPurpose; +inputStorePaymentPremiumGiveaway#160544ca flags:# only_new_subscribers:flags.0?true winners_are_visible:flags.3?true boost_peer:InputPeer additional_peers:flags.1?Vector<InputPeer> countries_iso2:flags.2?Vector<string> prize_description:flags.4?string random_id:long until_date:int currency:string amount:long = InputStorePaymentPurpose; +inputStorePaymentStarsTopup#dddd0f56 stars:long currency:string amount:long = InputStorePaymentPurpose; +inputStorePaymentStarsGift#1d741ef7 user_id:InputUser stars:long currency:string amount:long = InputStorePaymentPurpose; +inputStorePaymentStarsGiveaway#751f08fa flags:# only_new_subscribers:flags.0?true winners_are_visible:flags.3?true stars:long boost_peer:InputPeer additional_peers:flags.1?Vector<InputPeer> countries_iso2:flags.2?Vector<string> prize_description:flags.4?string random_id:long until_date:int currency:string amount:long users:int = InputStorePaymentPurpose; premiumGiftOption#74c34319 flags:# months:int currency:string amount:long bot_url:string store_product:flags.0?string = PremiumGiftOption; @@ -1441,6 +1516,7 @@ account.emojiStatuses#90c467d1 hash:long statuses:Vector<EmojiStatus> = account. reactionEmpty#79f5d419 = Reaction; reactionEmoji#1b2286b8 emoticon:string = Reaction; reactionCustomEmoji#8935fc73 document_id:long = Reaction; +reactionPaid#523da4eb = Reaction; chatReactionsNone#eafc32bc = ChatReactions; chatReactionsAll#52928bca flags:# allow_custom:flags.0?true = ChatReactions; @@ -1488,6 +1564,8 @@ emojiListNotModified#481eadfa = EmojiList; emojiList#7a1e11d1 hash:long document_id:Vector<long> = EmojiList; emojiGroup#7a9abda9 title:string icon_emoji_id:long emoticons:Vector<string> = EmojiGroup; +emojiGroupGreeting#80d26cc7 title:string icon_emoji_id:long emoticons:Vector<string> = EmojiGroup; +emojiGroupPremium#93bcf34 title:string icon_emoji_id:long = EmojiGroup; messages.emojiGroupsNotModified#6fb4ad87 = messages.EmojiGroups; messages.emojiGroups#881fb94b hash:int groups:Vector<EmojiGroup> = messages.EmojiGroups; @@ -1511,9 +1589,7 @@ inputBotAppShortName#908c0407 bot_id:InputUser short_name:string = InputBotApp; botAppNotModified#5da674b7 = BotApp; botApp#95fcd1d6 flags:# id:long access_hash:long short_name:string title:string description:string photo:Photo document:flags.0?Document hash:long = BotApp; -messages.botApp#eb50adf5 flags:# inactive:flags.0?true request_write_access:flags.1?true app:BotApp = messages.BotApp; - -appWebViewResultUrl#3c1b4f0d url:string = AppWebViewResult; +messages.botApp#eb50adf5 flags:# inactive:flags.0?true request_write_access:flags.1?true has_settings:flags.2?true app:BotApp = messages.BotApp; inlineBotWebView#b57295d5 text:string url:string = InlineBotWebView; @@ -1534,6 +1610,278 @@ chatlists.chatlistUpdates#93bd878d missing_peers:Vector<Peer> chats:Vector<Chat> bots.botInfo#e8a775b0 name:string about:string description:string = bots.BotInfo; +messagePeerVote#b6cc2d5c peer:Peer option:bytes date:int = MessagePeerVote; +messagePeerVoteInputOption#74cda504 peer:Peer date:int = MessagePeerVote; +messagePeerVoteMultiple#4628f6e6 peer:Peer options:Vector<bytes> date:int = MessagePeerVote; + +storyViews#8d595cd6 flags:# has_viewers:flags.1?true views_count:int forwards_count:flags.2?int reactions:flags.3?Vector<ReactionCount> reactions_count:flags.4?int recent_viewers:flags.0?Vector<long> = StoryViews; + +storyItemDeleted#51e6ee4f id:int = StoryItem; +storyItemSkipped#ffadc913 flags:# close_friends:flags.8?true id:int date:int expire_date:int = StoryItem; +storyItem#79b26a24 flags:# pinned:flags.5?true public:flags.7?true close_friends:flags.8?true min:flags.9?true noforwards:flags.10?true edited:flags.11?true contacts:flags.12?true selected_contacts:flags.13?true out:flags.16?true id:int date:int from_id:flags.18?Peer fwd_from:flags.17?StoryFwdHeader expire_date:int caption:flags.0?string entities:flags.1?Vector<MessageEntity> media:MessageMedia media_areas:flags.14?Vector<MediaArea> privacy:flags.2?Vector<PrivacyRule> views:flags.3?StoryViews sent_reaction:flags.15?Reaction = StoryItem; + +stories.allStoriesNotModified#1158fe3e flags:# state:string stealth_mode:StoriesStealthMode = stories.AllStories; +stories.allStories#6efc5e81 flags:# has_more:flags.0?true count:int state:string peer_stories:Vector<PeerStories> chats:Vector<Chat> users:Vector<User> stealth_mode:StoriesStealthMode = stories.AllStories; + +stories.stories#63c3dd0a flags:# count:int stories:Vector<StoryItem> pinned_to_top:flags.0?Vector<int> chats:Vector<Chat> users:Vector<User> = stories.Stories; + +storyView#b0bdeac5 flags:# blocked:flags.0?true blocked_my_stories_from:flags.1?true user_id:long date:int reaction:flags.2?Reaction = StoryView; +storyViewPublicForward#9083670b flags:# blocked:flags.0?true blocked_my_stories_from:flags.1?true message:Message = StoryView; +storyViewPublicRepost#bd74cf49 flags:# blocked:flags.0?true blocked_my_stories_from:flags.1?true peer_id:Peer story:StoryItem = StoryView; + +stories.storyViewsList#59d78fc5 flags:# count:int views_count:int forwards_count:int reactions_count:int views:Vector<StoryView> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = stories.StoryViewsList; + +stories.storyViews#de9eed1d views:Vector<StoryViews> users:Vector<User> = stories.StoryViews; + +inputReplyToMessage#22c0f6d5 flags:# reply_to_msg_id:int top_msg_id:flags.0?int reply_to_peer_id:flags.1?InputPeer quote_text:flags.2?string quote_entities:flags.3?Vector<MessageEntity> quote_offset:flags.4?int = InputReplyTo; +inputReplyToStory#5881323a peer:InputPeer story_id:int = InputReplyTo; + +exportedStoryLink#3fc9053b link:string = ExportedStoryLink; + +storiesStealthMode#712e27fd flags:# active_until_date:flags.0?int cooldown_until_date:flags.1?int = StoriesStealthMode; + +mediaAreaCoordinates#cfc9e002 flags:# x:double y:double w:double h:double rotation:double radius:flags.0?double = MediaAreaCoordinates; + +mediaAreaVenue#be82db9c coordinates:MediaAreaCoordinates geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MediaArea; +inputMediaAreaVenue#b282217f coordinates:MediaAreaCoordinates query_id:long result_id:string = MediaArea; +mediaAreaGeoPoint#cad5452d flags:# coordinates:MediaAreaCoordinates geo:GeoPoint address:flags.0?GeoPointAddress = MediaArea; +mediaAreaSuggestedReaction#14455871 flags:# dark:flags.0?true flipped:flags.1?true coordinates:MediaAreaCoordinates reaction:Reaction = MediaArea; +mediaAreaChannelPost#770416af coordinates:MediaAreaCoordinates channel_id:long msg_id:int = MediaArea; +inputMediaAreaChannelPost#2271f2bf coordinates:MediaAreaCoordinates channel:InputChannel msg_id:int = MediaArea; +mediaAreaUrl#37381085 coordinates:MediaAreaCoordinates url:string = MediaArea; +mediaAreaWeather#49a6549c coordinates:MediaAreaCoordinates emoji:string temperature_c:double color:int = MediaArea; + +peerStories#9a35e999 flags:# peer:Peer max_read_id:flags.0?int stories:Vector<StoryItem> = PeerStories; + +stories.peerStories#cae68768 stories:PeerStories chats:Vector<Chat> users:Vector<User> = stories.PeerStories; + +messages.webPage#fd5e12bd webpage:WebPage chats:Vector<Chat> users:Vector<User> = messages.WebPage; + +premiumGiftCodeOption#257e962b flags:# users:int months:int store_product:flags.0?string store_quantity:flags.1?int currency:string amount:long = PremiumGiftCodeOption; + +payments.checkedGiftCode#284a1096 flags:# via_giveaway:flags.2?true from_id:flags.4?Peer giveaway_msg_id:flags.3?int to_id:flags.0?long date:int months:int used_date:flags.1?int chats:Vector<Chat> users:Vector<User> = payments.CheckedGiftCode; + +payments.giveawayInfo#4367daa0 flags:# participating:flags.0?true preparing_results:flags.3?true start_date:int joined_too_early_date:flags.1?int admin_disallowed_chat_id:flags.2?long disallowed_country:flags.4?string = payments.GiveawayInfo; +payments.giveawayInfoResults#e175e66f flags:# winner:flags.0?true refunded:flags.1?true start_date:int gift_code_slug:flags.3?string stars_prize:flags.4?long finish_date:int winners_count:int activated_count:flags.2?int = payments.GiveawayInfo; + +prepaidGiveaway#b2539d54 id:long months:int quantity:int date:int = PrepaidGiveaway; +prepaidStarsGiveaway#9a9d77e0 id:long stars:long quantity:int boosts:int date:int = PrepaidGiveaway; + +boost#4b3e14d6 flags:# gift:flags.1?true giveaway:flags.2?true unclaimed:flags.3?true id:string user_id:flags.0?long giveaway_msg_id:flags.2?int date:int expires:int used_gift_slug:flags.4?string multiplier:flags.5?int stars:flags.6?long = Boost; + +premium.boostsList#86f8613c flags:# count:int boosts:Vector<Boost> next_offset:flags.0?string users:Vector<User> = premium.BoostsList; + +myBoost#c448415c flags:# slot:int peer:flags.0?Peer date:int expires:int cooldown_until_date:flags.1?int = MyBoost; + +premium.myBoosts#9ae228e2 my_boosts:Vector<MyBoost> chats:Vector<Chat> users:Vector<User> = premium.MyBoosts; + +premium.boostsStatus#4959427a flags:# my_boost:flags.2?true level:int current_level_boosts:int boosts:int gift_boosts:flags.4?int next_level_boosts:flags.0?int premium_audience:flags.1?StatsPercentValue boost_url:string prepaid_giveaways:flags.3?Vector<PrepaidGiveaway> my_boost_slots:flags.2?Vector<int> = premium.BoostsStatus; + +storyFwdHeader#b826e150 flags:# modified:flags.3?true from:flags.0?Peer from_name:flags.1?string story_id:flags.2?int = StoryFwdHeader; + +postInteractionCountersMessage#e7058e7f msg_id:int views:int forwards:int reactions:int = PostInteractionCounters; +postInteractionCountersStory#8a480e27 story_id:int views:int forwards:int reactions:int = PostInteractionCounters; + +stats.storyStats#50cd067c views_graph:StatsGraph reactions_by_emotion_graph:StatsGraph = stats.StoryStats; + +publicForwardMessage#1f2bf4a message:Message = PublicForward; +publicForwardStory#edf3add0 peer:Peer story:StoryItem = PublicForward; + +stats.publicForwards#93037e20 flags:# count:int forwards:Vector<PublicForward> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = stats.PublicForwards; + +peerColor#b54b5acf flags:# color:flags.0?int background_emoji_id:flags.1?long = PeerColor; + +help.peerColorSet#26219a58 colors:Vector<int> = help.PeerColorSet; +help.peerColorProfileSet#767d61eb palette_colors:Vector<int> bg_colors:Vector<int> story_colors:Vector<int> = help.PeerColorSet; + +help.peerColorOption#adec6ebe flags:# hidden:flags.0?true color_id:int colors:flags.1?help.PeerColorSet dark_colors:flags.2?help.PeerColorSet channel_min_level:flags.3?int group_min_level:flags.4?int = help.PeerColorOption; + +help.peerColorsNotModified#2ba1f5ce = help.PeerColors; +help.peerColors#f8ed08 hash:int colors:Vector<help.PeerColorOption> = help.PeerColors; + +storyReaction#6090d6d5 peer_id:Peer date:int reaction:Reaction = StoryReaction; +storyReactionPublicForward#bbab2643 message:Message = StoryReaction; +storyReactionPublicRepost#cfcd0f13 peer_id:Peer story:StoryItem = StoryReaction; + +stories.storyReactionsList#aa5f789c flags:# count:int reactions:Vector<StoryReaction> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = stories.StoryReactionsList; + +savedDialog#bd87cb6c flags:# pinned:flags.2?true peer:Peer top_message:int = SavedDialog; + +messages.savedDialogs#f83ae221 dialogs:Vector<SavedDialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.SavedDialogs; +messages.savedDialogsSlice#44ba9dd9 count:int dialogs:Vector<SavedDialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.SavedDialogs; +messages.savedDialogsNotModified#c01f6fe8 count:int = messages.SavedDialogs; + +savedReactionTag#cb6ff828 flags:# reaction:Reaction title:flags.0?string count:int = SavedReactionTag; + +messages.savedReactionTagsNotModified#889b59ef = messages.SavedReactionTags; +messages.savedReactionTags#3259950a tags:Vector<SavedReactionTag> hash:long = messages.SavedReactionTags; + +outboxReadDate#3bb842ac date:int = OutboxReadDate; + +smsjobs.eligibleToJoin#dc8b44cf terms_url:string monthly_sent_sms:int = smsjobs.EligibilityToJoin; + +smsjobs.status#2aee9191 flags:# allow_international:flags.0?true recent_sent:int recent_since:int recent_remains:int total_sent:int total_since:int last_gift_slug:flags.1?string terms_url:string = smsjobs.Status; + +smsJob#e6a1eeb8 job_id:string phone_number:string text:string = SmsJob; + +businessWeeklyOpen#120b1ab9 start_minute:int end_minute:int = BusinessWeeklyOpen; + +businessWorkHours#8c92b098 flags:# open_now:flags.0?true timezone_id:string weekly_open:Vector<BusinessWeeklyOpen> = BusinessWorkHours; + +businessLocation#ac5c1af7 flags:# geo_point:flags.0?GeoPoint address:string = BusinessLocation; + +inputBusinessRecipients#6f8b32aa flags:# existing_chats:flags.0?true new_chats:flags.1?true contacts:flags.2?true non_contacts:flags.3?true exclude_selected:flags.5?true users:flags.4?Vector<InputUser> = InputBusinessRecipients; + +businessRecipients#21108ff7 flags:# existing_chats:flags.0?true new_chats:flags.1?true contacts:flags.2?true non_contacts:flags.3?true exclude_selected:flags.5?true users:flags.4?Vector<long> = BusinessRecipients; + +businessAwayMessageScheduleAlways#c9b9e2b9 = BusinessAwayMessageSchedule; +businessAwayMessageScheduleOutsideWorkHours#c3f2f501 = BusinessAwayMessageSchedule; +businessAwayMessageScheduleCustom#cc4d9ecc start_date:int end_date:int = BusinessAwayMessageSchedule; + +inputBusinessGreetingMessage#194cb3b shortcut_id:int recipients:InputBusinessRecipients no_activity_days:int = InputBusinessGreetingMessage; + +businessGreetingMessage#e519abab shortcut_id:int recipients:BusinessRecipients no_activity_days:int = BusinessGreetingMessage; + +inputBusinessAwayMessage#832175e0 flags:# offline_only:flags.0?true shortcut_id:int schedule:BusinessAwayMessageSchedule recipients:InputBusinessRecipients = InputBusinessAwayMessage; + +businessAwayMessage#ef156a5c flags:# offline_only:flags.0?true shortcut_id:int schedule:BusinessAwayMessageSchedule recipients:BusinessRecipients = BusinessAwayMessage; + +timezone#ff9289f5 id:string name:string utc_offset:int = Timezone; + +help.timezonesListNotModified#970708cc = help.TimezonesList; +help.timezonesList#7b74ed71 timezones:Vector<Timezone> hash:int = help.TimezonesList; + +quickReply#697102b shortcut_id:int shortcut:string top_message:int count:int = QuickReply; + +inputQuickReplyShortcut#24596d41 shortcut:string = InputQuickReplyShortcut; +inputQuickReplyShortcutId#1190cf1 shortcut_id:int = InputQuickReplyShortcut; + +messages.quickReplies#c68d6695 quick_replies:Vector<QuickReply> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.QuickReplies; +messages.quickRepliesNotModified#5f91eb5b = messages.QuickReplies; + +connectedBot#bd068601 flags:# can_reply:flags.0?true bot_id:long recipients:BusinessBotRecipients = ConnectedBot; + +account.connectedBots#17d7f87b connected_bots:Vector<ConnectedBot> users:Vector<User> = account.ConnectedBots; + +messages.dialogFilters#2ad93719 flags:# tags_enabled:flags.0?true filters:Vector<DialogFilter> = messages.DialogFilters; + +birthday#6c8e1e06 flags:# day:int month:int year:flags.0?int = Birthday; + +botBusinessConnection#896433b4 flags:# can_reply:flags.0?true disabled:flags.1?true connection_id:string user_id:long dc_id:int date:int = BotBusinessConnection; + +inputBusinessIntro#9c469cd flags:# title:string description:string sticker:flags.0?InputDocument = InputBusinessIntro; + +businessIntro#5a0a066d flags:# title:string description:string sticker:flags.0?Document = BusinessIntro; + +messages.myStickers#faff629d count:int sets:Vector<StickerSetCovered> = messages.MyStickers; + +inputCollectibleUsername#e39460a9 username:string = InputCollectible; +inputCollectiblePhone#a2e214a4 phone:string = InputCollectible; + +fragment.collectibleInfo#6ebdff91 purchase_date:int currency:string amount:long crypto_currency:string crypto_amount:long url:string = fragment.CollectibleInfo; + +inputBusinessBotRecipients#c4e5921e flags:# existing_chats:flags.0?true new_chats:flags.1?true contacts:flags.2?true non_contacts:flags.3?true exclude_selected:flags.5?true users:flags.4?Vector<InputUser> exclude_users:flags.6?Vector<InputUser> = InputBusinessBotRecipients; + +businessBotRecipients#b88cf373 flags:# existing_chats:flags.0?true new_chats:flags.1?true contacts:flags.2?true non_contacts:flags.3?true exclude_selected:flags.5?true users:flags.4?Vector<long> exclude_users:flags.6?Vector<long> = BusinessBotRecipients; + +contactBirthday#1d998733 contact_id:long birthday:Birthday = ContactBirthday; + +contacts.contactBirthdays#114ff30d contacts:Vector<ContactBirthday> users:Vector<User> = contacts.ContactBirthdays; + +missingInvitee#628c9224 flags:# premium_would_allow_invite:flags.0?true premium_required_for_pm:flags.1?true user_id:long = MissingInvitee; + +messages.invitedUsers#7f5defa6 updates:Updates missing_invitees:Vector<MissingInvitee> = messages.InvitedUsers; + +inputBusinessChatLink#11679fa7 flags:# message:string entities:flags.0?Vector<MessageEntity> title:flags.1?string = InputBusinessChatLink; + +businessChatLink#b4ae666f flags:# link:string message:string entities:flags.0?Vector<MessageEntity> title:flags.1?string views:int = BusinessChatLink; + +account.businessChatLinks#ec43a2d1 links:Vector<BusinessChatLink> chats:Vector<Chat> users:Vector<User> = account.BusinessChatLinks; + +account.resolvedBusinessChatLinks#9a23af21 flags:# peer:Peer message:string entities:flags.0?Vector<MessageEntity> chats:Vector<Chat> users:Vector<User> = account.ResolvedBusinessChatLinks; + +requestedPeerUser#d62ff46a flags:# user_id:long first_name:flags.0?string last_name:flags.0?string username:flags.1?string photo:flags.2?Photo = RequestedPeer; +requestedPeerChat#7307544f flags:# chat_id:long title:flags.0?string photo:flags.2?Photo = RequestedPeer; +requestedPeerChannel#8ba403e4 flags:# channel_id:long title:flags.0?string username:flags.1?string photo:flags.2?Photo = RequestedPeer; + +sponsoredMessageReportOption#430d3150 text:string option:bytes = SponsoredMessageReportOption; + +channels.sponsoredMessageReportResultChooseOption#846f9e42 title:string options:Vector<SponsoredMessageReportOption> = channels.SponsoredMessageReportResult; +channels.sponsoredMessageReportResultAdsHidden#3e3bcf2f = channels.SponsoredMessageReportResult; +channels.sponsoredMessageReportResultReported#ad798849 = channels.SponsoredMessageReportResult; + +stats.broadcastRevenueStats#5407e297 top_hours_graph:StatsGraph revenue_graph:StatsGraph balances:BroadcastRevenueBalances usd_rate:double = stats.BroadcastRevenueStats; + +stats.broadcastRevenueWithdrawalUrl#ec659737 url:string = stats.BroadcastRevenueWithdrawalUrl; + +broadcastRevenueTransactionProceeds#557e2cc4 amount:long from_date:int to_date:int = BroadcastRevenueTransaction; +broadcastRevenueTransactionWithdrawal#5a590978 flags:# pending:flags.0?true failed:flags.2?true amount:long date:int provider:string transaction_date:flags.1?int transaction_url:flags.1?string = BroadcastRevenueTransaction; +broadcastRevenueTransactionRefund#42d30d2e amount:long date:int provider:string = BroadcastRevenueTransaction; + +stats.broadcastRevenueTransactions#87158466 count:int transactions:Vector<BroadcastRevenueTransaction> = stats.BroadcastRevenueTransactions; + +reactionNotificationsFromContacts#bac3a61a = ReactionNotificationsFrom; +reactionNotificationsFromAll#4b9e22a0 = ReactionNotificationsFrom; + +reactionsNotifySettings#56e34970 flags:# messages_notify_from:flags.0?ReactionNotificationsFrom stories_notify_from:flags.1?ReactionNotificationsFrom sound:NotificationSound show_previews:Bool = ReactionsNotifySettings; + +broadcastRevenueBalances#c3ff71e7 flags:# withdrawal_enabled:flags.0?true current_balance:long available_balance:long overall_revenue:long = BroadcastRevenueBalances; + +availableEffect#93c3e27e flags:# premium_required:flags.2?true id:long emoticon:string static_icon_id:flags.0?long effect_sticker_id:long effect_animation_id:flags.1?long = AvailableEffect; + +messages.availableEffectsNotModified#d1ed9a5b = messages.AvailableEffects; +messages.availableEffects#bddb616e hash:int effects:Vector<AvailableEffect> documents:Vector<Document> = messages.AvailableEffects; + +factCheck#b89bfccf flags:# need_check:flags.0?true country:flags.1?string text:flags.1?TextWithEntities hash:long = FactCheck; + +starsTransactionPeerUnsupported#95f2bfe4 = StarsTransactionPeer; +starsTransactionPeerAppStore#b457b375 = StarsTransactionPeer; +starsTransactionPeerPlayMarket#7b560a0b = StarsTransactionPeer; +starsTransactionPeerPremiumBot#250dbaf8 = StarsTransactionPeer; +starsTransactionPeerFragment#e92fd902 = StarsTransactionPeer; +starsTransactionPeer#d80da15d peer:Peer = StarsTransactionPeer; +starsTransactionPeerAds#60682812 = StarsTransactionPeer; + +starsTopupOption#bd915c0 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsTopupOption; + +starsTransaction#ee7522d5 flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true id:string stars:long date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector<MessageMedia> subscription_period:flags.12?int giveaway_post_id:flags.13?int = StarsTransaction; + +payments.starsStatus#bbfa316c flags:# balance:long subscriptions:flags.1?Vector<StarsSubscription> subscriptions_next_offset:flags.2?string subscriptions_missing_balance:flags.4?long history:flags.3?Vector<StarsTransaction> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = payments.StarsStatus; + +foundStory#e87acbc0 peer:Peer story:StoryItem = FoundStory; + +stories.foundStories#e2de7737 flags:# count:int stories:Vector<FoundStory> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = stories.FoundStories; + +geoPointAddress#de4c5d93 flags:# country_iso2:string state:flags.0?string city:flags.1?string street:flags.2?string = GeoPointAddress; + +starsRevenueStatus#79342946 flags:# withdrawal_enabled:flags.0?true current_balance:long available_balance:long overall_revenue:long next_withdrawal_at:flags.1?int = StarsRevenueStatus; + +payments.starsRevenueStats#c92bb73b revenue_graph:StatsGraph status:StarsRevenueStatus usd_rate:double = payments.StarsRevenueStats; + +payments.starsRevenueWithdrawalUrl#1dab80b7 url:string = payments.StarsRevenueWithdrawalUrl; + +payments.starsRevenueAdsAccountUrl#394e7f21 url:string = payments.StarsRevenueAdsAccountUrl; + +inputStarsTransaction#206ae6d1 flags:# refund:flags.0?true id:string = InputStarsTransaction; + +starsGiftOption#5e0589f1 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsGiftOption; + +bots.popularAppBots#1991b13b flags:# next_offset:flags.0?string users:Vector<User> = bots.PopularAppBots; + +botPreviewMedia#23e91ba3 date:int media:MessageMedia = BotPreviewMedia; + +bots.previewInfo#ca71d64 media:Vector<BotPreviewMedia> lang_codes:Vector<string> = bots.PreviewInfo; + +starsSubscriptionPricing#5416d58 period:int amount:long = StarsSubscriptionPricing; + +starsSubscription#538ecf18 flags:# canceled:flags.0?true can_refulfill:flags.1?true missing_balance:flags.2?true id:string peer:Peer until_date:int pricing:StarsSubscriptionPricing chat_invite_hash:flags.3?string = StarsSubscription; + +messageReactor#4ba3a95a flags:# top:flags.0?true my:flags.1?true anonymous:flags.2?true peer_id:flags.3?Peer count:int = MessageReactor; + +starsGiveawayOption#94ce852a flags:# extended:flags.0?true default:flags.1?true stars:long yearly_boosts:int store_product:flags.2?string currency:string amount:long winners:Vector<StarsGiveawayWinnersOption> = StarsGiveawayOption; + +starsGiveawayWinnersOption#54236209 flags:# default:flags.0?true users:int per_user_stars:long = StarsGiveawayWinnersOption; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -1543,9 +1891,12 @@ invokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X; invokeWithoutUpdates#bf9459b7 {X:Type} query:!X = X; invokeWithMessagesRange#365275f2 {X:Type} range:MessageRange query:!X = X; invokeWithTakeout#aca9fd2e {X:Type} takeout_id:long query:!X = X; +invokeWithBusinessConnection#dd289f8e {X:Type} connection_id:string query:!X = X; +invokeWithGooglePlayIntegrity#1df92984 {X:Type} nonce:string token:string query:!X = X; +invokeWithApnsSecret#0dae54f8 {X:Type} nonce:string secret:string query:!X = X; auth.sendCode#a677244f phone_number:string api_id:int api_hash:string settings:CodeSettings = auth.SentCode; -auth.signUp#80eee427 phone_number:string phone_code_hash:string first_name:string last_name:string = auth.Authorization; +auth.signUp#aac7b717 flags:# no_joined_notifications:flags.0?true phone_number:string phone_code_hash:string first_name:string last_name:string = auth.Authorization; auth.signIn#8d52a951 flags:# phone_number:string phone_code_hash:string phone_code:flags.0?string email_verification:flags.1?EmailVerification = auth.Authorization; auth.logOut#3e72ba19 = auth.LoggedOut; auth.resetAuthorizations#9fab0d1a = Bool; @@ -1556,7 +1907,7 @@ auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_au auth.checkPassword#d18b4d16 password:InputCheckPasswordSRP = auth.Authorization; auth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery; auth.recoverPassword#37096c70 flags:# code:string new_settings:flags.0?account.PasswordInputSettings = auth.Authorization; -auth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentCode; +auth.resendCode#cae47523 flags:# phone_number:string phone_code_hash:string reason:flags.0?string = auth.SentCode; auth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool; auth.dropTempAuthKeys#8e48a188 except_auth_keys:Vector<long> = Bool; auth.exportLoginToken#b7e085fe api_id:int api_hash:string except_ids:Vector<long> = auth.LoginToken; @@ -1564,8 +1915,9 @@ auth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken; auth.acceptLoginToken#e894ad4d token:bytes = Authorization; auth.checkRecoveryPassword#d36bf79 code:string = Bool; auth.importWebTokenAuthorization#2db873a9 api_id:int api_hash:string web_auth_token:string = auth.Authorization; -auth.requestFirebaseSms#89464b50 flags:# phone_number:string phone_code_hash:string safety_net_token:flags.0?string ios_push_secret:flags.1?string = Bool; +auth.requestFirebaseSms#8e39261e flags:# phone_number:string phone_code_hash:string safety_net_token:flags.0?string play_integrity_token:flags.2?string ios_push_secret:flags.1?string = Bool; auth.resetLoginEmail#7e960193 phone_number:string phone_code_hash:string = auth.SentCode; +auth.reportMissingCode#cb9deff6 phone_number:string phone_code_hash:string mnc:string = Bool; account.registerDevice#ec86017a flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector<long> = Bool; account.unregisterDevice#6a0d3206 token_type:int token:string other_uids:Vector<long> = Bool; @@ -1614,7 +1966,7 @@ account.resendPasswordEmail#7a7f2a15 = Bool; account.cancelPasswordEmail#c1cbd5b6 = Bool; account.getContactSignUpNotification#9f07c728 = Bool; account.setContactSignUpNotification#cff43f61 silent:Bool = Bool; -account.getNotifyExceptions#53577479 flags:# compare_sound:flags.1?true peer:flags.0?InputNotifyPeer = Updates; +account.getNotifyExceptions#53577479 flags:# compare_sound:flags.1?true compare_stories:flags.2?true peer:flags.0?InputNotifyPeer = Updates; account.getWallPaper#fc8ddbea wallpaper:InputWallPaper = WallPaper; account.uploadWallPaper#e39a8f03 flags:# for_chat:flags.0?true file:InputFile mime_type:string settings:WallPaperSettings = WallPaper; account.saveWallPaper#6c5a5b37 wallpaper:InputWallPaper unsave:Bool settings:WallPaperSettings = Bool; @@ -1639,7 +1991,7 @@ account.resetPassword#9308ce1b = account.ResetPasswordResult; account.declinePasswordReset#4c9409f6 = Bool; account.getChatThemes#d638de89 hash:long = account.Themes; account.setAuthorizationTTL#bf899aa0 authorization_ttl_days:int = Bool; -account.changeAuthorizationSettings#40f48462 flags:# hash:long encrypted_requests_disabled:flags.0?Bool call_requests_disabled:flags.1?Bool = Bool; +account.changeAuthorizationSettings#40f48462 flags:# confirmed:flags.3?true hash:long encrypted_requests_disabled:flags.0?Bool call_requests_disabled:flags.1?Bool = Bool; account.getSavedRingtones#e1902288 hash:long = account.SavedRingtones; account.saveRingtone#3dea5b03 id:InputDocument unsave:Bool = account.SavedRingtone; account.uploadRingtone#831a83a2 file:InputFile file_name:string mime_type:string = Document; @@ -1654,10 +2006,36 @@ account.getDefaultGroupPhotoEmojis#915860ae hash:long = EmojiList; account.getAutoSaveSettings#adcbbcda = account.AutoSaveSettings; account.saveAutoSaveSettings#d69b8361 flags:# users:flags.0?true chats:flags.1?true broadcasts:flags.2?true peer:flags.3?InputPeer settings:AutoSaveSettings = Bool; account.deleteAutoSaveExceptions#53bc0020 = Bool; +account.invalidateSignInCodes#ca8ae8ba codes:Vector<string> = Bool; +account.updateColor#7cefa15d flags:# for_profile:flags.1?true color:flags.2?int background_emoji_id:flags.0?long = Bool; +account.getDefaultBackgroundEmojis#a60ab9ce hash:long = EmojiList; +account.getChannelDefaultEmojiStatuses#7727a7d5 hash:long = account.EmojiStatuses; +account.getChannelRestrictedStatusEmojis#35a9e0d5 hash:long = EmojiList; +account.updateBusinessWorkHours#4b00e066 flags:# business_work_hours:flags.0?BusinessWorkHours = Bool; +account.updateBusinessLocation#9e6b131a flags:# geo_point:flags.1?InputGeoPoint address:flags.0?string = Bool; +account.updateBusinessGreetingMessage#66cdafc4 flags:# message:flags.0?InputBusinessGreetingMessage = Bool; +account.updateBusinessAwayMessage#a26a7fa5 flags:# message:flags.0?InputBusinessAwayMessage = Bool; +account.updateConnectedBot#43d8521d flags:# can_reply:flags.0?true deleted:flags.1?true bot:InputUser recipients:InputBusinessBotRecipients = Updates; +account.getConnectedBots#4ea4c80f = account.ConnectedBots; +account.getBotBusinessConnection#76a86270 connection_id:string = Updates; +account.updateBusinessIntro#a614d034 flags:# intro:flags.0?InputBusinessIntro = Bool; +account.toggleConnectedBotPaused#646e1097 peer:InputPeer paused:Bool = Bool; +account.disablePeerConnectedBot#5e437ed9 peer:InputPeer = Bool; +account.updateBirthday#cc6e0c11 flags:# birthday:flags.0?Birthday = Bool; +account.createBusinessChatLink#8851e68e link:InputBusinessChatLink = BusinessChatLink; +account.editBusinessChatLink#8c3410af slug:string link:InputBusinessChatLink = BusinessChatLink; +account.deleteBusinessChatLink#60073674 slug:string = Bool; +account.getBusinessChatLinks#6f70dde1 = account.BusinessChatLinks; +account.resolveBusinessChatLink#5492e5ee slug:string = account.ResolvedBusinessChatLinks; +account.updatePersonalChannel#d94305e0 channel:InputChannel = Bool; +account.toggleSponsoredMessages#b9d9a38d enabled:Bool = Bool; +account.getReactionsNotifySettings#6dd654c = ReactionsNotifySettings; +account.setReactionsNotifySettings#316ce548 settings:ReactionsNotifySettings = ReactionsNotifySettings; users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>; users.getFullUser#b60f5918 id:InputUser = users.UserFull; users.setSecureValueErrors#90c894b5 id:InputUser errors:Vector<SecureValueError> = Bool; +users.getIsPremiumRequiredToContact#a622aa10 id:Vector<InputUser> = Vector<Bool>; contacts.getContactIDs#7adc669d hash:long = Vector<int>; contacts.getStatuses#c4a353ee = Vector<ContactStatus>; @@ -1665,12 +2043,12 @@ contacts.getContacts#5dd69e12 hash:long = contacts.Contacts; contacts.importContacts#2c800be5 contacts:Vector<InputContact> = contacts.ImportedContacts; contacts.deleteContacts#96a0e00 id:Vector<InputUser> = Updates; contacts.deleteByPhones#1013fd9e phones:Vector<string> = Bool; -contacts.block#68cc1411 id:InputPeer = Bool; -contacts.unblock#bea65d50 id:InputPeer = Bool; -contacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked; +contacts.block#2e2e8734 flags:# my_stories_from:flags.0?true id:InputPeer = Bool; +contacts.unblock#b550d328 flags:# my_stories_from:flags.0?true id:InputPeer = Bool; +contacts.getBlocked#9a868f80 flags:# my_stories_from:flags.0?true offset:int limit:int = contacts.Blocked; contacts.search#11f812d8 q:string limit:int = contacts.Found; contacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer; -contacts.getTopPeers#973478b6 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:long = contacts.TopPeers; +contacts.getTopPeers#973478b6 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true bots_app:flags.16?true offset:int limit:int hash:long = contacts.TopPeers; contacts.resetTopPeerRating#1ae373ac category:TopPeerCategory peer:InputPeer = Bool; contacts.resetSaved#879537f1 = Bool; contacts.getSaved#82f1e39f = Vector<SavedContact>; @@ -1682,19 +2060,22 @@ contacts.blockFromReplies#29a8962c flags:# delete_message:flags.0?true delete_hi contacts.resolvePhone#8af94344 phone:string = contacts.ResolvedPeer; contacts.exportContactToken#f8654027 = ExportedContactToken; contacts.importContactToken#13005788 token:string = User; +contacts.editCloseFriends#ba6705f0 id:Vector<long> = Bool; +contacts.setBlocked#94c65c76 flags:# my_stories_from:flags.0?true id:Vector<InputPeer> limit:int = Bool; +contacts.getBirthdays#daeda864 = contacts.ContactBirthdays; messages.getMessages#63c66506 id:Vector<InputMessage> = messages.Messages; messages.getDialogs#a0f4cb4f flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:long = messages.Dialogs; messages.getHistory#4423e6c5 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages; -messages.search#a0fda762 flags:# peer:InputPeer q:string from_id:flags.0?InputPeer top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages; +messages.search#29ee847a flags:# peer:InputPeer q:string from_id:flags.0?InputPeer saved_peer_id:flags.2?InputPeer saved_reaction:flags.3?Vector<Reaction> top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages; messages.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages; messages.deleteHistory#b08f922a flags:# just_clear:flags.0?true revoke:flags.1?true peer:InputPeer max_id:int min_date:flags.2?int max_date:flags.3?int = messages.AffectedHistory; messages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector<int> = messages.AffectedMessages; messages.receivedMessages#5a954c0 max_id:int = Vector<ReceivedNotifyMessage>; messages.setTyping#58943ee2 flags:# peer:InputPeer top_msg_id:flags.0?int action:SendMessageAction = Bool; -messages.sendMessage#1cc20387 flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true peer:InputPeer reply_to_msg_id:flags.0?int top_msg_id:flags.9?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates; -messages.sendMedia#7547c966 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true peer:InputPeer reply_to_msg_id:flags.0?int top_msg_id:flags.9?int media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates; -messages.forwardMessages#c661bbc4 flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true drop_author:flags.11?true drop_media_captions:flags.12?true noforwards:flags.14?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer top_msg_id:flags.9?int schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates; +messages.sendMessage#983f9745 flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true peer:InputPeer reply_to:flags.0?InputReplyTo message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long = Updates; +messages.sendMedia#7852834e flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true peer:InputPeer reply_to:flags.0?InputReplyTo media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long = Updates; +messages.forwardMessages#d5039208 flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true drop_author:flags.11?true drop_media_captions:flags.12?true noforwards:flags.14?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer top_msg_id:flags.9?int schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut = Updates; messages.reportSpam#cf1592db peer:InputPeer = Bool; messages.getPeerSettings#efd9a6a2 peer:InputPeer = messages.PeerSettings; messages.report#8953ab4e peer:InputPeer id:Vector<int> reason:ReportReason message:string = Bool; @@ -1702,9 +2083,9 @@ messages.getChats#49e9528f id:Vector<long> = messages.Chats; messages.getFullChat#aeb00b34 chat_id:long = messages.ChatFull; messages.editChatTitle#73783ffd chat_id:long title:string = Updates; messages.editChatPhoto#35ddd674 chat_id:long photo:InputChatPhoto = Updates; -messages.addChatUser#f24753e3 chat_id:long user_id:InputUser fwd_limit:int = Updates; +messages.addChatUser#cbc6d107 chat_id:long user_id:InputUser fwd_limit:int = messages.InvitedUsers; messages.deleteChatUser#a2185cab flags:# revoke_history:flags.0?true chat_id:long user_id:InputUser = Updates; -messages.createChat#34a818 flags:# users:Vector<InputUser> title:string ttl_period:flags.0?int = Updates; +messages.createChat#92ceddd4 flags:# users:Vector<InputUser> title:string ttl_period:flags.0?int = messages.InvitedUsers; messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig; messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat; messages.acceptEncryption#3dbc0415 peer:InputEncryptedChat g_b:bytes key_fingerprint:long = EncryptedChat; @@ -1720,7 +2101,7 @@ messages.readMessageContents#36a73f77 id:Vector<int> = messages.AffectedMessages messages.getStickers#d5a5d3a1 emoticon:string hash:long = messages.Stickers; messages.getAllStickers#b8a0a1a8 hash:long = messages.AllStickers; messages.getWebPagePreview#8b68b0cc flags:# message:string entities:flags.3?Vector<MessageEntity> = MessageMedia; -messages.exportChatInvite#a02ce5d5 flags:# legacy_revoke_permanent:flags.2?true request_needed:flags.3?true peer:InputPeer expire_date:flags.0?int usage_limit:flags.1?int title:flags.4?string = ExportedChatInvite; +messages.exportChatInvite#a455de90 flags:# legacy_revoke_permanent:flags.2?true request_needed:flags.3?true peer:InputPeer expire_date:flags.0?int usage_limit:flags.1?int title:flags.4?string subscription_pricing:flags.5?StarsSubscriptionPricing = ExportedChatInvite; messages.checkChatInvite#3eadb1bb hash:string = ChatInvite; messages.importChatInvite#6c50051c hash:string = Updates; messages.getStickerSet#c8a0ec74 stickerset:InputStickerSet hash:int = messages.StickerSet; @@ -1730,21 +2111,21 @@ messages.startBot#e6df7378 bot:InputUser peer:InputPeer random_id:long start_par messages.getMessagesViews#5784d3e1 peer:InputPeer id:Vector<int> increment:Bool = messages.MessageViews; messages.editChatAdmin#a85bd1c2 chat_id:long user_id:InputUser is_admin:Bool = Bool; messages.migrateChat#a2875319 chat_id:long = Updates; -messages.searchGlobal#4bc6589a flags:# folder_id:flags.0?int q:string filter:MessagesFilter min_date:int max_date:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages; +messages.searchGlobal#4bc6589a flags:# broadcasts_only:flags.1?true folder_id:flags.0?int q:string filter:MessagesFilter min_date:int max_date:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages; messages.reorderStickerSets#78337739 flags:# masks:flags.0?true emojis:flags.1?true order:Vector<long> = Bool; messages.getDocumentByHash#b1f2061f sha256:bytes size:long mime_type:string = Document; messages.getSavedGifs#5cf09635 hash:long = messages.SavedGifs; messages.saveGif#327a30cb id:InputDocument unsave:Bool = Bool; messages.getInlineBotResults#514e999d flags:# bot:InputUser peer:InputPeer geo_point:flags.0?InputGeoPoint query:string offset:string = messages.BotResults; messages.setInlineBotResults#bb12a419 flags:# gallery:flags.0?true private:flags.1?true query_id:long results:Vector<InputBotInlineResult> cache_time:int next_offset:flags.2?string switch_pm:flags.3?InlineBotSwitchPM switch_webview:flags.4?InlineBotWebView = Bool; -messages.sendInlineBotResult#d3fbdccb flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to_msg_id:flags.0?int top_msg_id:flags.9?int random_id:long query_id:long id:string schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates; +messages.sendInlineBotResult#3ebee86a flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to:flags.0?InputReplyTo random_id:long query_id:long id:string schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut = Updates; messages.getMessageEditData#fda68d36 peer:InputPeer id:int = messages.MessageEditData; -messages.editMessage#48f71778 flags:# no_webpage:flags.1?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.15?int = Updates; -messages.editInlineBotMessage#83557dba flags:# no_webpage:flags.1?true id:InputBotInlineMessageID message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> = Bool; +messages.editMessage#dfd14005 flags:# no_webpage:flags.1?true invert_media:flags.16?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.15?int quick_reply_shortcut_id:flags.17?int = Updates; +messages.editInlineBotMessage#83557dba flags:# no_webpage:flags.1?true invert_media:flags.16?true id:InputBotInlineMessageID message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> = Bool; messages.getBotCallbackAnswer#9342ca07 flags:# game:flags.1?true peer:InputPeer msg_id:int data:flags.0?bytes password:flags.2?InputCheckPasswordSRP = messages.BotCallbackAnswer; messages.setBotCallbackAnswer#d58f130a flags:# alert:flags.1?true query_id:long message:flags.0?string url:flags.2?string cache_time:int = Bool; messages.getPeerDialogs#e470bcfd peers:Vector<InputDialogPeer> = messages.PeerDialogs; -messages.saveDraft#b4331e3f flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int top_msg_id:flags.2?int peer:InputPeer message:string entities:flags.3?Vector<MessageEntity> = Bool; +messages.saveDraft#d372c5ce flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo peer:InputPeer message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia effect:flags.7?long = Bool; messages.getAllDrafts#6a3f8d65 = Updates; messages.getFeaturedStickers#64780b14 hash:long = messages.FeaturedStickers; messages.readFeaturedStickers#5b118126 id:Vector<long> = Bool; @@ -1759,21 +2140,20 @@ messages.setInlineGameScore#15ad9f64 flags:# edit_message:flags.0?true force:fla messages.getGameHighScores#e822649d peer:InputPeer id:int user_id:InputUser = messages.HighScores; messages.getInlineGameHighScores#f635e1b id:InputBotInlineMessageID user_id:InputUser = messages.HighScores; messages.getCommonChats#e40ca104 user_id:InputUser max_id:long limit:int = messages.Chats; -messages.getAllChats#875f74be except_ids:Vector<long> = messages.Chats; -messages.getWebPage#32ca8f91 url:string hash:int = WebPage; +messages.getWebPage#8d9692a3 url:string hash:int = messages.WebPage; messages.toggleDialogPin#a731e257 flags:# pinned:flags.0?true peer:InputDialogPeer = Bool; messages.reorderPinnedDialogs#3b1adf37 flags:# force:flags.0?true folder_id:int order:Vector<InputDialogPeer> = Bool; messages.getPinnedDialogs#d6b94df2 folder_id:int = messages.PeerDialogs; messages.setBotShippingResults#e5f672fa flags:# query_id:long error:flags.0?string shipping_options:flags.1?Vector<ShippingOption> = Bool; messages.setBotPrecheckoutResults#9c2dd95 flags:# success:flags.1?true query_id:long error:flags.0?string = Bool; -messages.uploadMedia#519bc2b1 peer:InputPeer media:InputMedia = MessageMedia; -messages.sendScreenshotNotification#c97df020 peer:InputPeer reply_to_msg_id:int random_id:long = Updates; +messages.uploadMedia#14967978 flags:# business_connection_id:flags.0?string peer:InputPeer media:InputMedia = MessageMedia; +messages.sendScreenshotNotification#a1405817 peer:InputPeer reply_to:InputReplyTo random_id:long = Updates; messages.getFavedStickers#4f1aaa9 hash:long = messages.FavedStickers; messages.faveSticker#b9ffc55b id:InputDocument unfave:Bool = Bool; messages.getUnreadMentions#f107e790 flags:# peer:InputPeer top_msg_id:flags.0?int offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages; messages.readMentions#36e5bf4d flags:# peer:InputPeer top_msg_id:flags.0?int = messages.AffectedHistory; messages.getRecentLocations#702a40e0 peer:InputPeer limit:int hash:long = messages.Messages; -messages.sendMultiMedia#b6f11a1c flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true peer:InputPeer reply_to_msg_id:flags.0?int top_msg_id:flags.9?int multi_media:Vector<InputSingleMedia> schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates; +messages.sendMultiMedia#37b74355 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true peer:InputPeer reply_to:flags.0?InputReplyTo multi_media:Vector<InputSingleMedia> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long = Updates; messages.uploadEncryptedFile#5057c497 peer:InputEncryptedChat file:InputEncryptedFile = EncryptedFile; messages.searchStickerSets#35705b8a flags:# exclude_featured:flags.0?true q:string hash:long = messages.FoundStickerSets; messages.getSplitRanges#1cff7e08 = Vector<MessageRange>; @@ -1790,7 +2170,7 @@ messages.getEmojiKeywords#35a0e062 lang_code:string = EmojiKeywordsDifference; messages.getEmojiKeywordsDifference#1508b6af lang_code:string from_version:int = EmojiKeywordsDifference; messages.getEmojiKeywordsLanguages#4e9963b2 lang_codes:Vector<string> = Vector<EmojiLanguage>; messages.getEmojiURL#d5b10c26 lang_code:string = EmojiURL; -messages.getSearchCounters#ae7cc1 flags:# peer:InputPeer top_msg_id:flags.0?int filters:Vector<MessagesFilter> = Vector<messages.SearchCounter>; +messages.getSearchCounters#1bbcf300 flags:# peer:InputPeer saved_peer_id:flags.2?InputPeer top_msg_id:flags.0?int filters:Vector<MessagesFilter> = Vector<messages.SearchCounter>; messages.requestUrlAuth#198fb446 flags:# peer:flags.1?InputPeer msg_id:flags.1?int button_id:flags.1?int url:flags.2?string = UrlAuthResult; messages.acceptUrlAuth#b12c7125 flags:# write_allowed:flags.0?true peer:flags.1?InputPeer msg_id:flags.1?int button_id:flags.1?int url:flags.2?string = UrlAuthResult; messages.hidePeerSettingsBar#4facb138 peer:InputPeer = Bool; @@ -1800,7 +2180,7 @@ messages.sendScheduledMessages#bd38850a peer:InputPeer id:Vector<int> = Updates; messages.deleteScheduledMessages#59ae2b16 peer:InputPeer id:Vector<int> = Updates; messages.getPollVotes#b86e380e flags:# peer:InputPeer id:int option:flags.0?bytes offset:flags.1?string limit:int = messages.VotesList; messages.toggleStickerSets#b5052fea flags:# uninstall:flags.0?true archive:flags.1?true unarchive:flags.2?true stickersets:Vector<InputStickerSet> = Bool; -messages.getDialogFilters#f19ed96d = Vector<DialogFilter>; +messages.getDialogFilters#efd48c89 = messages.DialogFilters; messages.getSuggestedDialogFilters#a29cd42c = Vector<DialogFilterSuggested>; messages.updateDialogFilter#1ad4a04a flags:# id:int filter:flags.0?DialogFilter = Bool; messages.updateDialogFiltersOrder#c563c1e4 order:Vector<int> = Bool; @@ -1821,13 +2201,13 @@ messages.editExportedChatInvite#bdca2f75 flags:# revoked:flags.2?true peer:Input messages.deleteRevokedExportedChatInvites#56987bd5 peer:InputPeer admin_id:InputUser = Bool; messages.deleteExportedChatInvite#d464a42b peer:InputPeer link:string = Bool; messages.getAdminsWithInvites#3920e6ef peer:InputPeer = messages.ChatAdminsWithInvites; -messages.getChatInviteImporters#df04dd4e flags:# requested:flags.0?true peer:InputPeer link:flags.1?string q:flags.2?string offset_date:int offset_user:InputUser limit:int = messages.ChatInviteImporters; +messages.getChatInviteImporters#df04dd4e flags:# requested:flags.0?true subscription_expired:flags.3?true peer:InputPeer link:flags.1?string q:flags.2?string offset_date:int offset_user:InputUser limit:int = messages.ChatInviteImporters; messages.setHistoryTTL#b80e5fe4 peer:InputPeer period:int = Updates; messages.checkHistoryImportPeer#5dc60f03 peer:InputPeer = messages.CheckedHistoryImportPeer; messages.setChatTheme#e63be13f peer:InputPeer emoticon:string = Updates; messages.getMessageReadParticipants#31c1c44f peer:InputPeer msg_id:int = Vector<ReadParticipantDate>; -messages.getSearchResultsCalendar#49f0bde9 peer:InputPeer filter:MessagesFilter offset_id:int offset_date:int = messages.SearchResultsCalendar; -messages.getSearchResultsPositions#6e9583a3 peer:InputPeer filter:MessagesFilter offset_id:int limit:int = messages.SearchResultsPositions; +messages.getSearchResultsCalendar#6aa3f6bd flags:# peer:InputPeer saved_peer_id:flags.2?InputPeer filter:MessagesFilter offset_id:int offset_date:int = messages.SearchResultsCalendar; +messages.getSearchResultsPositions#9c7f2f10 flags:# peer:InputPeer saved_peer_id:flags.2?InputPeer filter:MessagesFilter offset_id:int limit:int = messages.SearchResultsPositions; messages.hideChatJoinRequest#7fe7e815 flags:# approved:flags.0?true peer:InputPeer user_id:InputUser = Updates; messages.hideAllChatJoinRequests#e085f4ea flags:# approved:flags.0?true peer:InputPeer link:flags.1?string = Updates; messages.toggleNoForwards#b11eafa2 peer:InputPeer enabled:Bool = Updates; @@ -1835,7 +2215,7 @@ messages.saveDefaultSendAs#ccfddf96 peer:InputPeer send_as:InputPeer = Bool; messages.sendReaction#d30d78d4 flags:# big:flags.1?true add_to_recent:flags.2?true peer:InputPeer msg_id:int reaction:flags.0?Vector<Reaction> = Updates; messages.getMessagesReactions#8bba90e6 peer:InputPeer id:Vector<int> = Updates; messages.getMessageReactionsList#461b3f48 flags:# peer:InputPeer id:int reaction:flags.0?Reaction offset:flags.1?string limit:int = messages.MessageReactionsList; -messages.setChatAvailableReactions#feb16771 peer:InputPeer available_reactions:ChatReactions = Updates; +messages.setChatAvailableReactions#864b2581 flags:# peer:InputPeer available_reactions:ChatReactions reactions_limit:flags.0?int paid_enabled:flags.1?Bool = Updates; messages.getAvailableReactions#18dea0ac hash:int = messages.AvailableReactions; messages.setDefaultReaction#4f47a016 reaction:Reaction = Bool; messages.translateText#63183030 flags:# peer:flags.0?InputPeer id:flags.0?Vector<int> text:flags.1?Vector<TextWithEntities> to_lang:string = messages.TranslatedText; @@ -1845,9 +2225,9 @@ messages.searchSentMedia#107e31a0 q:string filter:MessagesFilter limit:int = mes messages.getAttachMenuBots#16fcc2cb hash:long = AttachMenuBots; messages.getAttachMenuBot#77216192 bot:InputUser = AttachMenuBotsBot; messages.toggleBotInAttachMenu#69f59d69 flags:# write_allowed:flags.0?true bot:InputUser enabled:Bool = Bool; -messages.requestWebView#178b480b flags:# from_bot_menu:flags.4?true silent:flags.5?true peer:InputPeer bot:InputUser url:flags.1?string start_param:flags.3?string theme_params:flags.2?DataJSON platform:string reply_to_msg_id:flags.0?int top_msg_id:flags.9?int send_as:flags.13?InputPeer = WebViewResult; -messages.prolongWebView#7ff34309 flags:# silent:flags.5?true peer:InputPeer bot:InputUser query_id:long reply_to_msg_id:flags.0?int top_msg_id:flags.9?int send_as:flags.13?InputPeer = Bool; -messages.requestSimpleWebView#299bec8e flags:# from_switch_webview:flags.1?true bot:InputUser url:string theme_params:flags.0?DataJSON platform:string = SimpleWebViewResult; +messages.requestWebView#269dc2c1 flags:# from_bot_menu:flags.4?true silent:flags.5?true compact:flags.7?true peer:InputPeer bot:InputUser url:flags.1?string start_param:flags.3?string theme_params:flags.2?DataJSON platform:string reply_to:flags.0?InputReplyTo send_as:flags.13?InputPeer = WebViewResult; +messages.prolongWebView#b0d81a83 flags:# silent:flags.5?true peer:InputPeer bot:InputUser query_id:long reply_to:flags.0?InputReplyTo send_as:flags.13?InputPeer = Bool; +messages.requestSimpleWebView#413a3e73 flags:# from_switch_webview:flags.1?true from_side_menu:flags.2?true compact:flags.7?true bot:InputUser url:flags.3?string start_param:flags.4?string theme_params:flags.0?DataJSON platform:string = WebViewResult; messages.sendWebViewResultMessage#a4314f5 bot_query_id:string result:InputBotInlineResult = WebViewMessageSent; messages.sendWebViewData#dc0242c8 bot:InputUser random_id:long button_text:string data:string = Updates; messages.transcribeAudio#269e9a49 peer:InputPeer msg_id:int = messages.TranscribedAudio; @@ -1862,18 +2242,48 @@ messages.clearRecentReactions#9dfeefb4 = Bool; messages.getExtendedMedia#84f80814 peer:InputPeer id:Vector<int> = Updates; messages.setDefaultHistoryTTL#9eb51445 period:int = Bool; messages.getDefaultHistoryTTL#658b7188 = DefaultHistoryTTL; -messages.sendBotRequestedPeer#fe38d01b peer:InputPeer msg_id:int button_id:int requested_peer:InputPeer = Updates; +messages.sendBotRequestedPeer#91b2d060 peer:InputPeer msg_id:int button_id:int requested_peers:Vector<InputPeer> = Updates; messages.getEmojiGroups#7488ce5b hash:int = messages.EmojiGroups; messages.getEmojiStatusGroups#2ecd56cd hash:int = messages.EmojiGroups; messages.getEmojiProfilePhotoGroups#21a548f3 hash:int = messages.EmojiGroups; messages.searchCustomEmoji#2c11c0d7 emoticon:string hash:long = EmojiList; messages.togglePeerTranslations#e47cb579 flags:# disabled:flags.0?true peer:InputPeer = Bool; messages.getBotApp#34fdc5c3 app:InputBotApp hash:long = messages.BotApp; -messages.requestAppWebView#8c5a3b3c flags:# write_allowed:flags.0?true peer:InputPeer app:InputBotApp start_param:flags.1?string theme_params:flags.2?DataJSON platform:string = AppWebViewResult; -messages.setChatWallPaper#8ffacae1 flags:# peer:InputPeer wallpaper:flags.0?InputWallPaper settings:flags.2?WallPaperSettings id:flags.1?int = Updates; +messages.requestAppWebView#53618bce flags:# write_allowed:flags.0?true compact:flags.7?true peer:InputPeer app:InputBotApp start_param:flags.1?string theme_params:flags.2?DataJSON platform:string = WebViewResult; +messages.setChatWallPaper#8ffacae1 flags:# for_both:flags.3?true revert:flags.4?true peer:InputPeer wallpaper:flags.0?InputWallPaper settings:flags.2?WallPaperSettings id:flags.1?int = Updates; +messages.searchEmojiStickerSets#92b4494c flags:# exclude_featured:flags.0?true q:string hash:long = messages.FoundStickerSets; +messages.getSavedDialogs#5381d21a flags:# exclude_pinned:flags.0?true offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:long = messages.SavedDialogs; +messages.getSavedHistory#3d9a414d peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages; +messages.deleteSavedHistory#6e98102b flags:# peer:InputPeer max_id:int min_date:flags.2?int max_date:flags.3?int = messages.AffectedHistory; +messages.getPinnedSavedDialogs#d63d94e0 = messages.SavedDialogs; +messages.toggleSavedDialogPin#ac81bbde flags:# pinned:flags.0?true peer:InputDialogPeer = Bool; +messages.reorderPinnedSavedDialogs#8b716587 flags:# force:flags.0?true order:Vector<InputDialogPeer> = Bool; +messages.getSavedReactionTags#3637e05b flags:# peer:flags.0?InputPeer hash:long = messages.SavedReactionTags; +messages.updateSavedReactionTag#60297dec flags:# reaction:Reaction title:flags.0?string = Bool; +messages.getDefaultTagReactions#bdf93428 hash:long = messages.Reactions; +messages.getOutboxReadDate#8c4bfe5d peer:InputPeer msg_id:int = OutboxReadDate; +messages.getQuickReplies#d483f2a8 hash:long = messages.QuickReplies; +messages.reorderQuickReplies#60331907 order:Vector<int> = Bool; +messages.checkQuickReplyShortcut#f1d0fbd3 shortcut:string = Bool; +messages.editQuickReplyShortcut#5c003cef shortcut_id:int shortcut:string = Bool; +messages.deleteQuickReplyShortcut#3cc04740 shortcut_id:int = Bool; +messages.getQuickReplyMessages#94a495c3 flags:# shortcut_id:int id:flags.0?Vector<int> hash:long = messages.Messages; +messages.sendQuickReplyMessages#6c750de1 peer:InputPeer shortcut_id:int id:Vector<int> random_id:Vector<long> = Updates; +messages.deleteQuickReplyMessages#e105e910 shortcut_id:int id:Vector<int> = Updates; +messages.toggleDialogFilterTags#fd2dda49 enabled:Bool = Bool; +messages.getMyStickers#d0b5e1fc offset_id:long limit:int = messages.MyStickers; +messages.getEmojiStickerGroups#1dd840f5 hash:int = messages.EmojiGroups; +messages.getAvailableEffects#dea20a39 hash:int = messages.AvailableEffects; +messages.editFactCheck#589ee75 peer:InputPeer msg_id:int text:TextWithEntities = Updates; +messages.deleteFactCheck#d1da940c peer:InputPeer msg_id:int = Updates; +messages.getFactCheck#b9cdc5ee peer:InputPeer msg_id:Vector<int> = Vector<FactCheck>; +messages.requestMainWebView#c9e01e7b flags:# compact:flags.7?true peer:InputPeer bot:InputUser start_param:flags.1?string theme_params:flags.0?DataJSON platform:string = WebViewResult; +messages.sendPaidReaction#9dd6a67b flags:# peer:InputPeer msg_id:int count:int random_id:long private:flags.0?Bool = Updates; +messages.togglePaidReactionPrivacy#849ad397 peer:InputPeer msg_id:int private:Bool = Bool; +messages.getPaidReactionPrivacy#472455aa = Updates; updates.getState#edd4882a = updates.State; -updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference; +updates.getDifference#19c2f763 flags:# pts:int pts_limit:flags.1?int pts_total_limit:flags.0?int date:int qts:int qts_limit:flags.2?int = updates.Difference; updates.getChannelDifference#3173d78 flags:# force:flags.0?true channel:InputChannel filter:ChannelMessagesFilter pts:int limit:int = updates.ChannelDifference; photos.updateProfilePhoto#9e82039 flags:# fallback:flags.0?true bot:flags.1?InputUser id:InputPhoto = photos.Photo; @@ -1896,7 +2306,6 @@ help.getNearestDc#1fb33026 = NearestDc; help.getAppUpdate#522d5a7d source:string = help.AppUpdate; help.getInviteText#4d392343 = help.InviteText; help.getSupport#9cdf08cd = help.Support; -help.getAppChangelog#9010ef6f prev_app_version:string = Updates; help.setBotUpdatesStatus#ec22cfcd pending_updates_count:int message:string = Bool; help.getCdnConfig#52029342 = CdnConfig; help.getRecentMeUrls#3dc0f114 referer:string = help.RecentMeUrls; @@ -1914,6 +2323,9 @@ help.hidePromoData#1e251c95 peer:InputPeer = Bool; help.dismissSuggestion#f50dbaa1 peer:InputPeer suggestion:string = Bool; help.getCountriesList#735787a8 lang_code:string hash:int = help.CountriesList; help.getPremiumPromo#b81b93d4 = help.PremiumPromo; +help.getPeerColors#da80f42f hash:int = help.PeerColors; +help.getPeerProfileColors#abcfa9fd hash:int = help.PeerColors; +help.getTimezonesList#49b30240 hash:int = help.TimezonesList; channels.readHistory#cc104937 channel:InputChannel max_id:int = Bool; channels.deleteMessages#84c1fd4e channel:InputChannel id:Vector<int> = messages.AffectedMessages; @@ -1931,11 +2343,11 @@ channels.checkUsername#10e6bd2c channel:InputChannel username:string = Bool; channels.updateUsername#3514b3de channel:InputChannel username:string = Bool; channels.joinChannel#24b524c5 channel:InputChannel = Updates; channels.leaveChannel#f836aa95 channel:InputChannel = Updates; -channels.inviteToChannel#199f3a6c channel:InputChannel users:Vector<InputUser> = Updates; +channels.inviteToChannel#c9e33d54 channel:InputChannel users:Vector<InputUser> = messages.InvitedUsers; channels.deleteChannel#c0111fe3 channel:InputChannel = Updates; channels.exportMessageLink#e63fadeb flags:# grouped:flags.0?true thread:flags.1?true channel:InputChannel id:int = ExportedMessageLink; -channels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates; -channels.getAdminedPublicChannels#f8b036af flags:# by_location:flags.0?true check_limit:flags.1?true = messages.Chats; +channels.toggleSignatures#418d549c flags:# signatures_enabled:flags.0?true profiles_enabled:flags.1?true channel:InputChannel = Updates; +channels.getAdminedPublicChannels#f8b036af flags:# by_location:flags.0?true check_limit:flags.1?true for_personal:flags.2?true = messages.Chats; channels.editBanned#96e6cd81 channel:InputChannel participant:InputPeer banned_rights:ChatBannedRights = Updates; channels.getAdminLog#33ddf480 flags:# channel:InputChannel q:string events_filter:flags.0?ChannelAdminLogEventsFilter admins:flags.1?Vector<InputUser> max_id:long min_id:long limit:int = channels.AdminLogResults; channels.setStickers#ea8ca4f9 channel:InputChannel stickerset:InputStickerSet = Bool; @@ -1970,6 +2382,16 @@ channels.reorderPinnedForumTopics#2950a18f flags:# force:flags.0?true channel:In channels.toggleAntiSpam#68f3e4eb channel:InputChannel enabled:Bool = Updates; channels.reportAntiSpamFalsePositive#a850a693 channel:InputChannel msg_id:int = Bool; channels.toggleParticipantsHidden#6a6e7854 channel:InputChannel enabled:Bool = Updates; +channels.clickSponsoredMessage#18afbc93 channel:InputChannel random_id:bytes = Bool; +channels.updateColor#d8aa3671 flags:# for_profile:flags.1?true channel:InputChannel color:flags.2?int background_emoji_id:flags.0?long = Updates; +channels.toggleViewForumAsMessages#9738bb15 channel:InputChannel enabled:Bool = Updates; +channels.getChannelRecommendations#25a71742 flags:# channel:flags.0?InputChannel = messages.Chats; +channels.updateEmojiStatus#f0d3e6a8 channel:InputChannel emoji_status:EmojiStatus = Updates; +channels.setBoostsToUnblockRestrictions#ad399cee channel:InputChannel boosts:int = Updates; +channels.setEmojiStickers#3cd930b7 channel:InputChannel stickerset:InputStickerSet = Bool; +channels.reportSponsoredMessage#af8ff6b9 channel:InputChannel random_id:bytes option:bytes = channels.SponsoredMessageReportResult; +channels.restrictSponsoredMessages#9ae91519 channel:InputChannel restricted:Bool = Updates; +channels.searchPosts#d19f987b hashtag:string offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages; bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON; bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool; @@ -1984,6 +2406,16 @@ bots.setBotInfo#10cf3123 flags:# bot:flags.2?InputUser lang_code:string name:fla bots.getBotInfo#dcd914fd flags:# bot:flags.0?InputUser lang_code:string = bots.BotInfo; bots.reorderUsernames#9709b1c2 bot:InputUser order:Vector<string> = Bool; bots.toggleUsername#53ca973 bot:InputUser username:string active:Bool = Bool; +bots.canSendMessage#1359f4e6 bot:InputUser = Bool; +bots.allowSendMessage#f132e3ef bot:InputUser = Updates; +bots.invokeWebViewCustomMethod#87fc5e7 bot:InputUser custom_method:string params:DataJSON = DataJSON; +bots.getPopularAppBots#c2510192 offset:string limit:int = bots.PopularAppBots; +bots.addPreviewMedia#17aeb75a bot:InputUser lang_code:string media:InputMedia = BotPreviewMedia; +bots.editPreviewMedia#8525606f bot:InputUser lang_code:string media:InputMedia new_media:InputMedia = BotPreviewMedia; +bots.deletePreviewMedia#2d0135b3 bot:InputUser lang_code:string media:Vector<InputMedia> = Bool; +bots.reorderPreviewMedias#b627f3aa bot:InputUser lang_code:string order:Vector<InputMedia> = Bool; +bots.getPreviewInfo#423ab3ad bot:InputUser lang_code:string = bots.PreviewInfo; +bots.getPreviewMedias#a2a5594d bot:InputUser = Vector<BotPreviewMedia>; payments.getPaymentForm#37148dbb flags:# invoice:InputInvoice theme_params:flags.0?DataJSON = payments.PaymentForm; payments.getPaymentReceipt#2478d1cc peer:InputPeer msg_id:int = payments.PaymentReceipt; @@ -1996,8 +2428,27 @@ payments.exportInvoice#f91b065 invoice_media:InputMedia = payments.ExportedInvoi payments.assignAppStoreTransaction#80ed747d receipt:bytes purpose:InputStorePaymentPurpose = Updates; payments.assignPlayMarketTransaction#dffd50d3 receipt:DataJSON purpose:InputStorePaymentPurpose = Updates; payments.canPurchasePremium#9fc19eb6 purpose:InputStorePaymentPurpose = Bool; - -stickers.createStickerSet#9021ab67 flags:# masks:flags.0?true animated:flags.1?true videos:flags.4?true emojis:flags.5?true text_color:flags.6?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector<InputStickerSetItem> software:flags.3?string = messages.StickerSet; +payments.getPremiumGiftCodeOptions#2757ba54 flags:# boost_peer:flags.0?InputPeer = Vector<PremiumGiftCodeOption>; +payments.checkGiftCode#8e51b4c1 slug:string = payments.CheckedGiftCode; +payments.applyGiftCode#f6e26854 slug:string = Updates; +payments.getGiveawayInfo#f4239425 peer:InputPeer msg_id:int = payments.GiveawayInfo; +payments.launchPrepaidGiveaway#5ff58f20 peer:InputPeer giveaway_id:long purpose:InputStorePaymentPurpose = Updates; +payments.getStarsTopupOptions#c00ec7d3 = Vector<StarsTopupOption>; +payments.getStarsStatus#104fcfa7 peer:InputPeer = payments.StarsStatus; +payments.getStarsTransactions#69da4557 flags:# inbound:flags.0?true outbound:flags.1?true ascending:flags.2?true subscription_id:flags.3?string peer:InputPeer offset:string limit:int = payments.StarsStatus; +payments.sendStarsForm#2bb731d flags:# form_id:long invoice:InputInvoice = payments.PaymentResult; +payments.refundStarsCharge#25ae8f4a user_id:InputUser charge_id:string = Updates; +payments.getStarsRevenueStats#d91ffad6 flags:# dark:flags.0?true peer:InputPeer = payments.StarsRevenueStats; +payments.getStarsRevenueWithdrawalUrl#13bbe8b3 peer:InputPeer stars:long password:InputCheckPasswordSRP = payments.StarsRevenueWithdrawalUrl; +payments.getStarsRevenueAdsAccountUrl#d1d7efc5 peer:InputPeer = payments.StarsRevenueAdsAccountUrl; +payments.getStarsTransactionsByID#27842d2e peer:InputPeer id:Vector<InputStarsTransaction> = payments.StarsStatus; +payments.getStarsGiftOptions#d3c96bc8 flags:# user_id:flags.0?InputUser = Vector<StarsGiftOption>; +payments.getStarsSubscriptions#32512c5 flags:# missing_balance:flags.0?true peer:InputPeer offset:string = payments.StarsStatus; +payments.changeStarsSubscription#c7770878 flags:# peer:InputPeer subscription_id:string canceled:flags.0?Bool = Bool; +payments.fulfillStarsSubscription#cc5bebb3 peer:InputPeer subscription_id:string = Bool; +payments.getStarsGiveawayOptions#bd1efd3e = Vector<StarsGiveawayOption>; + +stickers.createStickerSet#9021ab67 flags:# masks:flags.0?true emojis:flags.5?true text_color:flags.6?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector<InputStickerSetItem> software:flags.3?string = messages.StickerSet; stickers.removeStickerFromSet#f7760f51 sticker:InputDocument = messages.StickerSet; stickers.changeStickerPosition#ffb6d4ca sticker:InputDocument position:int = messages.StickerSet; stickers.addStickerToSet#8653febe stickerset:InputStickerSet sticker:InputStickerSetItem = messages.StickerSet; @@ -2007,6 +2458,7 @@ stickers.suggestShortName#4dafc503 title:string = stickers.SuggestedShortName; stickers.changeSticker#f5537ebc flags:# sticker:InputDocument emoji:flags.0?string mask_coords:flags.1?MaskCoords keywords:flags.2?string = messages.StickerSet; stickers.renameStickerSet#124b1c00 stickerset:InputStickerSet title:string = messages.StickerSet; stickers.deleteStickerSet#87704394 stickerset:InputStickerSet = Bool; +stickers.replaceSticker#4696459a sticker:InputDocument new_sticker:InputStickerSetItem = messages.StickerSet; phone.getCallConfig#55451fa9 = DataJSON; phone.requestCall#42ff96ed flags:# video:flags.0?true user_id:InputUser random_id:int g_a_hash:bytes protocol:PhoneCallProtocol = phone.PhoneCall; @@ -2051,8 +2503,13 @@ folders.editPeerFolders#6847d0ab folder_peers:Vector<InputFolderPeer> = Updates; stats.getBroadcastStats#ab42441a flags:# dark:flags.0?true channel:InputChannel = stats.BroadcastStats; stats.loadAsyncGraph#621d5fa0 flags:# token:string x:flags.0?long = StatsGraph; stats.getMegagroupStats#dcdf8607 flags:# dark:flags.0?true channel:InputChannel = stats.MegagroupStats; -stats.getMessagePublicForwards#5630281b channel:InputChannel msg_id:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages; +stats.getMessagePublicForwards#5f150144 channel:InputChannel msg_id:int offset:string limit:int = stats.PublicForwards; stats.getMessageStats#b6e0a3f5 flags:# dark:flags.0?true channel:InputChannel msg_id:int = stats.MessageStats; +stats.getStoryStats#374fef40 flags:# dark:flags.0?true peer:InputPeer id:int = stats.StoryStats; +stats.getStoryPublicForwards#a6437ef6 peer:InputPeer id:int offset:string limit:int = stats.PublicForwards; +stats.getBroadcastRevenueStats#75dfb671 flags:# dark:flags.0?true channel:InputChannel = stats.BroadcastRevenueStats; +stats.getBroadcastRevenueWithdrawalUrl#2a65ef73 channel:InputChannel password:InputCheckPasswordSRP = stats.BroadcastRevenueWithdrawalUrl; +stats.getBroadcastRevenueTransactions#69280f channel:InputChannel offset:int limit:int = stats.BroadcastRevenueTransactions; chatlists.exportChatlistInvite#8472478e chatlist:InputChatlist title:string peers:Vector<InputPeer> = chatlists.ExportedChatlistInvite; chatlists.deleteExportedInvite#719c5c5e chatlist:InputChatlist slug:string = Bool; @@ -2065,3 +2522,46 @@ chatlists.joinChatlistUpdates#e089f8f5 chatlist:InputChatlist peers:Vector<Input chatlists.hideChatlistUpdates#66e486fb chatlist:InputChatlist = Bool; chatlists.getLeaveChatlistSuggestions#fdbcd714 chatlist:InputChatlist = Vector<Peer>; chatlists.leaveChatlist#74fae13a chatlist:InputChatlist peers:Vector<InputPeer> = Updates; + +stories.canSendStory#c7dfdfdd peer:InputPeer = Bool; +stories.sendStory#e4e6694b flags:# pinned:flags.2?true noforwards:flags.4?true fwd_modified:flags.7?true peer:InputPeer media:InputMedia media_areas:flags.5?Vector<MediaArea> caption:flags.0?string entities:flags.1?Vector<MessageEntity> privacy_rules:Vector<InputPrivacyRule> random_id:long period:flags.3?int fwd_from_id:flags.6?InputPeer fwd_from_story:flags.6?int = Updates; +stories.editStory#b583ba46 flags:# peer:InputPeer id:int media:flags.0?InputMedia media_areas:flags.3?Vector<MediaArea> caption:flags.1?string entities:flags.1?Vector<MessageEntity> privacy_rules:flags.2?Vector<InputPrivacyRule> = Updates; +stories.deleteStories#ae59db5f peer:InputPeer id:Vector<int> = Vector<int>; +stories.togglePinned#9a75a1ef peer:InputPeer id:Vector<int> pinned:Bool = Vector<int>; +stories.getAllStories#eeb0d625 flags:# next:flags.1?true hidden:flags.2?true state:flags.0?string = stories.AllStories; +stories.getPinnedStories#5821a5dc peer:InputPeer offset_id:int limit:int = stories.Stories; +stories.getStoriesArchive#b4352016 peer:InputPeer offset_id:int limit:int = stories.Stories; +stories.getStoriesByID#5774ca74 peer:InputPeer id:Vector<int> = stories.Stories; +stories.toggleAllStoriesHidden#7c2557c4 hidden:Bool = Bool; +stories.readStories#a556dac8 peer:InputPeer max_id:int = Vector<int>; +stories.incrementStoryViews#b2028afb peer:InputPeer id:Vector<int> = Bool; +stories.getStoryViewsList#7ed23c57 flags:# just_contacts:flags.0?true reactions_first:flags.2?true forwards_first:flags.3?true peer:InputPeer q:flags.1?string id:int offset:string limit:int = stories.StoryViewsList; +stories.getStoriesViews#28e16cc8 peer:InputPeer id:Vector<int> = stories.StoryViews; +stories.exportStoryLink#7b8def20 peer:InputPeer id:int = ExportedStoryLink; +stories.report#1923fa8c peer:InputPeer id:Vector<int> reason:ReportReason message:string = Bool; +stories.activateStealthMode#57bbd166 flags:# past:flags.0?true future:flags.1?true = Updates; +stories.sendReaction#7fd736b2 flags:# add_to_recent:flags.0?true peer:InputPeer story_id:int reaction:Reaction = Updates; +stories.getPeerStories#2c4ada50 peer:InputPeer = stories.PeerStories; +stories.getAllReadPeerStories#9b5ae7f9 = Updates; +stories.getPeerMaxIDs#535983c3 id:Vector<InputPeer> = Vector<int>; +stories.getChatsToSend#a56a8b60 = messages.Chats; +stories.togglePeerStoriesHidden#bd0415c4 peer:InputPeer hidden:Bool = Bool; +stories.getStoryReactionsList#b9b2881f flags:# forwards_first:flags.2?true peer:InputPeer id:int reaction:flags.0?Reaction offset:flags.1?string limit:int = stories.StoryReactionsList; +stories.togglePinnedToTop#b297e9b peer:InputPeer id:Vector<int> = Bool; +stories.searchPosts#6cea116a flags:# hashtag:flags.0?string area:flags.1?MediaArea offset:string limit:int = stories.FoundStories; + +premium.getBoostsList#60f67660 flags:# gifts:flags.0?true peer:InputPeer offset:string limit:int = premium.BoostsList; +premium.getMyBoosts#be77b4a = premium.MyBoosts; +premium.applyBoost#6b7da746 flags:# slots:flags.0?Vector<int> peer:InputPeer = premium.MyBoosts; +premium.getBoostsStatus#42f1f61 peer:InputPeer = premium.BoostsStatus; +premium.getUserBoosts#39854d1f peer:InputPeer user_id:InputUser = premium.BoostsList; + +smsjobs.isEligibleToJoin#edc39d0 = smsjobs.EligibilityToJoin; +smsjobs.join#a74ece2d = Bool; +smsjobs.leave#9898ad73 = Bool; +smsjobs.updateSettings#93fa0bf flags:# allow_international:flags.0?true = Bool; +smsjobs.getStatus#10a698e8 = smsjobs.Status; +smsjobs.getSmsJob#778d902f job_id:string = SmsJob; +smsjobs.finishJob#4f1ebf24 flags:# job_id:string error:flags.0?string = Bool; + +fragment.getCollectibleInfo#be1e85ba collectible:InputCollectible = fragment.CollectibleInfo; diff --git a/protocols/Telegram/tdlib/td/td/generate/tl-parser/CMakeLists.txt b/protocols/Telegram/tdlib/td/td/generate/tl-parser/CMakeLists.txt index 03e5a1631b..6cf5331f4b 100644 --- a/protocols/Telegram/tdlib/td/td/generate/tl-parser/CMakeLists.txt +++ b/protocols/Telegram/tdlib/td/td/generate/tl-parser/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.11) +cmake_minimum_required(VERSION 3.0 FATAL_ERROR) if (POLICY CMP0065) # do not export symbols from executables diff --git a/protocols/Telegram/tdlib/td/td/generate/tl_json_converter.cpp b/protocols/Telegram/tdlib/td/td/generate/tl_json_converter.cpp index 8512cb8443..bd5abc6d37 100644 --- a/protocols/Telegram/tdlib/td/td/generate/tl_json_converter.cpp +++ b/protocols/Telegram/tdlib/td/td/generate/tl_json_converter.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -103,8 +103,8 @@ void gen_from_json_constructor(StringBuilder &sb, const T *constructor, bool is_ sb << " {\n"; for (auto &arg : constructor->args) { sb << " TRY_STATUS(from_json" << (arg.type->type == tl::simple::Type::Bytes ? "_bytes" : "") << "(to." - << tl::simple::gen_cpp_field_name(arg.name) << ", get_json_object_field_force(from, \"" - << tl::simple::gen_cpp_name(arg.name) << "\")));\n"; + << tl::simple::gen_cpp_field_name(arg.name) << ", from.extract_field(\"" << tl::simple::gen_cpp_name(arg.name) + << "\")));\n"; } sb << " return Status::OK();\n"; sb << "}\n\n"; @@ -187,7 +187,6 @@ void gen_tl_constructor_from_string(StringBuilder &sb, const tl::simple::Schema void gen_json_converter_file(const tl::simple::Schema &schema, const std::string &file_name_base, bool is_header, Mode mode) { auto file_name = is_header ? file_name_base + ".h" : file_name_base + ".cpp"; - file_name = "auto/" + file_name; auto old_file_content = [&] { auto r_content = read_file(file_name); if (r_content.is_error()) { diff --git a/protocols/Telegram/tdlib/td/td/generate/tl_json_converter.h b/protocols/Telegram/tdlib/td/td/generate/tl_json_converter.h index 069eb2d99f..afde9528b5 100644 --- a/protocols/Telegram/tdlib/td/td/generate/tl_json_converter.h +++ b/protocols/Telegram/tdlib/td/td/generate/tl_json_converter.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/td/generate/tl_writer_c.h b/protocols/Telegram/tdlib/td/td/generate/tl_writer_c.h index 41bb38b5d5..b78313e55b 100644 --- a/protocols/Telegram/tdlib/td/td/generate/tl_writer_c.h +++ b/protocols/Telegram/tdlib/td/td/generate/tl_writer_c.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -17,11 +17,10 @@ namespace td { class TlWriterCCommon final : public tl::TL_writer { - public: int is_header_; - std::string prefix_; - TlWriterCCommon(const std::string &name, int is_header, const std::string &prefix = "") - : TL_writer(name), is_header_(is_header), prefix_(prefix) { + + public: + TlWriterCCommon(const std::string &name, int is_header) : TL_writer(name), is_header_(is_header) { } int get_max_arity() const final { @@ -223,13 +222,26 @@ class TlWriterCCommon final : public tl::TL_writer { std::string gen_type_name(const tl::tl_tree_type *tree_type) const final { return gen_type_name(tree_type, false); } - std::string gen_output_begin() const final { + std::string gen_output_begin(const std::string &additional_imports) const final { if (is_header_ == 1) { - return "#pragma once\n" + return "#pragma once\n\n" + additional_imports + "#ifdef __cplusplus\n" "extern \"C\" {\n" - "#endif\n" - "struct TdBytes {\n" + "#endif\n"; + } + if (is_header_ == -1) { + return "#pragma once\n\n" + gen_import_declaration("td/telegram/td_tdc_api.h", false) + + gen_import_declaration("td/telegram/td_api.h", false) + "\n" + additional_imports; + } + return gen_import_declaration("td/telegram/td_tdc_api_inner.h", false) + "\n" + + gen_import_declaration("td/utils/format.h", false) + gen_import_declaration("td/utils/logging.h", false) + + gen_import_declaration("td/utils/misc.h", false) + gen_import_declaration("td/utils/Slice.h", false) + "\n" + + additional_imports; + } + + std::string gen_output_begin_once() const final { + if (is_header_ == 1) { + return "struct TdBytes {\n" " unsigned char *data;\n" " int len;\n" "};\n" @@ -266,18 +278,9 @@ class TlWriterCCommon final : public tl::TL_writer { " int (*is_nil)(void);\n" "};\n"; } - if (is_header_ == -1) { - return "#pragma once\n" - "#include \"td/telegram/td_tdc_api.h\"\n" - "#include \"td/telegram/td_api.h\"\n"; - } - return "#include \"td/telegram/td_tdc_api_inner.h\"\n\n" - "#include \"td/utils/format.h\"\n" - "#include \"td/utils/logging.h\"\n" - "#include \"td/utils/misc.h\"\n" - "#include \"td/utils/Slice.h\"\n" - "\n"; + return std::string(); } + std::string gen_output_end() const final { if (is_header_ == 1) { return "#ifdef __cplusplus\n" @@ -289,17 +292,29 @@ class TlWriterCCommon final : public tl::TL_writer { return ""; } + std::string gen_import_declaration(const std::string &name, bool is_system) const final { + if (is_system) { + return "#include <" + name + ">\n"; + } else { + return "#include \"" + name + "\"\n"; + } + } + + std::string gen_package_suffix() const final { + return ".h"; + } + std::string gen_forward_class_declaration(const std::string &class_name, bool is_proxy) const final { if (is_header_ != 1 || class_name == "") { return ""; } return "struct Td" + class_name + ";\n" - "TDC_VECTOR(" + - class_name + ", struct Td" + class_name + - " *);\n" - "TDC_VECTOR(Vector" + - class_name + ", struct TdVector" + class_name + " *);\n"; + "struct TdVector" + + class_name + + ";\n" + "struct TdVectorVector" + + class_name + ";\n"; } std::string gen_class_begin(const std::string &class_name, const std::string &base_class_name, bool is_proxy, @@ -312,7 +327,13 @@ class TlWriterCCommon final : public tl::TL_writer { if (class_name == "Function" || class_name == "Object") { tail = "};\n"; } - return "struct Td" + class_name + " {\n" + " int ID;\n int refcnt;\n" + tail; + return "TDC_VECTOR(" + class_name + ", struct Td" + class_name + + " *);\n" + "TDC_VECTOR(Vector" + + class_name + ", struct TdVector" + class_name + + " *);\n" + "struct Td" + + class_name + " {\n" + " int ID;\n int refcnt;\n" + tail; } std::string gen_class_end() const final { return ""; @@ -1353,4 +1374,5 @@ class TlWriterCCommon final : public tl::TL_writer { return 2; } }; + } // namespace td diff --git a/protocols/Telegram/tdlib/td/td/generate/tl_writer_cpp.cpp b/protocols/Telegram/tdlib/td/td/generate/tl_writer_cpp.cpp index ac5e8b76fb..24da40e139 100644 --- a/protocols/Telegram/tdlib/td/td/generate/tl_writer_cpp.cpp +++ b/protocols/Telegram/tdlib/td/td/generate/tl_writer_cpp.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -10,7 +10,7 @@ namespace td { -std::string TD_TL_writer_cpp::gen_output_begin() const { +std::string TD_TL_writer_cpp::gen_output_begin(const std::string &additional_imports) const { std::string ext_include_str; for (auto &it : ext_include) { ext_include_str += "#include " + it + "\n"; @@ -26,12 +26,15 @@ std::string TD_TL_writer_cpp::gen_output_begin() const { "#include \"td/utils/SliceBuilder.h\"\n" "#include \"td/utils/tl_parsers.h\"\n" "#include \"td/utils/tl_storers.h\"\n" - "#include \"td/utils/TlStorerToString.h\"\n\n" + "#include \"td/utils/TlStorerToString.h\"\n\n" + + additional_imports + "namespace td {\n" "namespace " + - tl_name + - " {\n\n" - "std::string to_string(const BaseObject &value) {\n" + tl_name + " {\n\n"; +} + +std::string TD_TL_writer_cpp::gen_output_begin_once() const { + return "std::string to_string(const BaseObject &value) {\n" " TlStorerToString storer;\n" " value.store(storer, \"\");\n" " return storer.move_as_string();\n" @@ -227,14 +230,25 @@ std::string TD_TL_writer_cpp::gen_field_fetch(int field_num, const tl::arg &a, s } assert(!(a.flags & tl::FLAG_EXCL)); - assert(!(a.flags & tl::FLAG_OPT_VAR)); - std::string res = " "; if (a.exist_var_num != -1) { assert(0 <= a.exist_var_num && a.exist_var_num < static_cast<int>(vars.size())); assert(vars[a.exist_var_num].is_stored); + if (a.var_num == -1 && parser_type != 0) { + assert(a.type->get_type() == tl::NODE_TYPE_TYPE); + const tl::tl_tree_type *tree_type = static_cast<tl::tl_tree_type *>(a.type); + if (tree_type->flags & tl::FLAG_BARE && tree_type->type->name == "True") { + assert(is_type_bare(tree_type->type)); + return " " + field_name + " = (" + gen_var_name(vars[a.exist_var_num]) + " & " + + int_to_string(1 << a.exist_var_bit) + ") != 0;\n"; + } + } + } + + std::string res = " "; + if (a.exist_var_num != -1) { res += "if (" + gen_var_name(vars[a.exist_var_num]) + " & " + int_to_string(1 << a.exist_var_bit) + ") { "; } @@ -446,17 +460,24 @@ std::string TD_TL_writer_cpp::gen_field_store(const tl::arg &a, std::vector<tl:: return ""; } - if (a.exist_var_num >= 0 && a.var_num < 0 && a.type->get_type() == tl::NODE_TYPE_TYPE) { - const tl::tl_tree_type *tree_type = static_cast<tl::tl_tree_type *>(a.type); - if (tree_type->type->name == "True") { - return ""; - } - } - if (a.exist_var_num >= 0) { assert(a.exist_var_num < static_cast<int>(vars.size())); assert(vars[a.exist_var_num].is_stored); + if (a.var_num == -1 && a.type->get_type() == tl::NODE_TYPE_TYPE) { + const tl::tl_tree_type *tree_type = static_cast<tl::tl_tree_type *>(a.type); + if (tree_type->type->name == "True") { + if (storer_type == 1) { + return " if (" + gen_var_name(vars[a.exist_var_num]) + " & " + int_to_string(1 << a.exist_var_bit) + + ") { s.store_field(\"" + get_pretty_field_name(field_name) + "\", true); }\n"; + } else { + return ""; + } + } + } + } + + if (a.exist_var_num >= 0) { res += "if (" + gen_var_name(vars[a.exist_var_num]) + " & " + int_to_string(1 << a.exist_var_bit) + ") { "; } @@ -538,9 +559,7 @@ std::string TD_TL_writer_cpp::gen_fetch_function_begin(const std::string &parser result += "p);\n" "}\n\n" + - class_name + "::" + class_name + "(" + parser_name + - " &p)\n" - "#define FAIL(error) p.set_error(error)\n"; + class_name + "::" + class_name + "(" + parser_name + " &p)\n"; } return result; } @@ -562,8 +581,7 @@ std::string TD_TL_writer_cpp::gen_fetch_function_end(bool has_parent, int field_ if (field_count == 0) { return "}\n"; } - return "#undef FAIL\n" - "{}\n"; + return "{}\n"; } if (parser_type == -1) { diff --git a/protocols/Telegram/tdlib/td/td/generate/tl_writer_cpp.h b/protocols/Telegram/tdlib/td/td/generate/tl_writer_cpp.h index 8d983ca1bb..94a438148f 100644 --- a/protocols/Telegram/tdlib/td/td/generate/tl_writer_cpp.h +++ b/protocols/Telegram/tdlib/td/td/generate/tl_writer_cpp.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -41,7 +41,8 @@ class TD_TL_writer_cpp : public TD_TL_writer { : TD_TL_writer(tl_name, string_type, bytes_type), ext_include(ext_include) { } - std::string gen_output_begin() const override; + std::string gen_output_begin(const std::string &additional_imports) const override; + std::string gen_output_begin_once() const override; std::string gen_output_end() const override; std::string gen_forward_class_declaration(const std::string &class_name, bool is_proxy) const override; diff --git a/protocols/Telegram/tdlib/td/td/generate/tl_writer_dotnet.h b/protocols/Telegram/tdlib/td/td/generate/tl_writer_dotnet.h index 7cee877235..754ffb833d 100644 --- a/protocols/Telegram/tdlib/td/td/generate/tl_writer_dotnet.h +++ b/protocols/Telegram/tdlib/td/td/generate/tl_writer_dotnet.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -18,13 +18,15 @@ namespace td { namespace tl { class TlWriterDotNet final : public TL_writer { - public: bool is_header_; std::string prefix_; - TlWriterDotNet(const std::string &name, bool is_header, const std::string &prefix = "") + + public: + TlWriterDotNet(const std::string &name, bool is_header, const std::string &prefix) : TL_writer(name), is_header_(is_header), prefix_(prefix) { } - int get_max_arity(void) const final { + + int get_max_arity() const final { return 0; } @@ -40,7 +42,7 @@ class TlWriterDotNet final : public TL_writer { is_built_in_complex_type(t->name); } - std::vector<std::string> get_parsers(void) const final { + std::vector<std::string> get_parsers() const final { return {"FromUnmanaged"}; } int get_parser_type(const tl_combinator *t, const std::string &name) const final { @@ -49,10 +51,10 @@ class TlWriterDotNet final : public TL_writer { Mode get_parser_mode(int type) const final { return All; // Server; } - std::vector<std::string> get_storers(void) const final { + std::vector<std::string> get_storers() const final { return {"ToUnmanaged", "ToString"}; } - std::vector<std::string> get_additional_functions(void) const final { + std::vector<std::string> get_additional_functions() const final { return {"ToUnmanaged", "FromUnmanaged"}; } int get_storer_type(const tl_combinator *t, const std::string &name) const final { @@ -62,14 +64,14 @@ class TlWriterDotNet final : public TL_writer { return type <= 1 ? All : Server; } - std::string gen_base_tl_class_name(void) const final { + std::string gen_base_tl_class_name() const final { return "BaseObject"; } std::string gen_base_type_class_name(int arity) const final { assert(arity == 0); return "Object"; } - std::string gen_base_function_class_name(void) const final { + std::string gen_base_function_class_name() const final { return "Function"; } @@ -178,19 +180,36 @@ class TlWriterDotNet final : public TL_writer { return gen_main_class_name(t) + "^"; } - std::string gen_output_begin(void) const final { - return prefix_ + - "#include \"td/tl/tl_dotnet_object.h\"\n\n" + + std::string gen_output_begin(const std::string &additional_imports) const final { + return prefix_ + "#include \"td/tl/tl_dotnet_object.h\"\n\n" + additional_imports + "namespace Telegram {\n" "namespace Td {\n" "namespace Api {\n"; } + + std::string gen_output_begin_once() const final { + return std::string(); + } + std::string gen_output_end() const final { return "}\n" "}\n" "}\n"; } + std::string gen_import_declaration(const std::string &name, bool is_system) const final { + if (is_system) { + return "#include <" + name + ">\n"; + } else { + return "#include \"" + name + "\"\n"; + } + } + + std::string gen_package_suffix() const final { + return ".h"; + } + std::string gen_forward_class_declaration(const std::string &class_name, bool is_proxy) const final { if (!is_header_) { return ""; @@ -212,7 +231,7 @@ class TlWriterDotNet final : public TL_writer { << " public:\n"; return ss.str(); } - std::string gen_class_end(void) const final { + std::string gen_class_end() const final { return ""; } @@ -225,8 +244,12 @@ class TlWriterDotNet final : public TL_writer { if (field_name == class_name) { fixed_field_name += "Value"; } - if (type_name.substr(0, field_name.size()) == field_name) { - auto fixed_type_name = "::Telegram::Td::Api::" + type_name; + auto is_web_page_stickers = + (class_name == "WebPage" && field_name == "Stickers" && type_name == "Array<Sticker^>^"); + if (type_name == field_name + "^" || (type_name == "Message^" && field_name == "ReplyToMessage") || + is_web_page_stickers) { + auto fixed_type_name = + is_web_page_stickers ? "Array<::Telegram::Td::Api::Sticker^>^" : "::Telegram::Td::Api::" + type_name; std::stringstream ss; ss << "private:\n"; ss << " " << fixed_type_name << " " << fixed_field_name << "PrivateField;\n"; @@ -394,7 +417,7 @@ class TlWriterDotNet final : public TL_writer { assert(0); return std::string(); } - std::string gen_var_type_name(void) const final { + std::string gen_var_type_name() const final { assert(0); return std::string(); } @@ -485,7 +508,7 @@ class TlWriterDotNet final : public TL_writer { const tl_tree *result) const final { return ""; } - std::string gen_fetch_function_result_end(void) const final { + std::string gen_fetch_function_result_end() const final { return ""; } std::string gen_fetch_function_result_any_begin(const std::string &parser_name, const std::string &class_name, @@ -496,13 +519,13 @@ class TlWriterDotNet final : public TL_writer { return ""; } - std::string gen_fetch_switch_begin(void) const final { + std::string gen_fetch_switch_begin() const final { return ""; } std::string gen_fetch_switch_case(const tl_combinator *t, int arity) const final { return ""; } - std::string gen_fetch_switch_end(void) const final { + std::string gen_fetch_switch_end() const final { return ""; } diff --git a/protocols/Telegram/tdlib/td/td/generate/tl_writer_h.cpp b/protocols/Telegram/tdlib/td/td/generate/tl_writer_h.cpp index 19585d69ed..21cf195803 100644 --- a/protocols/Telegram/tdlib/td/td/generate/tl_writer_h.cpp +++ b/protocols/Telegram/tdlib/td/td/generate/tl_writer_h.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -28,7 +28,14 @@ std::string TD_TL_writer_h::forward_declaration(std::string type) { return ""; } -std::string TD_TL_writer_h::gen_output_begin() const { +std::string TD_TL_writer_h::gen_output_begin(const std::string &additional_imports) const { + if (!additional_imports.empty()) { + return "#pragma once\n\n" + additional_imports + + "namespace td {\n" + "namespace " + + tl_name + " {\n\n"; + } + std::string ext_include_str; for (auto &it : ext_include) { ext_include_str += "#include " + it + "\n"; @@ -53,10 +60,11 @@ std::string TD_TL_writer_h::gen_output_begin() const { "#include <utility>\n" "#include <vector>\n\n" "namespace td {\n" + - ext_forward_declaration + "namespace " + tl_name + - " {\n\n" + ext_forward_declaration + "namespace " + tl_name + " {\n\n"; +} - "using int32 = std::int32_t;\n" +std::string TD_TL_writer_h::gen_output_begin_once() const { + return "using int32 = std::int32_t;\n" "using int53 = std::int64_t;\n" "using int64 = std::int64_t;\n\n" @@ -256,8 +264,16 @@ std::string TD_TL_writer_h::gen_forward_class_declaration(const std::string &cla std::string TD_TL_writer_h::gen_class_begin(const std::string &class_name, const std::string &base_class_name, bool is_proxy, const tl::tl_tree *result) const { - return "class " + class_name + (!is_proxy ? " final " : "") + ": public " + base_class_name + + if (is_proxy) { + return "class " + class_name + ": public " + base_class_name + + " {\n" + " public:\n"; + } + return "class " + class_name + " final : public " + base_class_name + " {\n" + " std::int32_t get_id() const final {\n" + " return ID;\n" + " }\n\n" " public:\n"; } @@ -281,11 +297,7 @@ std::string TD_TL_writer_h::gen_get_id(const std::string &class_name, std::int32 return "\n" " static const std::int32_t ID = " + - int_to_string(id) + - ";\n" - " std::int32_t get_id() const final {\n" - " return ID;\n" - " }\n"; + int_to_string(id) + ";\n"; } std::string TD_TL_writer_h::gen_function_result_type(const tl::tl_tree *result) const { diff --git a/protocols/Telegram/tdlib/td/td/generate/tl_writer_h.h b/protocols/Telegram/tdlib/td/td/generate/tl_writer_h.h index 273087e9cc..3055afa5ff 100644 --- a/protocols/Telegram/tdlib/td/td/generate/tl_writer_h.h +++ b/protocols/Telegram/tdlib/td/td/generate/tl_writer_h.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -28,7 +28,8 @@ class TD_TL_writer_h : public TD_TL_writer { : TD_TL_writer(tl_name, string_type, bytes_type), ext_include(ext_include) { } - std::string gen_output_begin() const override; + std::string gen_output_begin(const std::string &additional_imports) const override; + std::string gen_output_begin_once() const override; std::string gen_output_end() const override; std::string gen_forward_class_declaration(const std::string &class_name, bool is_proxy) const override; diff --git a/protocols/Telegram/tdlib/td/td/generate/tl_writer_hpp.cpp b/protocols/Telegram/tdlib/td/td/generate/tl_writer_hpp.cpp index 6f14a6a7e7..8881d5197a 100644 --- a/protocols/Telegram/tdlib/td/td/generate/tl_writer_hpp.cpp +++ b/protocols/Telegram/tdlib/td/td/generate/tl_writer_hpp.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -38,7 +38,7 @@ std::string TD_TL_writer_hpp::gen_base_tl_class_name() const { return "BaseObject"; } -std::string TD_TL_writer_hpp::gen_output_begin() const { +std::string TD_TL_writer_hpp::gen_output_begin(const std::string &additional_imports) const { return "#pragma once\n" "\n" #ifndef DISABLE_HPP_DOCUMENTATION @@ -57,6 +57,10 @@ std::string TD_TL_writer_hpp::gen_output_begin() const { tl_name + " {\n\n"; } +std::string TD_TL_writer_hpp::gen_output_begin_once() const { + return std::string(); +} + std::string TD_TL_writer_hpp::gen_output_end() const { return "} // namespace " + tl_name + "\n" diff --git a/protocols/Telegram/tdlib/td/td/generate/tl_writer_hpp.h b/protocols/Telegram/tdlib/td/td/generate/tl_writer_hpp.h index 4c38187b24..965612512a 100644 --- a/protocols/Telegram/tdlib/td/td/generate/tl_writer_hpp.h +++ b/protocols/Telegram/tdlib/td/td/generate/tl_writer_hpp.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -28,7 +28,8 @@ class TD_TL_writer_hpp final : public TD_TL_writer { std::string gen_base_type_class_name(int arity) const final; std::string gen_base_tl_class_name() const final; - std::string gen_output_begin() const final; + std::string gen_output_begin(const std::string &additional_imports) const final; + std::string gen_output_begin_once() const final; std::string gen_output_end() const final; std::string gen_forward_class_declaration(const std::string &class_name, bool is_proxy) const final; diff --git a/protocols/Telegram/tdlib/td/td/generate/tl_writer_java.cpp b/protocols/Telegram/tdlib/td/td/generate/tl_writer_java.cpp index 917fb433c1..504c8894d3 100644 --- a/protocols/Telegram/tdlib/td/td/generate/tl_writer_java.cpp +++ b/protocols/Telegram/tdlib/td/td/generate/tl_writer_java.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -190,29 +190,45 @@ std::string TD_TL_writer_java::gen_int_const(const tl::tl_tree *tree_c, return std::string(); } -std::string TD_TL_writer_java::gen_output_begin() const { +std::string TD_TL_writer_java::gen_output_begin(const std::string &additional_imports) const { return "package " + package_name + ";\n\n" "public class " + - tl_name + - " {\n" - " static {\n" + tl_name + " {\n"; +} + +std::string TD_TL_writer_java::gen_output_begin_once() const { +#define DEFINE_STR_VALUE_IMPL(x) #x +#define DEFINE_STR_VALUE(x) DEFINE_STR_VALUE_IMPL(x) + return " static {\n" " try {\n" " System.loadLibrary(\"tdjni\");\n" " } catch (UnsatisfiedLinkError e) {\n" - " e.printStackTrace();\n" + + " e.printStackTrace();\n" " }\n" " }\n\n" + " private static final String GIT_COMMIT_HASH = \"" DEFINE_STR_VALUE(GIT_COMMIT_HASH) + "\";\n\n" " private " + tl_name + "() {\n" " }\n\n"; +#undef DEFINE_STR_VALUE +#undef DEFINE_STR_VALUE_IMPL } std::string TD_TL_writer_java::gen_output_end() const { return "}\n"; } +std::string TD_TL_writer_java::gen_import_declaration(const std::string &name, bool is_system) const { + return "import " + name + ";\n"; +} + +std::string TD_TL_writer_java::gen_package_suffix() const { + return ""; +} + std::string TD_TL_writer_java::gen_forward_class_declaration(const std::string &class_name, bool is_proxy) const { return ""; } diff --git a/protocols/Telegram/tdlib/td/td/generate/tl_writer_java.h b/protocols/Telegram/tdlib/td/td/generate/tl_writer_java.h index 69f2671734..3ae7e9737d 100644 --- a/protocols/Telegram/tdlib/td/td/generate/tl_writer_java.h +++ b/protocols/Telegram/tdlib/td/td/generate/tl_writer_java.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -53,9 +53,14 @@ class TD_TL_writer_java final : public tl::TL_writer { std::string gen_int_const(const tl::tl_tree *tree_c, const std::vector<tl::var_description> &vars) const final; - std::string gen_output_begin() const final; + std::string gen_output_begin(const std::string &additional_imports) const final; + std::string gen_output_begin_once() const final; std::string gen_output_end() const final; + std::string gen_import_declaration(const std::string &name, bool is_system) const final; + + std::string gen_package_suffix() const final; + std::string gen_forward_class_declaration(const std::string &class_name, bool is_proxy) const final; std::string gen_class_begin(const std::string &class_name, const std::string &base_class_name, bool is_proxy, diff --git a/protocols/Telegram/tdlib/td/td/generate/tl_writer_jni_cpp.cpp b/protocols/Telegram/tdlib/td/td/generate/tl_writer_jni_cpp.cpp index cc531f54de..d7aaefaa05 100644 --- a/protocols/Telegram/tdlib/td/td/generate/tl_writer_jni_cpp.cpp +++ b/protocols/Telegram/tdlib/td/td/generate/tl_writer_jni_cpp.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -11,12 +11,19 @@ namespace td { -std::string TD_TL_writer_jni_cpp::gen_output_begin() const { - return TD_TL_writer_cpp::gen_output_begin() + - "\nstatic const char *package_name = \"Call set_package_name\";\n\n" - "void set_package_name(const char *new_package_name) {\n" - " package_name = new_package_name;\n" +std::string TD_TL_writer_jni_cpp::gen_output_begin_once() const { +#define DEFINE_STR_VALUE_IMPL(x) #x +#define DEFINE_STR_VALUE(x) DEFINE_STR_VALUE_IMPL(x) + return TD_TL_writer_cpp::gen_output_begin_once() + + "\nconst char *&get_package_name_ref() {\n" + " static const char *package_name = \"Package name must be initialized first\";\n" + " return package_name;\n" + "}\n" + "\nconst char *get_git_commit_hash() {\n" + " return \"" DEFINE_STR_VALUE(GIT_COMMIT_HASH) "\";\n" "}\n"; +#undef DEFINE_STR_VALUE +#undef DEFINE_STR_VALUE_IMPL } bool TD_TL_writer_jni_cpp::is_built_in_simple_type(const std::string &name) const { @@ -437,7 +444,7 @@ std::string TD_TL_writer_jni_cpp::gen_fetch_function_result_begin(const std::str const tl::tl_tree *result) const { return "\n" + class_name + "::ReturnType " + class_name + "::fetch_result(" + parser_name + " &p) {\n" - " if (p == nullptr) return ReturnType();\n" + + " if (p == nullptr) return ReturnType();\n" " return "; } @@ -483,7 +490,8 @@ std::string TD_TL_writer_jni_cpp::gen_store_function_begin(const std::string &st std::string TD_TL_writer_jni_cpp::gen_fetch_switch_begin() const { return " if (p == nullptr) { return nullptr; }\n" - " switch (env->CallIntMethod(p, jni::GetConstructorID)) {\n"; + " jint constructor = env->CallIntMethod(p, jni::GetConstructorID);" + " switch (constructor) {\n"; } std::string TD_TL_writer_jni_cpp::gen_fetch_switch_case(const tl::tl_combinator *t, int arity) const { @@ -496,7 +504,7 @@ std::string TD_TL_writer_jni_cpp::gen_fetch_switch_case(const tl::tl_combinator std::string TD_TL_writer_jni_cpp::gen_fetch_switch_end() const { return " default:\n" - " LOG(WARNING) << \"Unknown constructor found\";\n" + " LOG(WARNING) << \"Unknown Java API constructor found \" << format::as_hex(constructor);\n" " return nullptr;\n" " }\n"; } @@ -538,7 +546,7 @@ std::string TD_TL_writer_jni_cpp::gen_basic_java_class_name(std::string name) co } std::string TD_TL_writer_jni_cpp::gen_java_class_name(std::string name) const { - return "(PSLICE() << package_name << \"/TdApi$" + gen_basic_java_class_name(name) + "\").c_str()"; + return "(PSLICE() << get_package_name_ref() << \"/TdApi$" + gen_basic_java_class_name(name) + "\").c_str()"; } std::string TD_TL_writer_jni_cpp::gen_type_signature(const tl::tl_tree_type *tree_type) const { @@ -600,7 +608,7 @@ std::string TD_TL_writer_jni_cpp::gen_additional_function(const std::string &fun std::string new_type_signature = "(PSLICE()"; std::size_t pos = type_signature.find("%PACKAGE_NAME%"); while (pos != std::string::npos) { - new_type_signature += " << \"" + type_signature.substr(0, pos) + "\" << package_name"; + new_type_signature += " << \"" + type_signature.substr(0, pos) + "\" << get_package_name_ref()"; type_signature = type_signature.substr(pos + 14); pos = type_signature.find("%PACKAGE_NAME%"); } diff --git a/protocols/Telegram/tdlib/td/td/generate/tl_writer_jni_cpp.h b/protocols/Telegram/tdlib/td/td/generate/tl_writer_jni_cpp.h index 7ceda54b9c..d168903c3d 100644 --- a/protocols/Telegram/tdlib/td/td/generate/tl_writer_jni_cpp.h +++ b/protocols/Telegram/tdlib/td/td/generate/tl_writer_jni_cpp.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -16,7 +16,7 @@ namespace td { class TD_TL_writer_jni_cpp final : public TD_TL_writer_cpp { - std::string gen_output_begin() const final; + std::string gen_output_begin_once() const final; std::string gen_vector_fetch(std::string field_name, const tl::tl_tree_type *t, const std::vector<tl::var_description> &vars, int parser_type) const; diff --git a/protocols/Telegram/tdlib/td/td/generate/tl_writer_jni_h.cpp b/protocols/Telegram/tdlib/td/td/generate/tl_writer_jni_h.cpp index 095cfed523..40edd5293c 100644 --- a/protocols/Telegram/tdlib/td/td/generate/tl_writer_jni_h.cpp +++ b/protocols/Telegram/tdlib/td/td/generate/tl_writer_jni_h.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -58,7 +58,7 @@ std::string TD_TL_writer_jni_h::gen_base_tl_class_name() const { return "Object"; } -std::string TD_TL_writer_jni_h::gen_output_begin() const { +std::string TD_TL_writer_jni_h::gen_output_begin(const std::string &additional_imports) const { std::string ext_include_str; for (auto &it : ext_include) { ext_include_str += "#include " + it + "\n"; @@ -69,62 +69,25 @@ std::string TD_TL_writer_jni_h::gen_output_begin() const { "#include <utility>\n" "#include <vector>\n\n" "#include <jni.h>\n\n" + - ext_include_str + - "\n" + ext_include_str + "\n" + additional_imports + - "namespace td {\n" + - forward_declaration("TlStorerToString") + + "namespace td {\n" + forward_declaration("TlStorerToString") + "\n" "namespace " + - tl_name + - " {\n\n" - - "using int32 = std::int32_t;\n" - "using int53 = std::int64_t;\n" - "using int64 = std::int64_t;\n\n" - - "using string = " + - string_type + - ";\n\n" - - "using bytes = " + - bytes_type + - ";\n\n" - - "template <class Type>\n" - "using array = std::vector<Type>;\n\n" - - "class " + - gen_base_tl_class_name() + - ";\n" - "using BaseObject = " + - gen_base_tl_class_name() + - ";\n\n" - - "template <class Type>\n" - "using object_ptr = ::td::tl_object_ptr<Type>;\n\n" - "template <class Type, class... Args>\n" - "object_ptr<Type> make_object(Args &&... args) {\n" - " return object_ptr<Type>(new Type(std::forward<Args>(args)...));\n" - "}\n\n" - - "template <class ToType, class FromType>\n" - "object_ptr<ToType> move_object_as(FromType &&from) {\n" - " return object_ptr<ToType>(static_cast<ToType *>(from.release()));\n" - "}\n\n" - - "std::string to_string(const BaseObject &value);\n\n" - - "template <class T>\n" - "std::string to_string(const object_ptr<T> &value) {\n" - " if (value == nullptr) {\n" - " return \"null\";\n" - " }\n" - "\n" - " return to_string(*value);\n" - "}\n\n" + tl_name + " {\n\n"; +} - "void set_package_name(const char *new_package_name);\n\n"; +std::string TD_TL_writer_jni_h::gen_output_begin_once() const { + std::string result = TD_TL_writer_h::gen_output_begin_once(); + std::string old_base_object = "using BaseObject = ::td::TlObject"; + std::size_t pos = result.find(old_base_object); + assert(pos != std::string::npos); + result.replace(pos, old_base_object.size(), + "class " + gen_base_tl_class_name() + + ";\n" + "using BaseObject = " + + gen_base_tl_class_name()); + return result + "const char *&get_package_name_ref();\nconst char *get_git_commit_hash();\n\n"; } std::string TD_TL_writer_jni_h::gen_class_begin(const std::string &class_name, const std::string &base_class_name, @@ -136,16 +99,13 @@ std::string TD_TL_writer_jni_h::gen_class_begin(const std::string &class_name, c " virtual ~" + class_name + "() {\n" - " }\n\n" + + " }\n\n" " virtual void store(JNIEnv *env, jobject &s) const {\n" " }\n\n" " virtual void store(TlStorerToString &s, const char *field_name) const = 0;\n\n" " static jclass Class;\n"; } - return "class " + class_name + (!is_proxy ? " final " : "") + ": public " + base_class_name + - " {\n" - " public:\n" - " static jclass Class;\n"; + return TD_TL_writer_h::gen_class_begin(class_name, base_class_name, is_proxy, result) + " static jclass Class;\n"; } std::string TD_TL_writer_jni_h::gen_field_definition(const std::string &class_name, const std::string &type_name, diff --git a/protocols/Telegram/tdlib/td/td/generate/tl_writer_jni_h.h b/protocols/Telegram/tdlib/td/td/generate/tl_writer_jni_h.h index 78479756a6..969e889901 100644 --- a/protocols/Telegram/tdlib/td/td/generate/tl_writer_jni_h.h +++ b/protocols/Telegram/tdlib/td/td/generate/tl_writer_jni_h.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -32,7 +32,8 @@ class TD_TL_writer_jni_h final : public TD_TL_writer_h { std::string gen_base_type_class_name(int arity) const final; std::string gen_base_tl_class_name() const final; - std::string gen_output_begin() const final; + std::string gen_output_begin(const std::string &additional_imports) const final; + std::string gen_output_begin_once() const final; std::string gen_class_begin(const std::string &class_name, const std::string &base_class_name, bool is_proxy, const tl::tl_tree *result) const final; diff --git a/protocols/Telegram/tdlib/td/td/generate/tl_writer_td.cpp b/protocols/Telegram/tdlib/td/td/generate/tl_writer_td.cpp index 537eaa452f..dd5455e530 100644 --- a/protocols/Telegram/tdlib/td/td/generate/tl_writer_td.cpp +++ b/protocols/Telegram/tdlib/td/td/generate/tl_writer_td.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -63,7 +63,8 @@ bool TD_TL_writer::is_full_constructor_generated(const tl::tl_combinator *t, boo t->name == "encryptedChatWaiting" || t->name == "encryptedChatRequested" || t->name == "encryptedChat" || t->name == "langPackString" || t->name == "langPackStringPluralized" || t->name == "langPackStringDeleted" || t->name == "peerUser" || t->name == "peerChat" || t->name == "updateServiceNotification" || - t->name == "updateNewMessage" || t->name == "updateChannelTooLong" || t->name == "messages.stickerSet"; + t->name == "updateNewMessage" || t->name == "updateChannelTooLong" || t->name == "messages.stickerSet" || + t->name == "updates.differenceSlice" || t->name == "contacts.contactBirthdays"; } int TD_TL_writer::get_storer_type(const tl::tl_combinator *t, const std::string &storer_name) const { @@ -116,6 +117,18 @@ std::vector<std::string> TD_TL_writer::get_storers() const { return storers; } +std::string TD_TL_writer::gen_import_declaration(const std::string &name, bool is_system) const { + if (is_system) { + return "#include <" + name + ">\n"; + } else { + return "#include \"" + name + "\"\n"; + } +} + +std::string TD_TL_writer::gen_package_suffix() const { + return ".h"; +} + std::string TD_TL_writer::gen_base_tl_class_name() const { return base_tl_class_name; } diff --git a/protocols/Telegram/tdlib/td/td/generate/tl_writer_td.h b/protocols/Telegram/tdlib/td/td/generate/tl_writer_td.h index 7cdbdcb5ab..05693f3fb4 100644 --- a/protocols/Telegram/tdlib/td/td/generate/tl_writer_td.h +++ b/protocols/Telegram/tdlib/td/td/generate/tl_writer_td.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -45,6 +45,8 @@ class TD_TL_writer : public tl::TL_writer { std::vector<std::string> get_parsers() const override; std::vector<std::string> get_storers() const override; + std::string gen_import_declaration(const std::string &package_name, bool is_system) const override; + std::string gen_package_suffix() const override; std::string gen_base_tl_class_name() const override; std::string gen_base_type_class_name(int arity) const override; std::string gen_base_function_class_name() const override; diff --git a/protocols/Telegram/tdlib/td/test/CMakeLists.txt b/protocols/Telegram/tdlib/td/test/CMakeLists.txt index 2a140a3af7..da7d45c3f2 100644 --- a/protocols/Telegram/tdlib/td/test/CMakeLists.txt +++ b/protocols/Telegram/tdlib/td/test/CMakeLists.txt @@ -2,7 +2,6 @@ if ((CMAKE_MAJOR_VERSION LESS 3) OR (CMAKE_VERSION VERSION_LESS "3.0.2")) message(FATAL_ERROR "CMake >= 3.0.2 is required") endif() -#SOURCE SETS set(TD_TEST_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/country_info.cpp ${CMAKE_CURRENT_SOURCE_DIR}/db.cpp @@ -36,11 +35,10 @@ set(TESTS_MAIN #target_link_libraries(all_tests PRIVATE tdcore tdclient) if (NOT CMAKE_CROSSCOMPILING OR EMSCRIPTEN) - #Tests if (OPENSSL_FOUND) add_executable(test-crypto EXCLUDE_FROM_ALL crypto.cpp) target_include_directories(test-crypto SYSTEM PRIVATE ${OPENSSL_INCLUDE_DIR}) - target_link_libraries(test-crypto PRIVATE ${OPENSSL_CRYPTO_LIBRARY} ${CMAKE_DL_LIBS} ${ZLIB_LIBRARIES} tdutils tdcore) + target_link_libraries(test-crypto PRIVATE ${OPENSSL_CRYPTO_LIBRARY} ${CMAKE_DL_LIBS} ${ZLIB_LIBRARIES} tdutils tdmtproto) if (WIN32) if (MINGW) diff --git a/protocols/Telegram/tdlib/td/test/country_info.cpp b/protocols/Telegram/tdlib/td/test/country_info.cpp index 0a9e3c26b6..2fe59de245 100644 --- a/protocols/Telegram/tdlib/td/test/country_info.cpp +++ b/protocols/Telegram/tdlib/td/test/country_info.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/test/crypto.cpp b/protocols/Telegram/tdlib/td/test/crypto.cpp index f6657747f1..0de3d464c3 100644 --- a/protocols/Telegram/tdlib/td/test/crypto.cpp +++ b/protocols/Telegram/tdlib/td/test/crypto.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/test/data.cpp b/protocols/Telegram/tdlib/td/test/data.cpp index c53658d243..e0516dd16d 100644 --- a/protocols/Telegram/tdlib/td/test/data.cpp +++ b/protocols/Telegram/tdlib/td/test/data.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/test/data.h b/protocols/Telegram/tdlib/td/test/data.h index 79093e1996..99e1936227 100644 --- a/protocols/Telegram/tdlib/td/test/data.h +++ b/protocols/Telegram/tdlib/td/test/data.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/test/db.cpp b/protocols/Telegram/tdlib/td/test/db.cpp index 9e56e331f4..4fe75c15f8 100644 --- a/protocols/Telegram/tdlib/td/test/db.cpp +++ b/protocols/Telegram/tdlib/td/test/db.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/test/fuzz_url.cpp b/protocols/Telegram/tdlib/td/test/fuzz_url.cpp index cd7af58a77..f29e7c1295 100644 --- a/protocols/Telegram/tdlib/td/test/fuzz_url.cpp +++ b/protocols/Telegram/tdlib/td/test/fuzz_url.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/test/http.cpp b/protocols/Telegram/tdlib/td/test/http.cpp index e3d2301f6e..5deca6d0c9 100644 --- a/protocols/Telegram/tdlib/td/test/http.cpp +++ b/protocols/Telegram/tdlib/td/test/http.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -71,13 +71,13 @@ static td::string gen_http_content() { return td::rand_string(std::numeric_limits<char>::min(), std::numeric_limits<char>::max(), len); } -static td::string make_http_query(td::string content, bool is_json, bool is_chunked, bool is_gzip, double gzip_k = 5, - td::string zip_override = td::string()) { +static td::string make_http_query(td::string content, td::string content_type, bool is_chunked, bool is_gzip, + double gzip_k = 5, td::string zip_override = td::string()) { td::HttpHeaderCreator hc; hc.init_post("/"); hc.add_header("jfkdlsahhjk", td::rand_string('a', 'z', td::Random::fast(1, 2000))); - if (is_json) { - hc.add_header("content-type", "application/json"); + if (!content_type.empty()) { + hc.add_header("content-type", content_type); } if (is_gzip) { td::BufferSlice zip; @@ -105,7 +105,7 @@ static td::string make_http_query(td::string content, bool is_json, bool is_chun static td::string rand_http_query(td::string content) { bool is_chunked = td::Random::fast_bool(); bool is_gzip = td::Random::fast_bool(); - return make_http_query(std::move(content), false, is_chunked, is_gzip); + return make_http_query(std::move(content), td::string(), is_chunked, is_gzip); } static td::string join(const td::vector<td::string> &v) { @@ -145,8 +145,16 @@ TEST(Http, reader) { #pragma clang diagnostic ignored "-Wunknown-warning-option" #pragma clang diagnostic ignored "-Wself-move" #endif +#if TD_GCC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" +#pragma GCC diagnostic ignored "-Wself-move" +#endif a = std::move(a); b = std::move(b); +#if TD_GCC +#pragma GCC diagnostic pop +#endif #if TD_CLANG #pragma clang diagnostic pop #endif @@ -220,7 +228,7 @@ TEST(Http, gzip_bomb) { .as_slice() .str(); - auto query = make_http_query("", false, false, true, 0.01, gzip_bomb_str); + auto query = make_http_query(td::string(), td::string(), false, true, 0.01, gzip_bomb_str); auto parts = td::rand_split(query); td::ChainBufferWriter input_writer; auto input = input_writer.extract_reader(); @@ -248,7 +256,7 @@ TEST(Http, gzip) { td::HttpReader reader; reader.init(&input, 0, 0); - auto query = make_http_query("", true, false, true, 0.01, gzip_str); + auto query = make_http_query(td::string(), "application/json", false, true, 0.01, gzip_str); input_writer.append(query); input.sync_with_writer(); @@ -442,7 +450,7 @@ TEST(Http, gzip_bomb_with_limit) { gzip_bomb_str = sink.result()->move_as_buffer_slice().as_slice().str(); } - auto query = make_http_query("", false, false, true, 0.01, gzip_bomb_str); + auto query = make_http_query(td::string(), td::string(), false, true, 0.01, gzip_bomb_str); auto parts = td::rand_split(query); td::ChainBufferWriter input_writer; auto input = input_writer.extract_reader(); @@ -464,6 +472,67 @@ TEST(Http, gzip_bomb_with_limit) { ASSERT_TRUE(ok); } +TEST(Http, partial_form_data) { + td::ChainBufferWriter input_writer; + auto input = input_writer.extract_reader(); + + td::HttpReader reader; + reader.init(&input, 0, 0); + + auto query = + make_http_query("------abcd\r\nCo", "Content-Type: multipart/form-data; boundary=----abcd", false, false); + input_writer.append(query); + input.sync_with_writer(); + + td::HttpQuery q; + auto r_state = reader.read_next(&q); + ASSERT_TRUE(r_state.is_error()); + ASSERT_EQ(400, r_state.error().code()); +} + +TEST(Http, form_data) { + td::ChainBufferWriter input_writer; + auto input = input_writer.extract_reader(); + + td::HttpReader reader; + reader.init(&input, 0, 1); + + auto query = make_http_query( + "------abcd\r\n" + "Content-Disposition: form-data; name=\"text\"\r\n" + "\r\n" + "some text\r\n" + "------abcd\r\n" + "Content-Disposition: form-data; name=\"text2\"\r\n" + "\r\n" + "some text\r\n" + "more text\r\n" + "------abcd\r\n" + "Content-Disposition: form-data; name=\"file\"; filename=\"file.txt\"\r\n" + "Content-Type: text/plain\r\n" + "\r\n" + "File content\r\n" + "------abcd--", + "Content-Type: multipart/form-data; boundary=----abcd", false, false); + input_writer.append(query); + input.sync_with_writer(); + + td::HttpQuery q; + auto r_state = reader.read_next(&q); + ASSERT_TRUE(r_state.is_ok()); + ASSERT_EQ(2u, q.args_.size()); + ASSERT_EQ("text", q.args_[0].first); + ASSERT_EQ("some text", q.args_[0].second); + ASSERT_EQ("text2", q.args_[1].first); + ASSERT_EQ("some text\r\nmore text", q.args_[1].second); + ASSERT_EQ(1u, q.files_.size()); + ASSERT_EQ("file.txt", q.files_[0].name); + ASSERT_EQ("file", q.files_[0].field_name); + ASSERT_EQ("text/plain", q.files_[0].content_type); + ASSERT_EQ(12, q.files_[0].size); + ASSERT_TRUE(!q.files_[0].temp_file_name.empty()); +} + #if TD_DARWIN_WATCH_OS struct Baton { std::mutex mutex; diff --git a/protocols/Telegram/tdlib/td/test/link.cpp b/protocols/Telegram/tdlib/td/test/link.cpp index 67b81c1354..6403b98962 100644 --- a/protocols/Telegram/tdlib/td/test/link.cpp +++ b/protocols/Telegram/tdlib/td/test/link.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -79,6 +79,8 @@ TEST(Link, check_link) { check_link("http://..", "http://../"); check_link("..", "http://../"); check_link("https://.", ""); + check_link("tOnSiTe://google", "tonsite://google/"); + check_link("tOnSiTe://google.ton?t=1#we", "tonsite://google.ton?t=1#we"); } static td::td_api::object_ptr<td::td_api::InternalLinkType> get_internal_link_type_object( @@ -97,6 +99,10 @@ static void parse_internal_link(const td::string &url, td::td_api::object_ptr<td ASSERT_STREQ(url + ' ' + to_string(expected), url + ' ' + to_string(object)); for (auto is_internal : {true, false}) { + if (!is_internal && expected->get_id() == td::td_api::internalLinkTypeChatBoost::ID) { + // external chat boost links must be generated with getChatBoostLink + continue; + } if (!is_internal && expected->get_id() == td::td_api::internalLinkTypeMessage::ID) { // external message links must be generated with getMessageLink continue; @@ -160,11 +166,12 @@ static void parse_internal_link(const td::string &url, td::td_api::object_ptr<td static auto chat_administrator_rights(bool can_manage_chat, bool can_change_info, bool can_post_messages, bool can_edit_messages, bool can_delete_messages, bool can_invite_users, bool can_restrict_members, bool can_pin_messages, bool can_manage_topics, - bool can_promote_members, bool can_manage_video_chats, bool is_anonymous) { + bool can_promote_members, bool can_manage_video_chats, bool can_post_stories, + bool can_edit_stories, bool can_delete_stories, bool is_anonymous) { return td::td_api::make_object<td::td_api::chatAdministratorRights>( can_manage_chat, can_change_info, can_post_messages, can_edit_messages, can_delete_messages, can_invite_users, can_restrict_members, can_pin_messages, can_manage_topics, can_promote_members, can_manage_video_chats, - is_anonymous); + can_post_stories, can_edit_stories, can_delete_stories, is_anonymous); } static auto target_chat_chosen(bool allow_users, bool allow_bots, bool allow_groups, bool allow_channels) { @@ -214,10 +221,22 @@ static auto bot_start_in_group(const td::string &bot_username, const td::string std::move(administrator_rights)); } +static auto business_chat(const td::string &link_name) { + return td::td_api::make_object<td::td_api::internalLinkTypeBusinessChat>(link_name); +} + +static auto buy_stars(td::int64 star_count, const td::string &purpose) { + return td::td_api::make_object<td::td_api::internalLinkTypeBuyStars>(star_count, purpose); +} + static auto change_phone_number() { return td::td_api::make_object<td::td_api::internalLinkTypeChangePhoneNumber>(); } +static auto chat_boost(const td::string &url) { + return td::td_api::make_object<td::td_api::internalLinkTypeChatBoost>(url); +} + static auto chat_folder_invite(const td::string &slug) { return td::td_api::make_object<td::td_api::internalLinkTypeChatFolderInvite>("tg:addlist?slug=" + slug); } @@ -258,6 +277,10 @@ static auto language_settings() { return td::td_api::make_object<td::td_api::internalLinkTypeLanguageSettings>(); } +static auto main_web_app(const td::string &bot_username, const td::string &start_parameter, bool is_compact) { + return td::td_api::make_object<td::td_api::internalLinkTypeMainWebApp>(bot_username, start_parameter, is_compact); +} + static auto message(const td::string &url) { return td::td_api::make_object<td::td_api::internalLinkTypeMessage>(url); } @@ -282,6 +305,14 @@ static auto premium_features(const td::string &referrer) { return td::td_api::make_object<td::td_api::internalLinkTypePremiumFeatures>(referrer); } +static auto premium_gift(const td::string &referrer) { + return td::td_api::make_object<td::td_api::internalLinkTypePremiumGift>(referrer); +} + +static auto premium_gift_code(const td::string &code) { + return td::td_api::make_object<td::td_api::internalLinkTypePremiumGiftCode>(code); +} + static auto privacy_and_security_settings() { return td::td_api::make_object<td::td_api::internalLinkTypePrivacyAndSecuritySettings>(); } @@ -297,8 +328,9 @@ static auto proxy_socks(const td::string &server, td::int32 port, const td::stri server, port, td::td_api::make_object<td::td_api::proxyTypeSocks5>(username, password)); } -static auto public_chat(const td::string &chat_username) { - return td::td_api::make_object<td::td_api::internalLinkTypePublicChat>(chat_username); +static auto public_chat(const td::string &chat_username, const td::string &draft_text = td::string(), + bool open_profile = false) { + return td::td_api::make_object<td::td_api::internalLinkTypePublicChat>(chat_username, draft_text, open_profile); } static auto qr_code_authentication() { @@ -317,6 +349,10 @@ static auto sticker_set(const td::string &sticker_set_name, bool expect_custom_e return td::td_api::make_object<td::td_api::internalLinkTypeStickerSet>(sticker_set_name, expect_custom_emoji); } +static auto story(const td::string &sender_username, td::int32 story_id) { + return td::td_api::make_object<td::td_api::internalLinkTypeStory>(sender_username, story_id); +} + static auto theme(const td::string &theme_name) { return td::td_api::make_object<td::td_api::internalLinkTypeTheme>(theme_name); } @@ -333,8 +369,10 @@ static auto unsupported_proxy() { return td::td_api::make_object<td::td_api::internalLinkTypeUnsupportedProxy>(); } -static auto user_phone_number(const td::string &phone_number) { - return td::td_api::make_object<td::td_api::internalLinkTypeUserPhoneNumber>(phone_number); +static auto user_phone_number(const td::string &phone_number, const td::string &draft_text = td::string(), + bool open_profile = false) { + return td::td_api::make_object<td::td_api::internalLinkTypeUserPhoneNumber>('+' + phone_number, draft_text, + open_profile); } static auto user_token(const td::string &token) { @@ -346,8 +384,9 @@ static auto video_chat(const td::string &chat_username, const td::string &invite } static auto web_app(const td::string &bot_username, const td::string &web_app_short_name, - const td::string &start_parameter) { - return td::td_api::make_object<td::td_api::internalLinkTypeWebApp>(bot_username, web_app_short_name, start_parameter); + const td::string &start_parameter, bool is_compact) { + return td::td_api::make_object<td::td_api::internalLinkTypeWebApp>(bot_username, web_app_short_name, start_parameter, + is_compact); } TEST(Link, parse_internal_link_part1) { @@ -372,6 +411,29 @@ TEST(Link, parse_internal_link_part1) { parse_internal_link("t.m/levlam/1", nullptr); parse_internal_link("t.men/levlam/1", nullptr); + parse_internal_link("t.me/levlam?boos", public_chat("levlam")); + parse_internal_link("telegram.me/levlam?booster", public_chat("levlam")); + parse_internal_link("telegram.dog/levlam?boost", chat_boost("tg://boost?domain=levlam")); + parse_internal_link("www.t.me/levlam?boost", chat_boost("tg://boost?domain=levlam")); + parse_internal_link("t.me/c/l12345?boost", nullptr); + parse_internal_link("t.me/c/12345l5431?boost", chat_boost("tg://boost?channel=12345")); + parse_internal_link("t.me/c/12345?boost", chat_boost("tg://boost?channel=12345")); + parse_internal_link("t.me/c/123456789012?boost", chat_boost("tg://boost?channel=123456789012")); + parse_internal_link("t.me/c/123456789012?boost=12312&domain=123", chat_boost("tg://boost?channel=123456789012")); + + parse_internal_link("t.me/boost/s/12345", story("boost", 12345)); + parse_internal_link("t.me/boost/s", chat_boost("tg://boost?domain=s")); + parse_internal_link("t.me/boost/12", message("tg://resolve?domain=boost&post=12")); + parse_internal_link("t.me/boost?cc=1#c=1", public_chat("boost")); + parse_internal_link("t.me/boost?c=-1", public_chat("boost")); + parse_internal_link("t.me/boost?c=12telegram", chat_boost("tg://boost?channel=12")); + parse_internal_link("t.me/bOoSt?c=12telegram", chat_boost("tg://boost?channel=12")); + + parse_internal_link("tg:boost?domain=username/12345&single", chat_boost("tg://boost?domain=username%2F12345")); + parse_internal_link("tg:boost?domain=username&channel=12345", chat_boost("tg://boost?domain=username")); + parse_internal_link("tg:boost?channel=12345&domain=username", chat_boost("tg://boost?domain=username")); + parse_internal_link("tg:boost?channel=12345", chat_boost("tg://boost?channel=12345")); + parse_internal_link("tg:resolve?domain=username&post=12345&single", message("tg://resolve?domain=username&post=12345&single")); parse_internal_link("tg:resolve?domain=username&post=12345&single&startattach=1&attach=test", @@ -412,8 +474,11 @@ TEST(Link, parse_internal_link_part1) { attachment_menu_bot(nullptr, public_chat("telegram"), "test", "")); parse_internal_link("tg:resolve?domain=telegram&attach=test&startattach=1", attachment_menu_bot(nullptr, public_chat("telegram"), "test", "1")); + parse_internal_link("tg:resolve?domain=username&profile=12&asd", public_chat("username", "", true)); + parse_internal_link("tg:resolve?domain=username&profile&text=@asd", public_chat("username", " @asd", true)); parse_internal_link("tg:resolve?phone=1", user_phone_number("1")); + parse_internal_link("tg:resolve?phone=+1", user_phone_number("1")); parse_internal_link("tg:resolve?phone=123456", user_phone_number("123456")); parse_internal_link("tg:resolve?phone=123456&startattach", user_phone_number("123456")); parse_internal_link("tg:resolve?phone=123456&startattach=123", user_phone_number("123456")); @@ -422,6 +487,10 @@ TEST(Link, parse_internal_link_part1) { parse_internal_link("tg:resolve?phone=123456&attach=&startattach=123", user_phone_number("123456")); parse_internal_link("tg:resolve?phone=123456&attach=test", attachment_menu_bot(nullptr, user_phone_number("123456"), "test", "")); + parse_internal_link("tg:resolve?phone=+123456&attach=test", + attachment_menu_bot(nullptr, user_phone_number("123456"), "test", "")); + parse_internal_link("tg:resolve?phone=++123456&attach=test", + unknown_deep_link("tg://resolve?phone=++123456&attach=test")); parse_internal_link("tg:resolve?phone=123456&attach=test&startattach&choose=users", attachment_menu_bot(nullptr, user_phone_number("123456"), "test", "")); parse_internal_link("tg:resolve?phone=123456&attach=test&startattach=123", @@ -431,8 +500,16 @@ TEST(Link, parse_internal_link_part1) { parse_internal_link("tg:resolve?phone=012345678901234567890123456789123", unknown_deep_link("tg://resolve?phone=012345678901234567890123456789123")); parse_internal_link("tg:resolve?phone=", unknown_deep_link("tg://resolve?phone=")); - parse_internal_link("tg:resolve?phone=+123", unknown_deep_link("tg://resolve?phone=+123")); + parse_internal_link("tg:resolve?phone=+123", user_phone_number("123")); parse_internal_link("tg:resolve?phone=123456 ", unknown_deep_link("tg://resolve?phone=123456 ")); + parse_internal_link("tg:resolve?domain=telegram&text=asd", public_chat("telegram", "asd")); + parse_internal_link("tg:resolve?phone=12345678901&text=asd", user_phone_number("12345678901", "asd")); + parse_internal_link("tg:resolve?domain=telegram&text=@asd", public_chat("telegram", " @asd")); + parse_internal_link("tg:resolve?phone=12345678901&text=@asd", user_phone_number("12345678901", " @asd")); + parse_internal_link("tg:resolve?domain=telegram&text=1%A02", public_chat("telegram")); + parse_internal_link("tg:resolve?phone=12345678901&text=1%A02", user_phone_number("12345678901")); + parse_internal_link("tg:resolve?phone=123456&profile", user_phone_number("123456", "", true)); + parse_internal_link("tg:resolve?phone=123456&profile&text=@asd", user_phone_number("123456", " @asd", true)); parse_internal_link("tg:contact?token=1", user_token("1")); parse_internal_link("tg:contact?token=123456", user_token("123456")); @@ -487,6 +564,8 @@ TEST(Link, parse_internal_link_part1) { attachment_menu_bot(nullptr, public_chat("username"), "bot", "")); parse_internal_link("t.me/username?attach=bot&startattach=1&choose=users", attachment_menu_bot(nullptr, public_chat("username"), "bot", "1")); + parse_internal_link("t.me/username?asd&profile=12", public_chat("username", "", true)); + parse_internal_link("t.me/username?profile&text=@asd", public_chat("username", " @asd", true)); parse_internal_link("tg:privatepost?domain=username/12345&single", unknown_deep_link("tg://privatepost?domain=username/12345&single")); @@ -552,7 +631,7 @@ TEST(Link, parse_internal_link_part1) { parse_internal_link("t.me/bg/111111-222222%20?rotation=180%20", background("111111-222222%20?rotation=180%20")); parse_internal_link("t.me/bg/111111~222222", background("111111~222222")); parse_internal_link("t.me/bg/abacaba", background("abacaba")); - parse_internal_link("t.me/Bg/abacaba", web_app("Bg", "abacaba", "")); + parse_internal_link("t.me/Bg/abacaba", web_app("Bg", "abacaba", "", false)); parse_internal_link("t.me/bg/111111~222222#asdasd", background("111111~222222")); parse_internal_link("t.me/bg/111111~222222?mode=blur", background("111111~222222")); parse_internal_link("t.me/bg/111111~222222?mode=blur&text=1", background("111111~222222")); @@ -599,6 +678,42 @@ TEST(Link, parse_internal_link_part2) { parse_internal_link("tg:invoice?slug=abc%30ef", invoice("abc0ef")); parse_internal_link("tg://invoice?slug=", unknown_deep_link("tg://invoice?slug=")); + parse_internal_link("t.me/giftcode?slug=abcdef", nullptr); + parse_internal_link("t.me/giftcode", nullptr); + parse_internal_link("t.me/giftcode/", nullptr); + parse_internal_link("t.me/giftcode//abcdef", nullptr); + parse_internal_link("t.me/giftcode?/abcdef", nullptr); + parse_internal_link("t.me/giftcode/?abcdef", nullptr); + parse_internal_link("t.me/giftcode/#abcdef", nullptr); + parse_internal_link("t.me/giftcode/abacaba", premium_gift_code("abacaba")); + parse_internal_link("t.me/giftcode/aba%20aba", premium_gift_code("aba aba")); + parse_internal_link("t.me/giftcode/123456a", premium_gift_code("123456a")); + parse_internal_link("t.me/giftcode/12345678901", premium_gift_code("12345678901")); + parse_internal_link("t.me/giftcode/123456", premium_gift_code("123456")); + parse_internal_link("t.me/giftcode/123456/123123/12/31/a/s//21w/?asdas#test", premium_gift_code("123456")); + + parse_internal_link("tg:giftcode?slug=abcdef", premium_gift_code("abcdef")); + parse_internal_link("tg:giftcode?slug=abc%30ef", premium_gift_code("abc0ef")); + parse_internal_link("tg://giftcode?slug=", unknown_deep_link("tg://giftcode?slug=")); + + parse_internal_link("t.me/m?slug=abcdef", nullptr); + parse_internal_link("t.me/m", nullptr); + parse_internal_link("t.me/m/", nullptr); + parse_internal_link("t.me/m//abcdef", nullptr); + parse_internal_link("t.me/m?/abcdef", nullptr); + parse_internal_link("t.me/m/?abcdef", nullptr); + parse_internal_link("t.me/m/#abcdef", nullptr); + parse_internal_link("t.me/m/abacaba", business_chat("abacaba")); + parse_internal_link("t.me/m/aba%20aba", business_chat("aba aba")); + parse_internal_link("t.me/m/123456a", business_chat("123456a")); + parse_internal_link("t.me/m/12345678901", business_chat("12345678901")); + parse_internal_link("t.me/m/123456", business_chat("123456")); + parse_internal_link("t.me/m/123456/123123/12/31/a/s//21w/?asdas#test", business_chat("123456")); + + parse_internal_link("tg:message?slug=abcdef", business_chat("abcdef")); + parse_internal_link("tg:message?slug=abc%30ef", business_chat("abc0ef")); + parse_internal_link("tg://message?slug=", unknown_deep_link("tg://message?slug=")); + parse_internal_link("tg:share?url=google.com&text=text#asdasd", message_draft("google.com\ntext", true)); parse_internal_link("tg:share?url=google.com&text=", message_draft("google.com", false)); parse_internal_link("tg:share?url=&text=google.com", message_draft("google.com", false)); @@ -702,10 +817,19 @@ TEST(Link, parse_internal_link_part2) { parse_internal_link("t.me/+123456?attach=&startattach", user_phone_number("123456")); parse_internal_link("t.me/+123456?attach=&startattach=1", user_phone_number("123456")); parse_internal_link("t.me/+123456?attach=bot", attachment_menu_bot(nullptr, user_phone_number("123456"), "bot", "")); - parse_internal_link("t.me/+123456?attach=bot&startattach", + parse_internal_link("t.me/+123456?attach=bot&startattach&profile", attachment_menu_bot(nullptr, user_phone_number("123456"), "bot", "")); parse_internal_link("t.me/+123456?attach=bot&startattach=1", attachment_menu_bot(nullptr, user_phone_number("123456"), "bot", "1")); + parse_internal_link("t.me/+123456?profile", user_phone_number("123456", "", true)); + parse_internal_link("t.me/+123456?profile&text=@asd", user_phone_number("123456", " @asd", true)); + + parse_internal_link("telegram.t.me?text=asd", public_chat("telegram", "asd")); + parse_internal_link("t.me/%2012345678901?text=asd", user_phone_number("12345678901", "asd")); + parse_internal_link("t.me/telegram?text=@asd", public_chat("telegram", " @asd")); + parse_internal_link("t.me/%2012345678901?text=@asd", user_phone_number("12345678901", " @asd")); + parse_internal_link("t.me/telegram?text=1%A02", public_chat("telegram")); + parse_internal_link("t.me/%2012345678901?text=1%A02", user_phone_number("12345678901")); parse_internal_link("t.me/addlist?invite=abcdef", nullptr); parse_internal_link("t.me/addlist", nullptr); @@ -965,25 +1089,26 @@ TEST(Link, parse_internal_link_part3) { parse_internal_link("tg:resolve?domain=username&startgroup=1&admin=delete_messages+anonymous", bot_start_in_group("username", "1", chat_administrator_rights(true, false, false, false, true, false, false, false, - false, false, false, true))); + false, false, false, false, false, false, true))); parse_internal_link( "tg:resolve?domain=username&startgroup&admin=manage_chat+change_info+post_messages+edit_messages+delete_messages+" - "invite_users+restrict_members+pin_messages+manage_topics+promote_members+manage_video_chats+anonymous", - bot_start_in_group( - "username", "", - chat_administrator_rights(true, true, false, false, true, true, true, true, true, true, true, true))); + "invite_users+restrict_members+pin_messages+manage_topics+promote_members+manage_video_chats+post_stories+edit_" + "stories+delete_stories+anonymous", + bot_start_in_group("username", "", + chat_administrator_rights(true, true, false, false, true, true, true, true, true, true, true, + true, true, true, true))); parse_internal_link("tg:resolve?domain=username&startchannel", public_chat("username")); parse_internal_link("tg:resolve?domain=username&startchannel&admin=", public_chat("username")); parse_internal_link( "tg:resolve?domain=username&startchannel&admin=post_messages", bot_add_to_channel("username", chat_administrator_rights(true, false, true, false, false, false, true, false, - false, false, false, false))); + false, false, false, false, false, false, false))); parse_internal_link( "tg:resolve?domain=username&startchannel&admin=manage_chat+change_info+post_messages+edit_messages+delete_" "messages+invite_users+restrict_members+pin_messages+manage_topics+promote_members+manage_video_chats+anonymous", bot_add_to_channel("username", chat_administrator_rights(true, true, true, true, true, true, true, false, false, - true, true, false))); + true, true, false, false, false, false))); parse_internal_link("t.me/username/0/a//s/as?startgroup=", bot_start_in_group("username", "", nullptr)); parse_internal_link("t.me/username/aasdas/2?test=1&startgroup=#12312", bot_start_in_group("username", "", nullptr)); @@ -1001,27 +1126,29 @@ TEST(Link, parse_internal_link_part3) { parse_internal_link("t.me/username?startgroup=1&admin=delete_messages+anonymous", bot_start_in_group("username", "1", chat_administrator_rights(true, false, false, false, true, false, false, false, - false, false, false, true))); + false, false, false, false, false, false, true))); parse_internal_link( "t.me/" "username?startgroup&admin=manage_chat+change_info+post_messages+edit_messages+delete_messages+invite_users+" - "restrict_members+pin_messages+manage_topics+promote_members+manage_video_chats+anonymous", - bot_start_in_group( - "username", "", - chat_administrator_rights(true, true, false, false, true, true, true, true, true, true, true, true))); + "restrict_members+pin_messages+manage_topics+promote_members+manage_video_chats+post_stories+edit_stories+delete_" + "stories+anonymous", + bot_start_in_group("username", "", + chat_administrator_rights(true, true, false, false, true, true, true, true, true, true, true, + true, true, true, true))); parse_internal_link("t.me/username?startchannel", public_chat("username")); parse_internal_link("t.me/username?startchannel&admin=", public_chat("username")); parse_internal_link( "t.me/username?startchannel&admin=post_messages", bot_add_to_channel("username", chat_administrator_rights(true, false, true, false, false, false, true, false, - false, false, false, false))); + false, false, false, false, false, false, false))); parse_internal_link( "t.me/" "username?startchannel&admin=manage_chat+change_info+post_messages+edit_messages+delete_messages+invite_users+" - "restrict_members+pin_messages+manage_topics+promote_members+manage_video_chats+anonymous", + "restrict_members+pin_messages+manage_topics+promote_members+manage_video_chats+post_stories+edit_stories+delete_" + "stories+anonymous", bot_add_to_channel("username", chat_administrator_rights(true, true, true, true, true, true, true, false, false, - true, true, false))); + true, true, true, true, true, false))); } TEST(Link, parse_internal_link_part4) { @@ -1046,8 +1173,33 @@ TEST(Link, parse_internal_link_part4) { parse_internal_link("t.me//username?game=asd", nullptr); parse_internal_link("https://telegram.dog/tele%63ram?game=t%63st", game("telecram", "tcst")); + parse_internal_link("tg:resolve?domain=username&story=123", story("username", 123)); + parse_internal_link("TG://resolve?domain=username&story=", public_chat("username")); + parse_internal_link("TG://resolve?domain=username&story=0", public_chat("username")); + parse_internal_link("TG://resolve?domain=username&story=-1", public_chat("username")); + parse_internal_link("TG://test@resolve?domain=username&story=1", nullptr); + parse_internal_link("tg:resolve:80?domain=username&story=1", nullptr); + parse_internal_link("tg:http://resolve?domain=username&story=1", nullptr); + parse_internal_link("tg:https://resolve?domain=username&story=1", nullptr); + parse_internal_link("tg:resolve?domain=&story=1", unknown_deep_link("tg://resolve?domain=&story=1")); + parse_internal_link("tg:resolve?domain=telegram&&&&&&&story=%30", public_chat("telegram")); + parse_internal_link("tg:resolve?domain=telegram&&&&&&&story=%31", story("telegram", 1)); + parse_internal_link("tg:resolve?domain=telegram&&&&&&&story=%31ab", public_chat("telegram")); + parse_internal_link("tg:resolve?domain=telegram&&&&&&&story=%31%39", story("telegram", 19)); + parse_internal_link("tg:resolve?domain=telegram&&&&&&&story=2222222222", public_chat("telegram")); + + parse_internal_link("t.me/username/s/1234", story("username", 1234)); + parse_internal_link("t.me/username/s/3?qwe=12312#12312", story("username", 3)); + parse_internal_link("t.me/username/s/1", story("username", 1)); + parse_internal_link("t.me/username/s/2", story("username", 2)); + parse_internal_link("t.me/username/s/5", story("username", 5)); + parse_internal_link("t.me/username/s/", public_chat("username")); + parse_internal_link("t.me/username#/s/123", public_chat("username")); + parse_internal_link("t.me/username?story=123", public_chat("username")); + parse_internal_link("https://telegram.dog/tele%63ram/s/%31%39", story("telecram", 19)); + parse_internal_link("tg:resolve?domain=username&appname=aasdasd&startapp=123asd", - web_app("username", "aasdasd", "123asd")); + web_app("username", "aasdasd", "123asd", false)); parse_internal_link("TG://resolve?domain=username&appname=&startapp=123asd", public_chat("username")); parse_internal_link("TG://test@resolve?domain=username&appname=asd", nullptr); parse_internal_link("tg:resolve:80?domain=username&appname=asd", nullptr); @@ -1056,7 +1208,10 @@ TEST(Link, parse_internal_link_part4) { parse_internal_link("tg:resolve?domain=&appname=asd", unknown_deep_link("tg://resolve?domain=&appname=asd")); parse_internal_link("tg:resolve?domain=telegram&&&&&&&appname=%41&startapp=", public_chat("telegram")); parse_internal_link("tg:resolve?domain=telegram&&&&&&&appname=%41b&startapp=", public_chat("telegram")); - parse_internal_link("tg:resolve?domain=telegram&&&&&&&appname=%41bc&startapp=", web_app("telegram", "Abc", "")); + parse_internal_link("tg:resolve?domain=telegram&&&&&&&appname=%41bc&startapp=", + web_app("telegram", "Abc", "", false)); + parse_internal_link("tg:resolve?domain=telegram&&&&&&&appname=%41bc&startapp=&mode=compact", + web_app("telegram", "Abc", "", true)); parse_internal_link("t.me/username/0/a//s/as?appname=asd", public_chat("username")); parse_internal_link("t.me/username/aasdas/2?test=1&appname=asd#12312", public_chat("username")); @@ -1068,12 +1223,35 @@ TEST(Link, parse_internal_link_part4) { parse_internal_link("t.me//username?appname=asd", nullptr); parse_internal_link("https://telegram.dog/tele%63ram?appname=t%63st", public_chat("telecram")); parse_internal_link("t.me/username/def/asd", public_chat("username")); - parse_internal_link("t.me/username/asd#12312&startapp=qwe", web_app("username", "asd", "")); - parse_internal_link("t.me/username/asd?12312&startapp=qwe", web_app("username", "asd", "qwe")); - parse_internal_link("t.me/username/asdasd?startapp=0", web_app("username", "asdasd", "0")); - parse_internal_link("t.me/username/asd", web_app("username", "asd", "")); + parse_internal_link("t.me/username/asd#12312&startapp=qwe", web_app("username", "asd", "", false)); + parse_internal_link("t.me/username/asd?12312&startapp=qwe&mode=compac", web_app("username", "asd", "qwe", false)); + parse_internal_link("t.me/username/asd?12312&startapp=qwe&mode=compact", web_app("username", "asd", "qwe", true)); + parse_internal_link("t.me/username/asdasd?startapp=0", web_app("username", "asdasd", "0", false)); + parse_internal_link("t.me/username/asd", web_app("username", "asd", "", false)); parse_internal_link("t.me/username/", public_chat("username")); - parse_internal_link("https://telegram.dog/tele%63ram/t%63st", web_app("telecram", "tcst", "")); + parse_internal_link("https://telegram.dog/tele%63ram/t%63st", web_app("telecram", "tcst", "", false)); + parse_internal_link("https://telegram.dog/tele%63ram/t%63st?mode=compact", web_app("telecram", "tcst", "", true)); + + parse_internal_link("tg:resolve?domain=username&startapp=aasdasd", main_web_app("username", "aasdasd", false)); + parse_internal_link("TG://resolve?domain=username&startapp=&startapp=123asd", main_web_app("username", "", false)); + parse_internal_link("TG://test@resolve?domain=username&startapp=asd", nullptr); + parse_internal_link("tg:resolve:80?domain=username&startapp=asd", nullptr); + parse_internal_link("tg:http://resolve?domain=username&startapp=asd", nullptr); + parse_internal_link("tg:https://resolve?domain=username&startapp=asd", nullptr); + parse_internal_link("tg:resolve?domain=&startapp=asd", unknown_deep_link("tg://resolve?domain=&startapp=asd")); + parse_internal_link("tg:resolve?domain=telegram&&&&&&&startapp=%41", main_web_app("telegram", "A", false)); + parse_internal_link("tg:resolve?domain=telegram&&&&&&&startapp=%41b", main_web_app("telegram", "Ab", false)); + parse_internal_link("tg:resolve?domain=telegram&&&&&&&startapp=%41bc", main_web_app("telegram", "Abc", false)); + parse_internal_link("tg:resolve?domain=telegram&&mode=compact&&&&&&startapp=%41bc", + main_web_app("telegram", "Abc", true)); + + parse_internal_link("t.me/username?startapp=qwe", main_web_app("username", "qwe", false)); + parse_internal_link("t.me/username?12312&startapp=qwe", main_web_app("username", "qwe", false)); + parse_internal_link("t.me/username?startapp=0", main_web_app("username", "0", false)); + parse_internal_link("https://telegram.dog/tele%63ram?startapp=t%63st", main_web_app("telecram", "tcst", false)); + parse_internal_link("https://telegram.dog/tele%63ram?startapp=t%63st&mode=%63ompact", + main_web_app("telecram", "tcst", true)); + parse_internal_link("https://telegram.dog?startapp=t%63st", nullptr); parse_internal_link("tg:resolve?domain=username&Game=asd", public_chat("username")); parse_internal_link("TG://test@resolve?domain=username", nullptr); @@ -1129,6 +1307,10 @@ TEST(Link, parse_internal_link_part4) { parse_internal_link("tg:premium_offer?ref=abc%30ef", premium_features("abc0ef")); parse_internal_link("tg://premium_offer?ref=", premium_features("")); + parse_internal_link("tg:premium_multigift?ref=abcdef", premium_gift("abcdef")); + parse_internal_link("tg:premium_multigift?ref=abc%30ef", premium_gift("abc0ef")); + parse_internal_link("tg://premium_multigift?ref=", premium_gift("")); + parse_internal_link("tg://settings", settings()); parse_internal_link("tg://setting", unknown_deep_link("tg://setting")); parse_internal_link("tg://settings?asdsa?D?SADasD?asD", settings()); @@ -1150,6 +1332,12 @@ TEST(Link, parse_internal_link_part4) { parse_internal_link("tg://settings/language", language_settings()); parse_internal_link("tg://settings/privacy", privacy_and_security_settings()); + parse_internal_link("tg://stars_topup", unknown_deep_link("tg://stars_topup")); + parse_internal_link("tg://stars_topup?balance=", unknown_deep_link("tg://stars_topup?balance=")); + parse_internal_link("tg://stars_topup?balance=test", buy_stars(1, "")); + parse_internal_link("tg://stars_topup?balance=10&purpose=%30test", buy_stars(10, "0test")); + parse_internal_link("tg://stars_topup?balance=100000000000&purpose=subs", buy_stars(100000000000, "subs")); + parse_internal_link("username.t.me////0/a//s/as?start=", bot_start("username", "")); parse_internal_link("username.t.me?start=as", bot_start("username", "as")); parse_internal_link("username.t.me", public_chat("username")); @@ -1162,15 +1350,24 @@ TEST(Link, parse_internal_link_part4) { parse_internal_link("aaa_.t.me/12345?single", nullptr); parse_internal_link("0aaa.t.me/12345?single", nullptr); parse_internal_link("_aaa.t.me/12345?single", nullptr); + parse_internal_link("a.t.me", nullptr); + parse_internal_link("b.t.me", nullptr); + parse_internal_link("k.t.me", nullptr); + parse_internal_link("z.t.me", nullptr); + parse_internal_link("web.t.me", nullptr); parse_internal_link("addemoji.t.me", nullptr); parse_internal_link("addlist.t.me", nullptr); parse_internal_link("addstickers.t.me", nullptr); parse_internal_link("addtheme.t.me", nullptr); parse_internal_link("auth.t.me", nullptr); + parse_internal_link("boost.t.me", nullptr); parse_internal_link("confirmphone.t.me", nullptr); + parse_internal_link("contact.t.me", nullptr); + parse_internal_link("giftcode.t.me", nullptr); parse_internal_link("invoice.t.me", nullptr); parse_internal_link("joinchat.t.me", nullptr); parse_internal_link("login.t.me", nullptr); + parse_internal_link("m.t.me", nullptr); parse_internal_link("proxy.t.me", nullptr); parse_internal_link("setlanguage.t.me", nullptr); parse_internal_link("share.t.me", nullptr); diff --git a/protocols/Telegram/tdlib/td/test/main.cpp b/protocols/Telegram/tdlib/td/test/main.cpp index 9a774b37db..6cd81fd421 100644 --- a/protocols/Telegram/tdlib/td/test/main.cpp +++ b/protocols/Telegram/tdlib/td/test/main.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/test/message_entities.cpp b/protocols/Telegram/tdlib/td/test/message_entities.cpp index 378e76b23a..64cd7dcca9 100644 --- a/protocols/Telegram/tdlib/td/test/message_entities.cpp +++ b/protocols/Telegram/tdlib/td/test/message_entities.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -29,7 +29,7 @@ static void check_mention(const td::string &str, const td::vector<td::string> &e result.push_back(it.str()); } if (result != expected) { - LOG(FATAL) << td::tag("text", str) << td::tag("got", td::format::as_array(result)) + LOG(FATAL) << td::tag("text", str) << td::tag("receive", td::format::as_array(result)) << td::tag("expected", td::format::as_array(expected)); } } @@ -60,7 +60,7 @@ static void check_bot_command(const td::string &str, const td::vector<td::string result.push_back(it.str()); } if (result != expected) { - LOG(FATAL) << td::tag("text", str) << td::tag("got", td::format::as_array(result)) + LOG(FATAL) << td::tag("text", str) << td::tag("receive", td::format::as_array(result)) << td::tag("expected", td::format::as_array(expected)); } } @@ -84,7 +84,7 @@ static void check_hashtag(const td::string &str, const td::vector<td::string> &e result.push_back(it.str()); } if (result != expected) { - LOG(FATAL) << td::tag("text", str) << td::tag("got", td::format::as_array(result)) + LOG(FATAL) << td::tag("text", str) << td::tag("receive", td::format::as_array(result)) << td::tag("expected", td::format::as_array(expected)); } } @@ -128,7 +128,7 @@ static void check_cashtag(const td::string &str, const td::vector<td::string> &e result.push_back(it.str()); } if (result != expected) { - LOG(FATAL) << td::tag("text", str) << td::tag("got", td::format::as_array(result)) + LOG(FATAL) << td::tag("text", str) << td::tag("receive", td::format::as_array(result)) << td::tag("expected", td::format::as_array(expected)); } } @@ -190,7 +190,7 @@ static void check_media_timestamp(const td::string &str, const td::vector<std::p auto result = td::transform(td::find_media_timestamps(str), [](auto &&entity) { return std::make_pair(entity.first.str(), entity.second); }); if (result != expected) { - LOG(FATAL) << td::tag("text", str) << td::tag("got", td::format::as_array(result)) + LOG(FATAL) << td::tag("text", str) << td::tag("receive", td::format::as_array(result)) << td::tag("expected", td::format::as_array(expected)); } } @@ -235,7 +235,7 @@ static void check_bank_card_number(const td::string &str, const td::vector<td::s result.push_back(it.str()); } if (result != expected) { - LOG(FATAL) << td::tag("text", str) << td::tag("got", td::format::as_array(result)) + LOG(FATAL) << td::tag("text", str) << td::tag("receive", td::format::as_array(result)) << td::tag("expected", td::format::as_array(expected)); } } @@ -284,7 +284,7 @@ static void check_tg_url(const td::string &str, const td::vector<td::string> &ex result.push_back(it.str()); } if (result != expected) { - LOG(FATAL) << td::tag("text", str) << td::tag("got", td::format::as_array(result)) + LOG(FATAL) << td::tag("text", str) << td::tag("receive", td::format::as_array(result)) << td::tag("expected", td::format::as_array(expected)); } } @@ -464,11 +464,11 @@ static void check_url(const td::string &str, const td::vector<td::string> &expec } } if (result_urls != expected_urls) { - LOG(FATAL) << td::tag("text", str) << td::tag("got", td::format::as_array(result_urls)) + LOG(FATAL) << td::tag("text", str) << td::tag("receive", td::format::as_array(result_urls)) << td::tag("expected", td::format::as_array(expected_urls)); } if (result_email_addresses != expected_email_addresses) { - LOG(FATAL) << td::tag("text", str) << td::tag("got", td::format::as_array(result_email_addresses)) + LOG(FATAL) << td::tag("text", str) << td::tag("receive", td::format::as_array(result_email_addresses)) << td::tag("expected", td::format::as_array(expected_email_addresses)); } } @@ -501,6 +501,10 @@ TEST(MessageEntities, url) { check_url("ftp://telegram.org", {"ftp://telegram.org"}); check_url("ftps://telegram.org", {}); check_url("sftp://telegram.org", {}); + check_url("tonsite://telegram.ton", {"tonsite://telegram.ton"}); + check_url("telegram.ton", {"telegram.ton"}); + check_url("telegram.onion", {"telegram.onion"}); + check_url("telegram.tonsite", {}); check_url("hTtPs://telegram.org", {"hTtPs://telegram.org"}); check_url("HTTP://telegram.org", {"HTTP://telegram.org"}); check_url("аHTTP://telegram.org", {"HTTP://telegram.org"}); @@ -787,17 +791,13 @@ TEST(MessageEntities, fix_formatted_text) { entities.emplace_back(td::MessageEntity::Type::Bold, 0, i); td::vector<td::MessageEntity> fixed_entities; - if (i != 33) { - fixed_entities.emplace_back(td::MessageEntity::Type::Bold, 32, i - 33); - } + fixed_entities.emplace_back(td::MessageEntity::Type::Bold, 0, i - 1 /* deleted \r */); check_fix_formatted_text(str, entities, fixed_str, fixed_entities, true, false, false, true); - td::string expected_str; + td::string expected_str = fixed_str.substr(0, 33); if (i != 33) { - fixed_entities.back().offset = 0; - fixed_entities.back().length = 1; + fixed_entities.back().length = 33; } - expected_str = "a"; check_fix_formatted_text(str, entities, expected_str, fixed_entities, false, false, false, false); } @@ -809,8 +809,13 @@ TEST(MessageEntities, fix_formatted_text) { check_fix_formatted_text(str, entities, true, true, true, true); check_fix_formatted_text(str, entities, false, false, false, false); } else { - check_fix_formatted_text(str, entities, str, {}, true, true, true, true); - check_fix_formatted_text(str, entities, str.substr(0, str.size() - 2), {}, false, false, false, false); + check_fix_formatted_text(str, entities, str, {{td::MessageEntity::Type::Bold, i, 1}}, true, true, true, true); + if (i == 2) { + check_fix_formatted_text(str, entities, str.substr(0, str.size() - 2), {{td::MessageEntity::Type::Bold, i, 1}}, + false, false, false, false); + } else { + check_fix_formatted_text(str, entities, str.substr(0, str.size() - 2), {}, false, false, false, false); + } } } @@ -850,18 +855,9 @@ TEST(MessageEntities, fix_formatted_text) { fixed_str = skip_trim ? "aba \n caba " : "aba \n caba"; auto fixed_length = offset <= 4 && offset + length >= 5 ? length - 1 : length; auto fixed_offset = offset >= 5 ? offset - 1 : offset; - if (static_cast<size_t>(fixed_offset) >= fixed_str.size()) { - fixed_length = 0; - } while (static_cast<size_t>(fixed_offset + fixed_length) > fixed_str.size()) { fixed_length--; } - if (type == td::MessageEntity::Type::Bold || type == td::MessageEntity::Type::Url) { - while (fixed_length > 0 && (fixed_str[fixed_offset] == ' ' || fixed_str[fixed_offset] == '\n')) { - fixed_offset++; - fixed_length--; - } - } td::vector<td::MessageEntity> entities; entities.emplace_back(type, offset, length); @@ -872,17 +868,11 @@ TEST(MessageEntities, fix_formatted_text) { } td::vector<td::MessageEntity> fixed_entities; if (fixed_length > 0) { - for (auto i = 0; i < length; i++) { - if (!td::is_space(str[offset + i]) || type == td::MessageEntity::Type::TextUrl || - type == td::MessageEntity::Type::MentionName) { - fixed_entities.emplace_back(type, fixed_offset, fixed_length); - if (type == td::MessageEntity::Type::TextUrl) { - fixed_entities.back().argument = "t.me"; - } else if (type == td::MessageEntity::Type::MentionName) { - fixed_entities.back().user_id = user_id; - } - break; - } + fixed_entities.emplace_back(type, fixed_offset, fixed_length); + if (type == td::MessageEntity::Type::TextUrl) { + fixed_entities.back().argument = "t.me"; + } else if (type == td::MessageEntity::Type::MentionName) { + fixed_entities.back().user_id = user_id; } } check_fix_formatted_text(str, entities, fixed_str, fixed_entities, true, false, false, skip_trim); @@ -904,13 +894,7 @@ TEST(MessageEntities, fix_formatted_text) { td::vector<td::MessageEntity> fixed_entities; if (length > 0) { - if (offset == 3) { - if (length >= 2) { - fixed_entities.emplace_back(td::MessageEntity::Type::Bold, offset + 1, length - 1); - } - } else { - fixed_entities.emplace_back(td::MessageEntity::Type::Bold, offset, length); - } + fixed_entities.emplace_back(td::MessageEntity::Type::Bold, offset, length); } check_fix_formatted_text(str, entities, str, fixed_entities, true, false, false, false); @@ -958,6 +942,9 @@ TEST(MessageEntities, fix_formatted_text) { if (i < 4) { fixed_entities.emplace_back(td::MessageEntity::Type::Bold, i * 3, 2); } + if (i < 3) { + fixed_entities.emplace_back(td::MessageEntity::Type::Italic, i * 3 + 2, 1); + } } check_fix_formatted_text(str, entities, td::utf8_utf16_substr(str, 3, 11).str(), fixed_entities, false, false, @@ -974,10 +961,10 @@ TEST(MessageEntities, fix_formatted_text) { check_fix_formatted_text("a \r", {{td::MessageEntity::Type::Bold, 0, 3}, {td::MessageEntity::Type::Underline, 2, 1}}, "a ", {{td::MessageEntity::Type::Bold, 0, 2}}, true, false, false, true); check_fix_formatted_text("a \r ", {{td::MessageEntity::Type::Bold, 0, 4}, {td::MessageEntity::Type::Underline, 2, 1}}, - "a ", {{td::MessageEntity::Type::Bold, 0, 2}}, true, false, false, true); - check_fix_formatted_text( - "a \r b", {{td::MessageEntity::Type::Bold, 0, 5}, {td::MessageEntity::Type::Underline, 2, 1}}, "a b", - {{td::MessageEntity::Type::Bold, 0, 2}, {td::MessageEntity::Type::Bold, 3, 1}}, true, false, false, true); + "a ", {{td::MessageEntity::Type::Bold, 0, 3}}, true, false, false, true); + check_fix_formatted_text("a \r b", + {{td::MessageEntity::Type::Bold, 0, 5}, {td::MessageEntity::Type::Underline, 2, 1}}, "a b", + {{td::MessageEntity::Type::Bold, 0, 4}}, true, false, false, true); check_fix_formatted_text("a\rbc\r", {{td::MessageEntity::Type::Italic, 0, 1}, @@ -1014,6 +1001,7 @@ TEST(MessageEntities, fix_formatted_text) { check_fix_formatted_text("@tests @tests", {{td::MessageEntity::Type::Italic, 0, 13}}, "@tests @tests", {{td::MessageEntity::Type::Mention, 0, 6}, {td::MessageEntity::Type::Italic, 0, 6}, + {td::MessageEntity::Type::Italic, 6, 1}, {td::MessageEntity::Type::Mention, 7, 6}, {td::MessageEntity::Type::Italic, 7, 6}}); @@ -1113,7 +1101,7 @@ TEST(MessageEntities, fix_formatted_text) { check_fix_formatted_text("example.com a", {{td::MessageEntity::Type::Italic, 0, 13}}, "example.com a", {{td::MessageEntity::Type::Url, 0, 11}, {td::MessageEntity::Type::Italic, 0, 11}, - {td::MessageEntity::Type::Italic, 12, 1}}); + {td::MessageEntity::Type::Italic, 11, 2}}); check_fix_formatted_text("a example.com", {{td::MessageEntity::Type::Italic, 0, 13}}, "a example.com", {{td::MessageEntity::Type::Italic, 0, 2}, {td::MessageEntity::Type::Url, 2, 11}, @@ -1134,7 +1122,7 @@ TEST(MessageEntities, fix_formatted_text) { auto n = td::Random::fast(1, 20); td::vector<td::MessageEntity> entities; for (int j = 0; j < n; j++) { - td::int32 type = td::Random::fast(4, 16); + td::int32 type = td::Random::fast(4, static_cast<int>(td::MessageEntity::Type::Size) - 1); td::int32 offset = td::Random::fast(0, static_cast<int>(str.size()) - 1); auto max_length = static_cast<int>(str.size() - offset); if ((test_n & 1) != 0 && max_length > 4) { @@ -1156,7 +1144,7 @@ TEST(MessageEntities, fix_formatted_text) { auto old_type_mask = get_type_mask(str.size(), entities); ASSERT_TRUE(td::fix_formatted_text(str, entities, false, false, true, true, false).is_ok()); auto new_type_mask = get_type_mask(str.size(), entities); - auto splittable_mask = (1 << 5) | (1 << 6) | (1 << 14) | (1 << 15); + auto splittable_mask = (1 << 5) | (1 << 6) | (1 << 14) | (1 << 15) | (1 << 19); auto pre_mask = (1 << 7) | (1 << 8) | (1 << 9); for (std::size_t pos = 0; pos < str.size(); pos++) { if ((new_type_mask[pos] & pre_mask) != 0) { @@ -1176,7 +1164,9 @@ TEST(MessageEntities, fix_formatted_text) { if (keep_url && ((1 << static_cast<td::int32>(entity.type)) & splittable_mask) == 0 && !(end <= url_offset || url_end <= offset)) { - keep_url = (entity.type == td::MessageEntity::Type::BlockQuote && offset <= url_offset && url_end <= end); + keep_url = ((entity.type == td::MessageEntity::Type::BlockQuote || + entity.type == td::MessageEntity::Type::ExpandableBlockQuote) && + offset <= url_offset && url_end <= end); } } ASSERT_EQ(keep_url, std::count(entities.begin(), entities.end(), url_entity) == 1); @@ -1199,7 +1189,8 @@ TEST(MessageEntities, fix_formatted_text) { // pre can't contain other entities ASSERT_TRUE((type_mask & pre_mask) == 0); - if ((type_mask & splittable_mask) == 0 && entities[i].type != td::MessageEntity::Type::BlockQuote) { + if ((type_mask & splittable_mask) == 0 && entities[i].type != td::MessageEntity::Type::BlockQuote && + entities[i].type != td::MessageEntity::Type::ExpandableBlockQuote) { // continuous entities can contain only splittable entities ASSERT_TRUE(((1 << static_cast<td::int32>(entities[j].type)) & splittable_mask) != 0); } @@ -1217,6 +1208,24 @@ TEST(MessageEntities, fix_formatted_text) { {}); } +TEST(MessageEntities, is_visible_url) { + td::string str = "a telegram.org telegran.org telegrao.org telegram.orc telegrap.org c"; + td::vector<td::MessageEntity> entities; + entities.emplace_back(td::MessageEntity::Type::TextUrl, 0, 1, "telegrab.org"); + entities.emplace_back(td::MessageEntity::Type::TextUrl, static_cast<td::int32>(str.size()) - 1, 1, "telegrax.org"); + td::fix_formatted_text(str, entities, false, false, false, false, true).ensure(); + td::FormattedText text{std::move(str), std::move(entities)}; + ASSERT_EQ(td::get_first_url(text), "telegrab.org"); + ASSERT_TRUE(!td::is_visible_url(text, "telegrab.org")); + ASSERT_TRUE(td::is_visible_url(text, "telegram.org")); + ASSERT_TRUE(td::is_visible_url(text, "telegran.org")); + ASSERT_TRUE(td::is_visible_url(text, "telegrao.org")); + ASSERT_TRUE(!td::is_visible_url(text, "telegram.orc")); + ASSERT_TRUE(td::is_visible_url(text, "telegrap.org")); + ASSERT_TRUE(!td::is_visible_url(text, "telegraf.org")); + ASSERT_TRUE(!td::is_visible_url(text, "telegrax.org")); +} + static void check_parse_html(td::string text, const td::string &result, const td::vector<td::MessageEntity> &entities) { auto r_entities = td::parse_html(text); ASSERT_TRUE(r_entities.is_ok()); @@ -1241,8 +1250,7 @@ TEST(MessageEntities, parse_html) { check_parse_html("🏟 🏟<<abac aba>", "Unsupported start tag \"abac\" at byte offset 13"); check_parse_html("🏟 🏟<<abac>", "Unsupported start tag \"abac\" at byte offset 13"); check_parse_html("🏟 🏟<<i =aba>", "Empty attribute name in the tag \"i\" at byte offset 13"); - check_parse_html("🏟 🏟<<i aba>", - "Expected equal sign in declaration of an attribute of the tag \"i\" at byte offset 13"); + check_parse_html("🏟 🏟<<i aba>", "Can't find end tag corresponding to start tag \"i\""); check_parse_html("🏟 🏟<<i aba = ", "Unclosed start tag \"i\" at byte offset 13"); check_parse_html("🏟 🏟<<i aba = 190azAz-.,", "Unexpected end of name token at byte offset 27"); check_parse_html("🏟 🏟<<i aba = \"<>">", "Unclosed start tag at byte offset 13"); @@ -1265,6 +1273,7 @@ TEST(MessageEntities, parse_html) { check_parse_html("➡️ ➡️<s>➡️ ➡️</s>", "➡️ ➡️➡️ ➡️", {{td::MessageEntity::Type::Strikethrough, 5, 5}}); check_parse_html("➡️ ➡️<strike>➡️ ➡️</strike>", "➡️ ➡️➡️ ➡️", {{td::MessageEntity::Type::Strikethrough, 5, 5}}); check_parse_html("➡️ ➡️<del>➡️ ➡️</del>", "➡️ ➡️➡️ ➡️", {{td::MessageEntity::Type::Strikethrough, 5, 5}}); + check_parse_html("➡️ ➡️<blockquote>➡️ ➡️</blockquote>", "➡️ ➡️➡️ ➡️", {{td::MessageEntity::Type::BlockQuote, 5, 5}}); check_parse_html("➡️ ➡️<i>➡️ ➡️</i><b>➡️ ➡️</b>", "➡️ ➡️➡️ ➡️➡️ ➡️", {{td::MessageEntity::Type::Italic, 5, 5}, {td::MessageEntity::Type::Bold, 10, 5}}); check_parse_html("🏟 🏟<i>🏟 <🏟</i>", "🏟 🏟🏟 <🏟", {{td::MessageEntity::Type::Italic, 5, 6}}); @@ -1349,11 +1358,22 @@ TEST(MessageEntities, parse_html) { check_parse_html("🏟 🏟<b aba = caba><tg-emoji emoji-id=\"1\">🏟</tg-emoji>1</b>", "🏟 🏟🏟1", {{td::MessageEntity::Type::Bold, 5, 3}, {td::MessageEntity::Type::CustomEmoji, 5, 2, td::CustomEmojiId(static_cast<td::int64>(1))}}); + check_parse_html("<blockquote cite=\"\" askdlbas nasjdbaj nj12b3>a<<pre >b;</></>", "a<b;", + {{td::MessageEntity::Type::BlockQuote, 0, 4}, {td::MessageEntity::Type::Pre, 2, 2}}); + check_parse_html("<blockquote expandable>a<<pre >b;</></>", "a<b;", + {{td::MessageEntity::Type::ExpandableBlockQuote, 0, 4}, {td::MessageEntity::Type::Pre, 2, 2}}); + check_parse_html("<blockquote expandable asd>a<<pre >b;</></>", "a<b;", + {{td::MessageEntity::Type::ExpandableBlockQuote, 0, 4}, {td::MessageEntity::Type::Pre, 2, 2}}); + check_parse_html("<blockquote expandable=false>a<<pre >b;</></>", "a<b;", + {{td::MessageEntity::Type::ExpandableBlockQuote, 0, 4}, {td::MessageEntity::Type::Pre, 2, 2}}); } static void check_parse_markdown(td::string text, const td::string &result, const td::vector<td::MessageEntity> &entities) { auto r_entities = td::parse_markdown_v2(text); + if (r_entities.is_error()) { + LOG(ERROR) << r_entities.error(); + } ASSERT_TRUE(r_entities.is_ok()); ASSERT_EQ(entities, r_entities.ok()); ASSERT_STREQ(result, text); @@ -1368,7 +1388,7 @@ static void check_parse_markdown(td::string text, td::Slice error_message) { TEST(MessageEntities, parse_markdown) { td::Slice reserved_characters("]()>#+-=|{}.!"); - td::Slice begin_characters("_*[~`"); + td::Slice begin_characters("_*[~`>"); for (char c = 1; c < 126; c++) { if (begin_characters.find(c) != td::Slice::npos) { continue; @@ -1405,6 +1425,7 @@ TEST(MessageEntities, parse_markdown) { check_parse_markdown("🏟 🏟__", "Can't find end of Underline entity at byte offset 9"); check_parse_markdown("🏟 🏟||test\\|", "Can't find end of Spoiler entity at byte offset 9"); check_parse_markdown("🏟 🏟!", "Character '!' is reserved and must be escaped with the preceding '\\'"); + check_parse_markdown("🏟 🏟>", "Character '>' is reserved and must be escaped with the preceding '\\'"); check_parse_markdown("🏟 🏟![", "Can't find end of CustomEmoji entity at byte offset 9"); check_parse_markdown("🏟 🏟![👍", "Can't find end of CustomEmoji entity at byte offset 9"); check_parse_markdown("🏟 🏟![👍]", "Custom emoji entity must contain a tg://emoji URL"); @@ -1414,6 +1435,12 @@ TEST(MessageEntities, parse_markdown) { check_parse_markdown("🏟 🏟![👍](tg://emoji#test)", "Custom emoji URL must have an emoji identifier"); check_parse_markdown("🏟 🏟![👍](tg://emoji?test=1#&id=25)", "Custom emoji URL must have an emoji identifier"); check_parse_markdown("🏟 🏟![👍](tg://emoji?test=1231&id=025)", "Invalid custom emoji identifier specified"); + check_parse_markdown(">*b\n>ld \n>bo\nld*\nasd\ndef", "Can't find end of Bold entity at byte offset 1"); + check_parse_markdown(">\n*a*>2", "Character '>' is reserved and must be escaped with the preceding '\\'"); + check_parse_markdown(">asd\n>q||e||w||\n||asdad", "Can't find end of Spoiler entity at byte offset 16"); + check_parse_markdown(">asd\n>q||ew\n||asdad", "Can't find end of Spoiler entity at byte offset 7"); + check_parse_markdown(">asd\n>q||e||w__\n||asdad", "Can't find end of Underline entity at byte offset 13"); + check_parse_markdown(">asd\n>q||e||w||a\n||asdad", "Can't find end of Spoiler entity at byte offset 13"); check_parse_markdown("", "", {}); check_parse_markdown("\\\\", "\\", {}); @@ -1478,6 +1505,71 @@ TEST(MessageEntities, parse_markdown) { {{0, 12, td::UserId(static_cast<td::int64>(123456))}}); check_parse_markdown("🏟 🏟![👍](TG://EMoJI/?test=1231&id=25#id=32)a", "🏟 🏟👍a", {{td::MessageEntity::Type::CustomEmoji, 5, 2, td::CustomEmojiId(static_cast<td::int64>(25))}}); + check_parse_markdown("> \n> \n>", " \n \n", {{td::MessageEntity::Type::BlockQuote, 0, 4}}); + check_parse_markdown("> \\>\n \\> \n>", " >\n > \n", {{td::MessageEntity::Type::BlockQuote, 0, 3}}); + check_parse_markdown("abc\n> \n> \n>\ndef", "abc\n \n \n\ndef", {{td::MessageEntity::Type::BlockQuote, 4, 5}}); + check_parse_markdown(">", "", {}); + check_parse_markdown(">a", "a", {{td::MessageEntity::Type::BlockQuote, 0, 1}}); + check_parse_markdown("\r>a", "\ra", {{td::MessageEntity::Type::BlockQuote, 1, 1}}); + check_parse_markdown("\r\r>\r\ra\r\n\r", "\r\r\r\ra\r\n\r", {{td::MessageEntity::Type::BlockQuote, 2, 5}}); + check_parse_markdown( + ">*bold _italic bold ~italic bold strikethrough ||italic bold strikethrough spoiler||~ __underline italic " + "bold___ bold*", + "bold italic bold italic bold strikethrough italic bold strikethrough spoiler underline italic bold bold", + {{td::MessageEntity::Type::BlockQuote, 0, 103}, + {td::MessageEntity::Type::Bold, 0, 103}, + {td::MessageEntity::Type::Italic, 5, 93}, + {td::MessageEntity::Type::Strikethrough, 17, 59}, + {td::MessageEntity::Type::Spoiler, 43, 33}, + {td::MessageEntity::Type::Underline, 77, 21}}); + check_parse_markdown(">*b\n>ld \n>bo\n>ld*\nasd\ndef", "b\nld \nbo\nld\nasd\ndef", + {{td::MessageEntity::Type::BlockQuote, 0, 12}, {td::MessageEntity::Type::Bold, 0, 11}}); + check_parse_markdown("*a\n>b\n>ld \n>bo\n>ld\nasd*\ndef", "a\nb\nld \nbo\nld\nasd\ndef", + {{td::MessageEntity::Type::Bold, 0, 17}, {td::MessageEntity::Type::BlockQuote, 2, 12}}); + check_parse_markdown(">`b\n>ld \n>bo\nld`\n>asd\ndef", "b\n>ld \n>bo\nld\nasd\ndef", + {{td::MessageEntity::Type::BlockQuote, 0, 18}, {td::MessageEntity::Type::Code, 0, 13}}); + check_parse_markdown("`>b\n>ld \n>bo\nld`\n>asd\ndef", ">b\n>ld \n>bo\nld\nasd\ndef", + {{td::MessageEntity::Type::Code, 0, 14}, {td::MessageEntity::Type::BlockQuote, 15, 4}}); + check_parse_markdown(">1", "1", {{td::MessageEntity::Type::BlockQuote, 0, 1}}); + check_parse_markdown(">\n1", "\n1", {{td::MessageEntity::Type::BlockQuote, 0, 1}}); + check_parse_markdown(">\n\r>2", "\n\r2", + {{td::MessageEntity::Type::BlockQuote, 0, 1}, {td::MessageEntity::Type::BlockQuote, 2, 1}}); + check_parse_markdown(">\n**>2", "\n2", + {{td::MessageEntity::Type::BlockQuote, 0, 1}, {td::MessageEntity::Type::BlockQuote, 1, 1}}); + check_parse_markdown(">**\n>2", "\n2", {{td::MessageEntity::Type::BlockQuote, 0, 2}}); + // check_parse_markdown("*>abcd*", "abcd", + // {{td::MessageEntity::Type::BlockQuote, 0, 4}, {td::MessageEntity::Type::Bold, 0, 4}}); + check_parse_markdown(">*abcd*", "abcd", + {{td::MessageEntity::Type::BlockQuote, 0, 4}, {td::MessageEntity::Type::Bold, 0, 4}}); + // check_parse_markdown(">*abcd\n*", "abcd\n", + // {{td::MessageEntity::Type::BlockQuote, 0, 5}, {td::MessageEntity::Type::Bold, 0, 5}}); + check_parse_markdown(">*abcd*\n", "abcd\n", + {{td::MessageEntity::Type::BlockQuote, 0, 5}, {td::MessageEntity::Type::Bold, 0, 4}}); + check_parse_markdown("*>abcd\n*", "abcd\n", + {{td::MessageEntity::Type::BlockQuote, 0, 5}, {td::MessageEntity::Type::Bold, 0, 5}}); + check_parse_markdown("abc\n>def\n>def\n\r>ghi2\njkl", "abc\ndef\ndef\n\rghi2\njkl", + {{td::MessageEntity::Type::BlockQuote, 4, 8}, {td::MessageEntity::Type::BlockQuote, 13, 5}}); + check_parse_markdown( + ">asd\n>q||e||w||\nasdad", "asd\nqew\nasdad", + {{td::MessageEntity::Type::ExpandableBlockQuote, 0, 8}, {td::MessageEntity::Type::Spoiler, 5, 1}}); + check_parse_markdown(">asd\n>q||ew||\nasdad", "asd\nqew\nasdad", + {{td::MessageEntity::Type::BlockQuote, 0, 8}, {td::MessageEntity::Type::Spoiler, 5, 2}}); + check_parse_markdown( + ">asd\r\n>q||e||w||\r\nasdad", "asd\r\nqew\r\nasdad", + {{td::MessageEntity::Type::ExpandableBlockQuote, 0, 10}, {td::MessageEntity::Type::Spoiler, 6, 1}}); + check_parse_markdown(">asd\r\n>q||ew||\r\nasdad", "asd\r\nqew\r\nasdad", + {{td::MessageEntity::Type::BlockQuote, 0, 10}, {td::MessageEntity::Type::Spoiler, 6, 2}}); + check_parse_markdown( + ">asd\r\n>q||e||w||\r\n", "asd\r\nqew\r\n", + {{td::MessageEntity::Type::ExpandableBlockQuote, 0, 10}, {td::MessageEntity::Type::Spoiler, 6, 1}}); + check_parse_markdown(">asd\r\n>q||ew||\r\n", "asd\r\nqew\r\n", + {{td::MessageEntity::Type::BlockQuote, 0, 10}, {td::MessageEntity::Type::Spoiler, 6, 2}}); + check_parse_markdown( + ">asd\r\n>q||e||w||", "asd\r\nqew", + {{td::MessageEntity::Type::ExpandableBlockQuote, 0, 8}, {td::MessageEntity::Type::Spoiler, 6, 1}}); + check_parse_markdown(">asd\r\n>q||ew||", "asd\r\nqew", + {{td::MessageEntity::Type::BlockQuote, 0, 8}, {td::MessageEntity::Type::Spoiler, 6, 2}}); + check_parse_markdown(">||", "", {}); } static void check_parse_markdown_v3(td::string text, td::vector<td::MessageEntity> entities, @@ -1628,8 +1720,8 @@ TEST(MessageEntities, parse_markdown_v3) { check_parse_markdown_v3("__ __", " ", {{td::MessageEntity::Type::Italic, 0, 1}}); check_parse_markdown_v3("__\n__", "\n", {{td::MessageEntity::Type::Italic, 0, 1}}); - check_parse_markdown_v3("__ __a", " a", {}, true); - check_parse_markdown_v3("__\n__a", "\na", {}, true); + check_parse_markdown_v3("__ __a", " a", {{td::MessageEntity::Type::Italic, 0, 1}}, true); + check_parse_markdown_v3("__\n__a", "\na", {{td::MessageEntity::Type::Italic, 0, 1}}, true); check_parse_markdown_v3("**** __a__ **b** ~~c~~ ||d||", "**** a b c d", {{td::MessageEntity::Type::Italic, 5, 1}, {td::MessageEntity::Type::Bold, 7, 1}, @@ -1764,9 +1856,10 @@ TEST(MessageEntities, parse_markdown_v3) { check_parse_markdown_v3( "__italic__ ~~strikethrough~~ **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold " "italic__bold**__italic__ ~~strikethrough~~ **bold** `code` ```pre``` __[italic__ text_url](telegram.org) " - "__italic**bold italic__bold** ||spoiler||", + "__italic**bold italic__bold** ||spoiler|| ```pre\nprecode``` init", + {{td::MessageEntity::Type::Italic, 271, 4}}, "italic strikethrough bold code pre italic text_url italicbold italicbolditalic strikethrough bold code pre " - "italic text_url italicbold italicbold spoiler", + "italic text_url italicbold italicbold spoiler precode init", {{td::MessageEntity::Type::Italic, 0, 6}, {td::MessageEntity::Type::Strikethrough, 7, 13}, {td::MessageEntity::Type::Bold, 21, 4}, @@ -1785,14 +1878,31 @@ TEST(MessageEntities, parse_markdown_v3) { {td::MessageEntity::Type::Italic, 107, 6}, {td::MessageEntity::Type::Italic, 123, 17}, {td::MessageEntity::Type::Bold, 129, 15}, - {td::MessageEntity::Type::Spoiler, 145, 7}}); + {td::MessageEntity::Type::Spoiler, 145, 7}, + {td::MessageEntity::Type::PreCode, 153, 7, "pre"}, + {td::MessageEntity::Type::Italic, 161, 4}}); + check_parse_markdown_v3("```\nsome code\n```", "some code\n", {{td::MessageEntity::Type::Pre, 0, 10}}); + check_parse_markdown_v3("asd\n```\nsome code\n```cabab", "asd\nsome code\ncabab", + {{td::MessageEntity::Type::Pre, 4, 10}}); + check_parse_markdown_v3("asd\naba```\nsome code\n```cabab", "asd\nabasome code\ncabab", + {{td::MessageEntity::Type::Pre, 7, 10}}); + check_parse_markdown_v3("asd\naba```\nsome code\n```\ncabab", "asd\nabasome code\n\ncabab", + {{td::MessageEntity::Type::Pre, 7, 10}}); + check_parse_markdown_v3("asd\naba```a b\nsome code\n```\ncabab", "asd\nabaa b\nsome code\n\ncabab", + {{td::MessageEntity::Type::Pre, 7, 14}}); + check_parse_markdown_v3("asd\naba```a!@#$%^&*(b\nsome code\n```\ncabab", "asd\nabasome code\n\ncabab", + {{td::MessageEntity::Type::PreCode, 7, 10, "a!@#$%^&*(b"}}); + check_parse_markdown_v3("```aba\n```", "aba\n", {{td::MessageEntity::Type::Pre, 0, 4}}); + check_parse_markdown_v3("```\n```", "\n", {{td::MessageEntity::Type::Pre, 0, 1}}); + check_parse_markdown_v3("```\n```", {{td::MessageEntity::Type::BlockQuote, 0, 7}}, "\n", + {{td::MessageEntity::Type::BlockQuote, 0, 1}, {td::MessageEntity::Type::Pre, 0, 1}}); td::vector<td::string> parts{"a", " #test__a", "__", "**", "~~", "||", "[", "](t.me)", "`"}; td::vector<td::MessageEntity::Type> types{ td::MessageEntity::Type::Bold, td::MessageEntity::Type::Italic, td::MessageEntity::Type::Underline, td::MessageEntity::Type::Strikethrough, td::MessageEntity::Type::Spoiler, td::MessageEntity::Type::Code, td::MessageEntity::Type::Pre, td::MessageEntity::Type::PreCode, td::MessageEntity::Type::TextUrl, - td::MessageEntity::Type::MentionName, td::MessageEntity::Type::Cashtag}; + td::MessageEntity::Type::MentionName, td::MessageEntity::Type::Cashtag, td::MessageEntity::Type::BlockQuote}; for (size_t test_n = 0; test_n < 1000; test_n++) { td::string str; int part_n = td::Random::fast(1, 200); @@ -1836,7 +1946,7 @@ static void check_get_markdown_v3(const td::string &result_text, const td::vecto } TEST(MessageEntities, get_markdown_v3) { - check_get_markdown_v3("``` ```", {}, " ", {{td::MessageEntity::Type::Pre, 0, 1}}); + check_get_markdown_v3("```\n ```", {}, " ", {{td::MessageEntity::Type::Pre, 0, 1}}); check_get_markdown_v3("` `", {}, " ", {{td::MessageEntity::Type::Code, 0, 1}}); check_get_markdown_v3("`\n`", {}, "\n", {{td::MessageEntity::Type::Code, 0, 1}}); check_get_markdown_v3("ab", {{td::MessageEntity::Type::Code, 0, 1}, {td::MessageEntity::Type::Pre, 1, 1}}, "ab", @@ -1851,16 +1961,18 @@ TEST(MessageEntities, get_markdown_v3) { check_get_markdown_v3("** **", {}, " ", {{td::MessageEntity::Type::Bold, 0, 1}}); check_get_markdown_v3("~~ ~~", {}, " ", {{td::MessageEntity::Type::Strikethrough, 0, 1}}); check_get_markdown_v3("|| ||", {}, " ", {{td::MessageEntity::Type::Spoiler, 0, 1}}); - check_get_markdown_v3("__a__ **b** ~~c~~ ||d|| e", {{td::MessageEntity::Type::PreCode, 24, 1, "C++"}}, "a b c d e", + check_get_markdown_v3("__a__ **b** ~~c~~ ||d|| e", {{td::MessageEntity::Type::PreCode, 24, 1, " C++"}}, "a b c d e", {{td::MessageEntity::Type::Italic, 0, 1}, {td::MessageEntity::Type::Bold, 2, 1}, {td::MessageEntity::Type::Strikethrough, 4, 1}, {td::MessageEntity::Type::Spoiler, 6, 1}, - {td::MessageEntity::Type::PreCode, 8, 1, "C++"}}); - check_get_markdown_v3("`ab` ```cd``` ef", {{td::MessageEntity::Type::PreCode, 14, 2, "C++"}}, "ab cd ef", - {{td::MessageEntity::Type::Code, 0, 2}, - {td::MessageEntity::Type::Pre, 3, 2}, - {td::MessageEntity::Type::PreCode, 6, 2, "C++"}}); + {td::MessageEntity::Type::PreCode, 8, 1, " C++"}}); + check_get_markdown_v3("```cpp\ngh```\n`ab`\n```\ncd```\nef", {{td::MessageEntity::Type::PreCode, 28, 2, " C++"}}, + "gh\nab\ncd\nef", + {{td::MessageEntity::Type::PreCode, 0, 2, "cpp"}, + {td::MessageEntity::Type::Code, 3, 2}, + {td::MessageEntity::Type::Pre, 6, 2}, + {td::MessageEntity::Type::PreCode, 9, 2, " C++"}}); check_get_markdown_v3("__asd__[__ab__cd](http://t.me/)", {}, "asdabcd", {{td::MessageEntity::Type::Italic, 0, 3}, {td::MessageEntity::Type::TextUrl, 3, 4, "http://t.me/"}, @@ -1879,4 +1991,19 @@ TEST(MessageEntities, get_markdown_v3) { {{td::MessageEntity::Type::TextUrl, 0, 16, "http://example.com/"}, {td::MessageEntity::Type::Bold, 0, 16}, {td::MessageEntity::Type::Italic, 0, 16}}); + check_get_markdown_v3("```\nsome code\n```", {}, "some code\n", {{td::MessageEntity::Type::Pre, 0, 10}}); + check_get_markdown_v3("asd\n```\nsome code\n```cabab", {}, "asd\nsome code\ncabab", + {{td::MessageEntity::Type::Pre, 4, 10}}); + check_get_markdown_v3("asd\naba```\nsome code\n```cabab", {}, "asd\nabasome code\ncabab", + {{td::MessageEntity::Type::Pre, 7, 10}}); + check_get_markdown_v3("asd\naba```\nsome code\n```\ncabab", {}, "asd\nabasome code\n\ncabab", + {{td::MessageEntity::Type::Pre, 7, 10}}); + check_get_markdown_v3("asd\naba```\na b\nsome code\n```\ncabab", {}, "asd\nabaa b\nsome code\n\ncabab", + {{td::MessageEntity::Type::Pre, 7, 14}}); + check_get_markdown_v3("asd\n```\na b\nsome code\n```\ncabab", {}, "asd\na b\nsome code\n\ncabab", + {{td::MessageEntity::Type::Pre, 4, 14}}); + check_get_markdown_v3("asd\naba```a!@#$%^&*(b\nsome code\n```\ncabab", {}, "asd\nabasome code\n\ncabab", + {{td::MessageEntity::Type::PreCode, 7, 10, "a!@#$%^&*(b"}}); + check_get_markdown_v3("```\naba\n```", {}, "aba\n", {{td::MessageEntity::Type::Pre, 0, 4}}); + check_get_markdown_v3("```\n```", {}, "\n", {{td::MessageEntity::Type::Pre, 0, 1}}); } diff --git a/protocols/Telegram/tdlib/td/test/mtproto.cpp b/protocols/Telegram/tdlib/td/test/mtproto.cpp index 614e153e6f..72d1af5d73 100644 --- a/protocols/Telegram/tdlib/td/test/mtproto.cpp +++ b/protocols/Telegram/tdlib/td/test/mtproto.cpp @@ -1,14 +1,13 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #include "td/telegram/ConfigManager.h" -#include "td/telegram/net/DcId.h" -#include "td/telegram/net/PublicRsaKeyShared.h" -#include "td/telegram/net/Session.h" +#include "td/telegram/net/PublicRsaKeySharedMain.h" #include "td/telegram/NotificationManager.h" +#include "td/telegram/telegram_api.h" #include "td/mtproto/AuthData.h" #include "td/mtproto/DhCallback.h" @@ -34,6 +33,7 @@ #include "td/utils/BufferedFd.h" #include "td/utils/common.h" #include "td/utils/crypto.h" +#include "td/utils/HttpDate.h" #include "td/utils/logging.h" #include "td/utils/port/Clocks.h" #include "td/utils/port/IPAddress.h" @@ -46,6 +46,8 @@ #include "td/utils/tests.h" #include "td/utils/Time.h" +#include <memory> + TEST(Mtproto, GetHostByNameActor) { int threads_n = 1; td::ConcurrentScheduler sched(threads_n, 0); @@ -194,7 +196,7 @@ TEST(Mtproto, encrypted_config) { "FnWWdEV+BPJeOTk+ARHcNkuJBt0CqnfcVCoDOpKqGyq0U31s2MOpQvHgAG+Tlpg02syuH0E4dCGRw5CbJPARiynteb9y5fT5x/" "kmdp6BMR5tWQSQF0liH16zLh8BDSIdiMsikdcwnAvBwdNhRqQBqGx9MTh62MDmlebjtczE9Gz0z5cscUO2yhzGdphgIy6SP+" "bwaqLWYF0XdPGjKLMUEJW+rou6fbL1t/EUXPtU0XmQAnO0Fh86h+AqDMOe30N4qKrPQ== "; - auto config = td::decode_config(data).move_as_ok(); + td::telegram_api::object_ptr<td::telegram_api::help_configSimple> config = td::decode_config(data).move_as_ok(); } class TestPingActor final : public td::Actor { @@ -300,11 +302,11 @@ class HandshakeContext final : public td::mtproto::AuthKeyHandshakeContext { return nullptr; } td::mtproto::PublicRsaKeyInterface *get_public_rsa_key_interface() final { - return &public_rsa_key; + return public_rsa_key_.get(); } private: - td::PublicRsaKeyShared public_rsa_key{td::DcId::empty(), true}; + std::shared_ptr<td::mtproto::PublicRsaKeyInterface> public_rsa_key_ = td::PublicRsaKeySharedMain::create(true); }; class HandshakeTestActor final : public td::Actor { @@ -365,11 +367,11 @@ class HandshakeTestActor final : public td::Actor { 10.0, td::PromiseCreator::lambda( [actor_id = actor_id(this)](td::Result<td::unique_ptr<td::mtproto::RawConnection>> raw_connection) { - td::send_closure(actor_id, &HandshakeTestActor::got_connection, std::move(raw_connection), 1); + td::send_closure(actor_id, &HandshakeTestActor::on_connection, std::move(raw_connection), 1); }), td::PromiseCreator::lambda( [actor_id = actor_id(this)](td::Result<td::unique_ptr<td::mtproto::AuthKeyHandshake>> handshake) { - td::send_closure(actor_id, &HandshakeTestActor::got_handshake, std::move(handshake), 1); + td::send_closure(actor_id, &HandshakeTestActor::on_handshake, std::move(handshake), 1); })) .release(); wait_for_raw_connection_ = true; @@ -377,7 +379,7 @@ class HandshakeTestActor final : public td::Actor { } } - void got_connection(td::Result<td::unique_ptr<td::mtproto::RawConnection>> r_raw_connection, bool dummy) { + void on_connection(td::Result<td::unique_ptr<td::mtproto::RawConnection>> r_raw_connection, bool dummy) { CHECK(wait_for_raw_connection_); wait_for_raw_connection_ = false; if (r_raw_connection.is_ok()) { @@ -390,7 +392,7 @@ class HandshakeTestActor final : public td::Actor { loop(); } - void got_handshake(td::Result<td::unique_ptr<td::mtproto::AuthKeyHandshake>> r_handshake, bool dummy) { + void on_handshake(td::Result<td::unique_ptr<td::mtproto::AuthKeyHandshake>> r_handshake, bool dummy) { CHECK(wait_for_handshake_); wait_for_handshake_ = false; CHECK(r_handshake.is_ok()); @@ -553,16 +555,16 @@ class FastPingTestActor final : public td::Actor { "HandshakeActor", std::move(handshake), std::move(raw_connection), td::make_unique<HandshakeContext>(), 10.0, td::PromiseCreator::lambda( [actor_id = actor_id(this)](td::Result<td::unique_ptr<td::mtproto::RawConnection>> raw_connection) { - td::send_closure(actor_id, &FastPingTestActor::got_connection, std::move(raw_connection), 1); + td::send_closure(actor_id, &FastPingTestActor::on_connection, std::move(raw_connection), 1); }), td::PromiseCreator::lambda( [actor_id = actor_id(this)](td::Result<td::unique_ptr<td::mtproto::AuthKeyHandshake>> handshake) { - td::send_closure(actor_id, &FastPingTestActor::got_handshake, std::move(handshake), 1); + td::send_closure(actor_id, &FastPingTestActor::on_handshake, std::move(handshake), 1); })) .release(); } - void got_connection(td::Result<td::unique_ptr<td::mtproto::RawConnection>> r_raw_connection, bool dummy) { + void on_connection(td::Result<td::unique_ptr<td::mtproto::RawConnection>> r_raw_connection, bool dummy) { if (r_raw_connection.is_error()) { *result_ = r_raw_connection.move_as_error(); LOG(INFO) << "Receive " << *result_ << " instead of a connection"; @@ -572,7 +574,7 @@ class FastPingTestActor final : public td::Actor { loop(); } - void got_handshake(td::Result<td::unique_ptr<td::mtproto::AuthKeyHandshake>> r_handshake, bool dummy) { + void on_handshake(td::Result<td::unique_ptr<td::mtproto::AuthKeyHandshake>> r_handshake, bool dummy) { if (r_handshake.is_error()) { *result_ = r_handshake.move_as_error(); LOG(INFO) << "Receive " << *result_ << " instead of a handshake"; @@ -582,7 +584,7 @@ class FastPingTestActor final : public td::Actor { loop(); } - void got_raw_connection(td::Result<td::unique_ptr<td::mtproto::RawConnection>> r_connection) { + void on_raw_connection(td::Result<td::unique_ptr<td::mtproto::RawConnection>> r_connection) { if (r_connection.is_error()) { *result_ = r_connection.move_as_error(); LOG(INFO) << "Receive " << *result_ << " instead of a handshake"; @@ -619,7 +621,7 @@ class FastPingTestActor final : public td::Actor { td::Slice(), std::move(connection_), std::move(auth_data), td::PromiseCreator::lambda( [actor_id = actor_id(this)](td::Result<td::unique_ptr<td::mtproto::RawConnection>> r_raw_connection) { - td::send_closure(actor_id, &FastPingTestActor::got_raw_connection, std::move(r_raw_connection)); + td::send_closure(actor_id, &FastPingTestActor::on_raw_connection, std::move(r_raw_connection)); }), td::ActorShared<>()); } diff --git a/protocols/Telegram/tdlib/td/test/online.cpp b/protocols/Telegram/tdlib/td/test/online.cpp index de7afa8a66..db5faa8771 100644 --- a/protocols/Telegram/tdlib/td/test/online.cpp +++ b/protocols/Telegram/tdlib/td/test/online.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -224,7 +224,9 @@ class InitTask : public Task { void start_up() override { send_query(td::make_tl_object<td::td_api::getOption>("version"), - [](auto res) { LOG(INFO) << td::td_api::to_string(res.ok()); }); + [](td::Result<td::td_api::object_ptr<td::td_api::OptionValue>> res) { + LOG(INFO) << td::td_api::to_string(res.ok()); + }); } void process_authorization_state(td::tl_object_ptr<td::td_api::Object> authorization_state) { td::tl_object_ptr<td::td_api::Function> function; @@ -244,7 +246,6 @@ class InitTask : public Task { request->system_language_code_ = "en"; request->device_model_ = "Desktop"; request->application_version_ = "tdclient-test"; - request->enable_storage_optimizer_ = true; send(std::move(request)); break; } @@ -258,7 +259,7 @@ class InitTask : public Task { } template <class T> void send(T &&query) { - send_query(std::move(query), [this](auto res) { + send_query(std::move(query), [this](td::Result<typename T::element_type::ReturnType> res) { if (is_alive()) { res.ensure(); } @@ -284,7 +285,9 @@ class GetMe : public Task { explicit GetMe(Promise<Result> promise) : promise_(std::move(promise)) { } void start_up() override { - send_query(td::make_tl_object<td::td_api::getMe>(), [this](auto res) { with_user_id(res.move_as_ok()->id_); }); + send_query( + td::make_tl_object<td::td_api::getMe>(), + [this](td::Result<td::td_api::object_ptr<td::td_api::user>> res) { with_user_id(res.move_as_ok()->id_); }); } private: @@ -293,8 +296,9 @@ class GetMe : public Task { void with_user_id(int64 user_id) { result_.user_id = user_id; - send_query(td::make_tl_object<td::td_api::createPrivateChat>(user_id, false), - [this](auto res) { with_chat_id(res.move_as_ok()->id_); }); + send_query( + td::make_tl_object<td::td_api::createPrivateChat>(user_id, false), + [this](td::Result<td::td_api::object_ptr<td::td_api::chat>> res) { with_chat_id(res.move_as_ok()->id_); }); } void with_chat_id(int64 chat_id) { @@ -333,11 +337,11 @@ class UploadFile : public Task { write_file(content_path_, content_).ensure(); send_query(td::make_tl_object<td::td_api::sendMessage>( - chat_id_, 0, 0, nullptr, nullptr, + chat_id_, 0, nullptr, nullptr, nullptr, td::make_tl_object<td::td_api::inputMessageDocument>( td::make_tl_object<td::td_api::inputFileLocal>(content_path_), nullptr, true, td::make_tl_object<td::td_api::formattedText>("tag", td::Auto()))), - [this](auto res) { with_message(res.move_as_ok()); }); + [this](td::Result<td::td_api::object_ptr<td::td_api::message>> res) { with_message(res.move_as_ok()); }); } private: @@ -393,7 +397,7 @@ class TestDownloadFile : public Task { } void start_up() override { send_query(td::make_tl_object<td::td_api::getRemoteFile>(remote_id_, nullptr), - [this](auto res) { start_file(*res.ok()); }); + [this](td::Result<td::td_api::object_ptr<td::td_api::file>> res) { start_file(*res.ok()); }); } private: @@ -455,7 +459,7 @@ class TestDownloadFile : public Task { send_query(td::make_tl_object<td::td_api::downloadFile>( file_id_, 1, static_cast<int64>(ranges_.back().begin), static_cast<int64>(ranges_.back().end - ranges_.back().begin), true), - [this](auto res) { on_get_chunk(*res.ok()); }); + [this](td::Result<td::td_api::object_ptr<td::td_api::file>> res) { on_get_chunk(*res.ok()); }); } }; diff --git a/protocols/Telegram/tdlib/td/test/poll.cpp b/protocols/Telegram/tdlib/td/test/poll.cpp index 3629c3c136..757d9c0eda 100644 --- a/protocols/Telegram/tdlib/td/test/poll.cpp +++ b/protocols/Telegram/tdlib/td/test/poll.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/test/query_merger.cpp b/protocols/Telegram/tdlib/td/test/query_merger.cpp index becac44e65..1211407082 100644 --- a/protocols/Telegram/tdlib/td/test/query_merger.cpp +++ b/protocols/Telegram/tdlib/td/test/query_merger.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -70,7 +70,8 @@ class TestQueryMerger final : public td::Actor { } else { yield(); } - })); + }), + "TestQueryMerger::loop"); } } diff --git a/protocols/Telegram/tdlib/td/test/secret.cpp b/protocols/Telegram/tdlib/td/test/secret.cpp index bd54705695..48523ec27b 100644 --- a/protocols/Telegram/tdlib/td/test/secret.cpp +++ b/protocols/Telegram/tdlib/td/test/secret.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -9,8 +9,11 @@ #include "td/telegram/Global.h" #include "td/telegram/logevent/LogEvent.h" #include "td/telegram/MessageId.h" +#include "td/telegram/net/NetQuery.h" +#include "td/telegram/net/NetQueryCreator.h" #include "td/telegram/secret_api.h" #include "td/telegram/SecretChatActor.h" +#include "td/telegram/SecretChatDb.h" #include "td/telegram/SecretChatId.h" #include "td/telegram/telegram_api.h" #include "td/telegram/UserId.h" @@ -66,7 +69,7 @@ class messages_getDhConfig { messages_getDhConfig() = default; - messages_getDhConfig(int32 version_, int32 random_length_); + messages_getDhConfig(int32 version, int32 random_length); static const int32 ID = 651135312; @@ -225,8 +228,8 @@ class messages_dhConfig final { messages_dhConfig() = default; - messages_dhConfig(int32 g_, BufferSlice &&p_, int32 version_, BufferSlice &&random_) - : g_(g_), p_(std::move(p_)), version_(version_), random_(std::move(random_)) { + messages_dhConfig(int32 g, BufferSlice &&p, int32 version, BufferSlice &&random) + : g_(g), p_(std::move(p)), version_(version), random_(std::move(random)) { } static const int32 ID = 740433629; @@ -249,6 +252,7 @@ class messages_dhConfig final { TlStoreString::store(random_, s); } }; +const int32 messages_dhConfig::ID; class encryptedChat final { public: @@ -262,15 +266,15 @@ class encryptedChat final { encryptedChat() = default; - encryptedChat(int32 id_, int64 access_hash_, int32 date_, int64 admin_id_, int64 participant_id_, - BufferSlice &&g_a_or_b_, int64 key_fingerprint_) - : id_(id_) - , access_hash_(access_hash_) - , date_(date_) - , admin_id_(admin_id_) - , participant_id_(participant_id_) - , g_a_or_b_(std::move(g_a_or_b_)) - , key_fingerprint_(key_fingerprint_) { + encryptedChat(int32 id, int64 access_hash, int32 date, int64 admin_id, int64 participant_id, BufferSlice &&g_a_or_b, + int64 key_fingerprint) + : id_(id) + , access_hash_(access_hash) + , date_(date) + , admin_id_(admin_id) + , participant_id_(participant_id) + , g_a_or_b_(std::move(g_a_or_b)) + , key_fingerprint_(key_fingerprint) { } static const int32 ID = -94974410; @@ -300,6 +304,7 @@ class encryptedChat final { TlStoreBinary::store(key_fingerprint_, s); } }; +const int32 encryptedChat::ID; class messages_sentEncryptedMessage final { public: @@ -307,7 +312,7 @@ class messages_sentEncryptedMessage final { messages_sentEncryptedMessage() = default; - explicit messages_sentEncryptedMessage(int32 date_) : date_(date_) { + explicit messages_sentEncryptedMessage(int32 date) : date_(date) { } static const int32 ID = 1443858741; @@ -361,7 +366,7 @@ class FakeBinlog final FakeBinlog() { register_actor("FakeBinlog", this).release(); } - void force_sync(Promise<> promise) final { + void force_sync(Promise<> promise, const char *source) final { if (pending_events_.empty()) { pending_events_.emplace_back(); } @@ -527,7 +532,7 @@ class FakeSecretChatContext final : public SecretChatActor::Context { return false; } - // We don't want to expose the whole NetQueryDispatcher, MessagesManager and ContactsManager. + // We don't want to expose the whole NetQueryDispatcher, MessagesManager and UserManager. // So it is more clear which parts of MessagesManager is really used. And it is much easier to create tests. void send_net_query(NetQueryPtr query, ActorShared<NetQueryCallback> callback, bool ordered) final; @@ -636,7 +641,7 @@ class Master final : public Actor { if (binlog_generation != binlog_generation_) { return promise.set_error(Status::Error("Binlog generation mismatch")); } - binlog_->force_sync(std::move(promise)); + binlog_->force_sync(std::move(promise), "sync_binlog"); } void on_closed() { LOG(INFO) << "CLOSED"; diff --git a/protocols/Telegram/tdlib/td/test/secure_storage.cpp b/protocols/Telegram/tdlib/td/test/secure_storage.cpp index 714e92f77a..e115e751b8 100644 --- a/protocols/Telegram/tdlib/td/test/secure_storage.cpp +++ b/protocols/Telegram/tdlib/td/test/secure_storage.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/test/set_with_position.cpp b/protocols/Telegram/tdlib/td/test/set_with_position.cpp index f8494b392b..ca2742f8ce 100644 --- a/protocols/Telegram/tdlib/td/test/set_with_position.cpp +++ b/protocols/Telegram/tdlib/td/test/set_with_position.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/protocols/Telegram/tdlib/td/test/string_cleaning.cpp b/protocols/Telegram/tdlib/td/test/string_cleaning.cpp index c597d7616c..a1bb9e989b 100644 --- a/protocols/Telegram/tdlib/td/test/string_cleaning.cpp +++ b/protocols/Telegram/tdlib/td/test/string_cleaning.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -112,4 +112,8 @@ TEST(StringCleaning, strip_empty_characters) { check_strip_empty_characters( "\xe2\x80\xa7\xe2\x80\xa8\xe2\x80\xa9\xe2\x80\xaa\xe2\x80\xab\xe2\x80\xac\xe2\x80\xad\xe2\x80\xae", 3, "\xe2\x80\xa7\xe2\x80\xa8\xe2\x80\xa9"); + check_strip_empty_characters( + "\xF3\x9F\xBF\xBF\xF3\xA0\x80\x80\xF3\xA0\x80\x81\xF3\xA0\x80\xBF\xF3\xA0\x81\x80\xF3\xA0\x81\x81\xF3\xA0\x81\xBF" + "\xF3\xA0\x82\x80", + 9, "\xF3\x9F\xBF\xBF \xF3\xA0\x82\x80"); } diff --git a/protocols/Telegram/tdlib/td/test/tdclient.cpp b/protocols/Telegram/tdlib/td/test/tdclient.cpp index a608c75593..66f0ae6154 100644 --- a/protocols/Telegram/tdlib/td/test/tdclient.cpp +++ b/protocols/Telegram/tdlib/td/test/tdclient.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -224,7 +224,7 @@ class DoAuthentication final : public TestClinetTask { function = td::make_tl_object<td::td_api::checkAuthenticationCode>(code_); break; case td::td_api::authorizationStateWaitRegistration::ID: - function = td::make_tl_object<td::td_api::registerUser>(name_, ""); + function = td::make_tl_object<td::td_api::registerUser>(name_, "", false); break; case td::td_api::authorizationStateWaitTdlibParameters::ID: { auto request = td::td_api::make_object<td::td_api::setTdlibParameters>(); @@ -237,7 +237,6 @@ class DoAuthentication final : public TestClinetTask { request->system_language_code_ = "en"; request->device_model_ = "Desktop"; request->application_version_ = "tdclient-test"; - request->enable_storage_optimizer_ = true; function = std::move(request); break; } @@ -311,10 +310,10 @@ class SetUsername final : public TestClinetTask { CHECK(res->get_id() == td::td_api::chat::ID); auto chat = td::move_tl_object_as<td::td_api::chat>(res); this->send_query(td::make_tl_object<td::td_api::sendMessage>( - chat->id_, 0, 0, nullptr, nullptr, + chat->id_, 0, nullptr, nullptr, nullptr, td::make_tl_object<td::td_api::inputMessageText>( td::make_tl_object<td::td_api::formattedText>(PSTRING() << tag_ << " INIT", td::Auto()), - false, false)), + nullptr, false)), [](auto res) {}); }); } @@ -382,10 +381,10 @@ class TestA final : public TestClinetTask { for (int i = 0; i < 20; i++) { this->send_query( td::make_tl_object<td::td_api::sendMessage>( - chat->id_, 0, 0, nullptr, nullptr, + chat->id_, 0, nullptr, nullptr, nullptr, td::make_tl_object<td::td_api::inputMessageText>( td::make_tl_object<td::td_api::formattedText>(PSTRING() << tag_ << " " << (1000 + i), td::Auto()), - false, false)), + nullptr, false)), [&](auto res) { this->stop(); }); } }); @@ -431,10 +430,10 @@ class TestSecretChat final : public TestClinetTask { for (int i = 0; i < 20; i++) { send_query( td::make_tl_object<td::td_api::sendMessage>( - chat_id_, 0, 0, nullptr, nullptr, + chat_id_, 0, nullptr, nullptr, nullptr, td::make_tl_object<td::td_api::inputMessageText>( td::make_tl_object<td::td_api::formattedText>(PSTRING() << tag_ << " " << (1000 + i), td::Auto()), - false, false)), + nullptr, false)), [](auto res) {}); } } @@ -495,7 +494,7 @@ class TestFileGenerated final : public TestClinetTask { file.flush_write().ensure(); // important file.close(); send_query(td::make_tl_object<td::td_api::sendMessage>( - chat_id_, 0, 0, nullptr, nullptr, + chat_id_, 0, nullptr, nullptr, nullptr, td::make_tl_object<td::td_api::inputMessageDocument>( td::make_tl_object<td::td_api::inputFileGenerated>(file_path, "square", 0), td::make_tl_object<td::td_api::inputThumbnail>( @@ -504,7 +503,7 @@ class TestFileGenerated final : public TestClinetTask { [](auto res) { check_td_error(res); }); send_query(td::make_tl_object<td::td_api::sendMessage>( - chat_id_, 0, 0, nullptr, nullptr, + chat_id_, 0, nullptr, nullptr, nullptr, td::make_tl_object<td::td_api::inputMessageDocument>( td::make_tl_object<td::td_api::inputFileGenerated>(file_path, "square", 0), nullptr, true, td::make_tl_object<td::td_api::formattedText>(tag_, td::Auto()))), @@ -612,10 +611,10 @@ class CheckTestC final : public TestClinetTask { void one_file() { send_query(td::make_tl_object<td::td_api::sendMessage>( - chat_id_, 0, 0, nullptr, nullptr, + chat_id_, 0, nullptr, nullptr, nullptr, td::make_tl_object<td::td_api::inputMessageText>( td::make_tl_object<td::td_api::formattedText>(PSTRING() << tag_ << " ONE_FILE", td::Auto()), - false, false)), + nullptr, false)), [](auto res) { check_td_error(res); }); } diff --git a/protocols/Telegram/tdlib/td/test/tqueue.cpp b/protocols/Telegram/tdlib/td/test/tqueue.cpp index 9c3da0034c..50f58e4dbe 100644 --- a/protocols/Telegram/tdlib/td/test/tqueue.cpp +++ b/protocols/Telegram/tdlib/td/test/tqueue.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -31,7 +31,7 @@ TEST(TQueue, hands) { auto qid = 12; ASSERT_EQ(true, tqueue->get_head(qid).empty()); ASSERT_EQ(true, tqueue->get_tail(qid).empty()); - tqueue->push(qid, "hello", 1, 0, td::TQueue::EventId()); + tqueue->push(qid, "hello", 1, 0, td::TQueue::EventId()).ignore(); auto head = tqueue->get_head(qid); auto tail = tqueue->get_tail(qid); ASSERT_EQ(head.next().ok(), tail); |