Пример #1
0
        protected async Task <bool> BotIsAdministratorInGroupChat(long ChatGroupId)
        {
            try
            {
                var result = await TelegramClient.GetChatAdministratorsAsync(ChatGroupId);


                if (result.Where(r => r.User.IsBot && r.User.Id == BotInfo.ChatId).FirstOrDefault() != null)
                {
                    return(true);
                }

                else
                {
                    return(false);
                }
            }

            catch
            {
                return(false);
            }
        }