Ejemplo n.º 1
0
        public string RegisterUser(Guid userId, int tenantId)
        {
            var token = GenerateToken(userId);

            TelegramServiceClient.RegisterUser(userId.ToString(), tenantId, token);

            return(GetLink(token));
        }
Ejemplo n.º 2
0
 public TelegramHelper(
     ConsumerFactory consumerFactory,
     IOptionsSnapshot <CachedTelegramDao> cachedTelegramDao,
     TelegramServiceClient telegramServiceClient,
     IOptionsMonitor <ILog> options)
 {
     ConsumerFactory       = consumerFactory;
     CachedTelegramDao     = cachedTelegramDao.Value;
     TelegramServiceClient = telegramServiceClient;
     Log = options.CurrentValue;
 }
Ejemplo n.º 3
0
        public bool CreateClient(int tenantId, string token, int tokenLifespan, string proxy)
        {
            var client = InitClient(token, proxy);

            if (TestingClient(client))
            {
                TelegramServiceClient.CreateOrUpdateClient(tenantId, token, tokenLifespan, proxy);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 4
0
 public void SendMessage(NotifyMessage msg)
 {
     TelegramServiceClient.SendMessage(msg);
 }
Ejemplo n.º 5
0
 private string GetCurrentToken(Guid userId, int tenantId)
 {
     return(TelegramServiceClient.RegistrationToken(userId.ToString(), tenantId));
 }
Ejemplo n.º 6
0
 public void DisableClient(int tenantId)
 {
     TelegramServiceClient.DisableClient(tenantId);
 }