detect wrong usage of GetMessages

This commit is contained in:
Wizou 2023-10-04 19:17:49 +02:00
parent 4b7205cb68
commit 88e2f5d71e
3 changed files with 6 additions and 2 deletions

2
.github/dev.yml vendored
View file

@ -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

View file

@ -667,6 +667,10 @@ namespace WTelegram
}
}
/// <summary>If you want to get all messages from a chat, use method Messages_GetHistory</summary>
public Task<Messages_MessagesBase> GetMessages(InputPeer peer)
=> throw new WTException("If you want to get all messages from a chat, use method Messages_GetHistory");
/// <summary>Generic helper: Get individual messages by IDs [bots: ✓] <para>See <a href="https://corefork.telegram.org/method/messages.getMessages"/><br/> and <a href="https://corefork.telegram.org/method/channels.getMessages"/></para> <para>Possible <see cref="RpcException"/> codes: 400</para></summary>
/// <param name="peer">User/Chat/Channel</param>
/// <param name="id">IDs of messages to get</param>

View file

@ -42,7 +42,7 @@ namespace TL
public static Task<Messages_Chats> Messages_GetChats(this Client _) => throw new WTException("The method you're looking for is Messages_GetAllChats");
public static Task<Messages_Chats> Channels_GetChannels(this Client _) => throw new WTException("The method you're looking for is Messages_GetAllChats");
public static Task<UserBase[]> Users_GetUsers(this Client _) => throw new WTException("The method you're looking for is Messages_GetAllDialogs");
public static Task<Messages_MessagesBase> Messages_GetMessages(this Client _) => throw new WTException("If you want to get the messages from a chat, use Messages_GetHistory");
public static Task<Messages_MessagesBase> 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