internal TelegramClientAuth( ILogger logger, TgBellhop tg ) { _logger = logger; _tg = tg; }
TelegramClient( TgBellhop bellhop, ISessionStore sessionStore ) { _bellhop = bellhop; _storeSync = SessionStoreSync.Init(_bellhop.SessionVar.ToSome(), sessionStore.ToSome()); Auth = new TelegramClientAuth(_bellhop); Contacts = new TelegramClientContacts(_bellhop); Messages = new TelegramClientMessages(_bellhop); Upload = new TelegramClientUpload(_bellhop); }
static async Task <TelegramClient> Connect( ConnectInfo connectInfo, ISessionStore store, TgCallMiddlewareChain?callMiddlewareChain = null, TcpClientConnectionHandler?tcpClientConnectionHandler = null ) { var bellhop = await TgBellhop.Connect( connectInfo, callMiddlewareChain, tcpClientConnectionHandler ).ConfigureAwait(false); return(new TelegramClient(bellhop, store)); }
internal TelegramClientMessages(TgBellhop tg) => _tg = tg;
internal TelegramClientUpdates(Some <TgBellhop> tg) { _tg = tg; Stream = _tg.Updates; }
internal TelegramClientUpdates(TgBellhop tg) { _tg = tg; Stream = _tg.Updates; Exceptions = _tg.Exceptions; }
internal TelegramClientUpload(TgBellhop tg) => _tg = tg;
internal TelegramClientContacts(TgBellhop tg) => _tg = tg;
internal TelegramClientChannels(TgBellhop tg) => _tg = tg;