예제 #1
0
 internal TelegramClientAuth(
     ILogger logger,
     TgBellhop tg
     )
 {
     _logger = logger;
     _tg     = tg;
 }
예제 #2
0
        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);
        }
예제 #3
0
        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));
        }
예제 #4
0
 internal TelegramClientMessages(TgBellhop tg) => _tg = tg;
예제 #5
0
 internal TelegramClientUpdates(Some <TgBellhop> tg)
 {
     _tg    = tg;
     Stream = _tg.Updates;
 }
예제 #6
0
 internal TelegramClientUpdates(TgBellhop tg)
 {
     _tg        = tg;
     Stream     = _tg.Updates;
     Exceptions = _tg.Exceptions;
 }
예제 #7
0
 internal TelegramClientUpload(TgBellhop tg) => _tg = tg;
예제 #8
0
 internal TelegramClientContacts(TgBellhop tg) => _tg = tg;
예제 #9
0
 internal TelegramClientChannels(TgBellhop tg) => _tg = tg;