Beispiel #1
0
        public async Task CreateGroupByNumber(string supportPhoneNumber, string clientPhoneNumber, string groupName)
        {
            var supportContact = await _telegramSession.GetContactForNumber(supportPhoneNumber);

            if (supportContact == null)
            {
                throw new TelegramCreateGroupException("Invalid Support Contact");
            }

            var clientContact = await _telegramSession.GetContactForNumber(clientPhoneNumber);

            if (clientContact == null)
            {
                throw new TelegramCreateGroupException("Invalid Client Contact");
            }

            if (clientContact == supportContact)
            {
                throw new TelegramCreateGroupException("Client and Support Contacts must be different");
            }

            await _telegramSession.CreateGroup(supportContact, clientContact, groupName);
        }
Beispiel #2
0
 public async Task CreateGroup(TelegramContact serviceContact, TelegramContact clientContact, string groupName)
 {
     await _telegramSession.CreateGroup(serviceContact, clientContact, groupName);
 }