GEP-001 is currently in progress.
Currently td/telegram
package is pretty low-level even with various helpers,
exposing too much telegram internals to user and making it hard to interact with.
To address this issue, new API should be modelled, hiding implementation details and allowing operation with high-level entities like Chat, Channel, User, Message.
chat, err := client.Chat(ctx, "gotd_en")
if err != nil {
return err
}
chat.SendText(ctx, "Hello, fellow users!")
MTProto and Telegram API imposes stateful clients, and we have no other option than implement state management. It is already implemented to some extent, but should be generalized and abstracted as a single interface (probably with some additions for various optimizations) to allow any generic implementation: embedded database, memory, KV storage or any other data persistence solution.