diff --git a/Examples/Program_ListenUpdates.cs b/Examples/Program_ListenUpdates.cs index c5d5a74..857a24a 100644 --- a/Examples/Program_ListenUpdates.cs +++ b/Examples/Program_ListenUpdates.cs @@ -30,10 +30,10 @@ namespace WTelegramClientTest } - private static readonly Dictionary users = new(); - private static readonly Dictionary chats = new(); - private static string AUser(int user_id) => users.TryGetValue(user_id, out var user) ? user.DisplayName : $"User {user_id}"; - private static string AChat(int chat_id) => chats.TryGetValue(chat_id, out var chat) ? chat.Title : $"Chat {chat_id}"; + private static readonly Dictionary users = new(); + private static readonly Dictionary chats = new(); + private static string AUser(long user_id) => users.TryGetValue(user_id, out var user) ? user.DisplayName : $"User {user_id}"; + private static string AChat(long chat_id) => chats.TryGetValue(chat_id, out var chat) ? chat.Title : $"Chat {chat_id}"; private static string APeer(Peer peer) => peer is null ? null : peer is PeerUser user ? AUser(user.user_id) : peer is PeerChat chat ? AChat(chat.chat_id) : peer is PeerChannel channel ? AChat(channel.channel_id) : $"Peer {peer.ID}"; diff --git a/README.md b/README.md index f0a4c46..11dc289 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ foreach (var chat in chats) break; } Console.Write("Type a chat ID to send a message: "); -var id = int.Parse(Console.ReadLine()); +long id = long.Parse(Console.ReadLine()); var target = chats.First(chat => chat.ID == id); await client.SendMessageAsync(target, "Hello, World"); ```