From 88e2f5d71ea35b21f42c3c964c21f39501db22aa Mon Sep 17 00:00:00 2001 From: Wizou <11647984+wiz0u@users.noreply.github.com> Date: Wed, 4 Oct 2023 19:17:49 +0200 Subject: [PATCH] detect wrong usage of GetMessages --- .github/dev.yml | 2 +- src/Client.Helpers.cs | 4 ++++ src/TL.Extensions.cs | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/dev.yml b/.github/dev.yml index 98609f9..3a41fac 100644 --- a/.github/dev.yml +++ b/.github/dev.yml @@ -1,7 +1,7 @@ pr: none trigger: [ master ] -name: 3.5.6-dev.$(Rev:r) +name: 3.5.7-dev.$(Rev:r) pool: vmImage: ubuntu-latest diff --git a/src/Client.Helpers.cs b/src/Client.Helpers.cs index f8fb9d5..55ea982 100644 --- a/src/Client.Helpers.cs +++ b/src/Client.Helpers.cs @@ -667,6 +667,10 @@ namespace WTelegram } } + /// If you want to get all messages from a chat, use method Messages_GetHistory + public Task GetMessages(InputPeer peer) + => throw new WTException("If you want to get all messages from a chat, use method Messages_GetHistory"); + /// Generic helper: Get individual messages by IDs [bots: ✓] See
and
Possible codes: 400
/// User/Chat/Channel /// IDs of messages to get diff --git a/src/TL.Extensions.cs b/src/TL.Extensions.cs index 60860cc..dc20256 100644 --- a/src/TL.Extensions.cs +++ b/src/TL.Extensions.cs @@ -42,7 +42,7 @@ namespace TL public static Task Messages_GetChats(this Client _) => throw new WTException("The method you're looking for is Messages_GetAllChats"); public static Task Channels_GetChannels(this Client _) => throw new WTException("The method you're looking for is Messages_GetAllChats"); public static Task Users_GetUsers(this Client _) => throw new WTException("The method you're looking for is Messages_GetAllDialogs"); - public static Task Messages_GetMessages(this Client _) => throw new WTException("If you want to get the messages from a chat, use Messages_GetHistory"); + public static Task Messages_GetMessages(this Client _) => throw new WTException("If you want to get all messages from a chat, use method Messages_GetHistory"); } public static class Markdown