Skip to content
This repository was archived by the owner on Sep 25, 2023. It is now read-only.

Latest commit

 

History

History
28 lines (19 loc) · 924 Bytes

GEP-001.md

File metadata and controls

28 lines (19 loc) · 924 Bytes

GEP-001

GEP-001 is currently in progress.

High level client

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!")

Stateful

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.