Ejemplo n.º 1
0
        /// <summary>
        /// Adds a user in specified super group
        /// </summary>
        /// <param name="user">target user tdapi.User instnace</param>
        /// <param name="target">target group tdapi.Chat instnace</param>
        /// <param name="addall">if true, user will be added even if its blocked, or last seen long time ago</param>
        public async Task <(enums.Response response, object obj)> AddChatMember(tdapi.User user, tdapi.Chat target, bool addall = false)
        {
            enums.Response res = new enums.Response();
            object         obj = null;

            if (user.Username is null || user.Username.Length <= 0)
            {
                res = enums.Response.Failed;
                obj = new tdapi.Error()
                {
                    Message = "User username cannot be empty"
                };
            }
Ejemplo n.º 2
0
        private static async void Core_OnVerificationPasswordNeededAsync(object sender, TDLibCoreEventArgs e)
        {
            string password = "";

            Console.WriteLine("Please enter your password");
            password = Console.ReadLine();
            var response = await e.core.Authenticate(password);

            if (response.response == TDLibCore.enums.Response.Failed)
            {
                tdapi.Error error = response.responseobj as tdapi.Error;
                Console.WriteLine("verification password - " + error.Message);
            }
        }
Ejemplo n.º 3
0
        private static async void Core_OnVerificationCodeNeeded(object sender, TDLibCoreEventArgs e)
        {
            string verificationcode = "";

            Console.WriteLine("Please enter verification code");
            verificationcode = Console.ReadLine();
            var response = await e.core.Authenticate(verificationcode);

            if (response.response == TDLibCore.enums.Response.Failed)
            {
                tdapi.Error error = response.responseobj as tdapi.Error;
                Console.WriteLine("verificaition code - " + error.Message);
            }
        }