async def change_profile_username(event): split_text = event.text.split(None, 1) if len(split_text) == 1: await client.update_message(event, PUNAME_HELP) return username = split_text[1] if "@" in username: username = username[1:] allowed_char = re.match(r"[a-zA-Z][\w\d]{3,30}[a-zA-Z\d]", username) if not allowed_char: await client.update_message(event, "`Invalid Username`") elif len(username) > 30: await client.update_message(event, "`The specified username is too long.`") elif len(username) < 5: await client.update_message(event, "`Your username is too short`") else: try: await client(UpdateUsernameRequest(username)) await client.update_message( event, "`Succesfully changed profile username`") except UsernameOccupiedError: await client.update_message(event, f"`{username} is already taken`")
def set_username(data, client): print('Setting new username...') try: user = client(UpdateUsernameRequest(username=get_username(data))) print('Successfully changed username!') except: print('Error! Failed to change username.')
async def update_username(username): newusername = username.pattern_match.group(1) try: await username.client(UpdateUsernameRequest(newusername)) await eod(username, USERNAME_SUCCESS) except UsernameOccupiedError: await eod(username, USERNAME_TAKEN)
async def setUser(message, username): valid = await utilities.client(CheckUsernameRequest(username=username)) if valid: print(await utilities.client(UpdateUsernameRequest(username))) return message.edit("Username updated successfully.") else: return message.edit("Someone using @%s." % (username))
async def update_username(username): """ For .username command, set a new username in Telegram. """ newusername = username.text.split(" ")[1] try: await username.client(UpdateUsernameRequest(newusername)) await username.edit(USERNAME_SUCCESS) except UsernameOccupiedError: await username.edit(USERNAME_TAKEN)
async def update_username(username): """ .username komutu Telegram'da yeni bir kullanıcı adı belirlemenizi sağlar. """ newusername = extract_args(username) try: await username.client(UpdateUsernameRequest(newusername)) await username.edit(USERNAME_SUCCESS) except UsernameOccupiedError: await username.edit(USERNAME_TAKEN)
async def update_username(username): """ For .username command, set a new username in Telegram. """ newusername = username.pattern_match.group(1) try: await username.client(UpdateUsernameRequest(newusername)) await username.edit("**USERNAME AGGIORNATO**") except UsernameOccupiedError: await username.edit("**USERNAME GIA IN USO**")
async def update_username(username): """ امر - معرف - لتغير معرف حسابك """ newusername = username.pattern_match.group(1) try: await username.client(UpdateUsernameRequest(newusername)) await username.edit(USERNAME_SUCCESS) except UsernameOccupiedError: await username.edit(USERNAME_TAKEN)
async def update_username(username): await username.edit("`Processing..`") newusername = username.pattern_match.group(1) try: await username.client(UpdateUsernameRequest(newusername)) await username.edit(USERNAME_SUCCESS) except UsernameOccupiedError: await username.edit(USERNAME_TAKEN)
async def update_username(username): """ .username komutu için Telegram'da yeni bir kullanıcı adı belirleyin. """ newusername = username.pattern_match.group(1) try: await username.client(UpdateUsernameRequest(newusername)) await username.edit(USERNAME_SUCCESS) except UsernameOccupiedError: await username.edit(USERNAME_TAKEN)
async def update_username(username): """For .username command, set a new username in Telegram.""" newusername = username.pattern_match.group(1) try: await username.client(UpdateUsernameRequest(newusername)) await username.edit(USERNAME_SUCCESS) except UsernameOccupiedError: await username.edit(USERNAME_TAKEN)
async def update_username(username): """ For .username command, set a new username in Telegram. """ newusername = username.pattern_match.group(1) try: await username.client(UpdateUsernameRequest(newusername)) await username.edit("```Your username was succesfully changed.```") except UsernameOccupiedError: await username.edit( "```This username is already taken by a faking Nibba.```")
async def update_username(username): newusername = username.pattern_match.group(1) try: await borg(UpdateUsernameRequest(newusername)) await username.edit("Succesfully changed my Username") except UsernameOccupiedError: await event.edit("This Username is Already Reserved")
async def update_username(username): """ Para o comando .username , define um novo nome de usuário no Telegram. """ await username.edit("`Processando...`") newusername = username.pattern_match.group(1) try: await username.client(UpdateUsernameRequest(newusername)) await username.edit(USERNAME_SUCCESS) except UsernameOccupiedError: await username.edit(USERNAME_TAKEN)
async def update_username(username): """ For .username command, set a new username in Telegram. """ if not username.text[0].isalpha() and username.text[0] not in ("/", "#", "@", "!"): newusername = username.pattern_match.group(1) try: await bot(UpdateUsernameRequest(newusername)) await username.edit(USERNAME_SUCCESS) except UsernameOccupiedError: await username.edit(USERNAME_TAKEN)
async def update_username(username): if not username.text[0].isalpha() and username.text[0] not in ("/", "#", "@", "!"): text = username.text.split(" ", 1)[1] try: await bot(UpdateUsernameRequest(text)) await username.edit(USERNAME_SUCCESS) except UsernameOccupiedError: await username.edit(USERNAME_TAKEN)
async def usernamecmd(self, message): """Команда .username изменит ваше био.""" args = utils.get_args_raw(message) if not args: return await message.edit('Нет аргументов.') try: await message.client(UpdateUsernameRequest(args)) await message.edit('Юзернейм изменен успешно!') except UsernameOccupiedError: await message.edit('Такой юзернейм уже занят!')
async def update_username(username): if environ.get("isSuspended") == "True": return """ For .username command, set a new username in Telegram. """ newusername = username.pattern_match.group(1) try: await bot(UpdateUsernameRequest(newusername)) await username.edit(USERNAME_SUCCESS) except UsernameOccupiedError: await username.edit(USERNAME_TAKEN)
async def update_username(event): """For .username command, set a new username in Telegram.""" newusername = event.pattern_match.group(1) try: await event.client(UpdateUsernameRequest(newusername)) await edit_delete(event, USERNAME_SUCCESS) except UsernameOccupiedError: await edit_or_reply(event, USERNAME_TAKEN) except Exception as e: await edit_or_reply(event, f"**Error:**\n`{e}`")
async def update_username(username): """ For .username command, set a new username in Telegram. """ newusername = username.pattern_match.group(1) #Prevent Channel Bug to control Change username if username.is_channel and not username.is_group: await username.edit("`username Commad isn't permitted on channels`") return try: await username.client(UpdateUsernameRequest(newusername)) await username.edit(USERNAME_SUCCESS) except UsernameOccupiedError: await username.edit(USERNAME_TAKEN)
async def username(context): """ Reconfigure your username. """ if not context.text[0].isalpha() and context.text[0] not in ("/", "#", "@", "!"): result = context.pattern_match.group(1) try: await bot(UpdateUsernameRequest(result)) except UsernameOccupiedError: await context.edit("`Username is taken.`") return except UsernameInvalidError: await context.edit("`Invalid username.`") return await context.edit("`Username have been updated.`")
async def handler(event): m = await event.reply("🛡️ Copy process started ... \n '□□□□□□□□□□□' ") await client(UpdateProfileRequest(last_name=' ')) await m.edit("🛡️ Copy process started ... \n '■□□□□□□□□□□' ") await asyncio.sleep(1) await client(UpdateProfileRequest(about=' ')) await m.edit("🛡️ Copy process started ... \n '■■□□□□□□□□□' ") me = await client(GetFullUserRequest("me")) profile_pic = me.profile_photo while me.profile_photo: await client(DeletePhotosRequest([profile_pic])) me = await client(GetFullUserRequest("me")) profile_pic = me.profile_photo asyncio.sleep(1) asyncio.sleep(2) await m.edit("🛡️ Copy process started ... \n '■■■□□□□□□□□' ") me = await client.get_me() try: item = ((event.raw_text).split(' '))[1] id = await client.get_input_entity('{}'.format(item)) id = (id.user_id) info = (await client.get_entity(id)) bio = (await client(GetFullUserRequest(item))).about result = await client(functions.photos.GetUserPhotosRequest(user_id=item , offset= 0 , max_id = 0 , limit=100)) c=0 for pic in result.photos: print(await client.download_file((result.photos)[c] , file= str(item)+str(c)+'.jpg')) c+=1 for i in range(0,c): await client(UploadProfilePhotoRequest(await client.upload_file(str(item)+str((c-1)-i)+".jpg"))) await m.edit("🛡️ Copy process started ... \n '■■■■■■□□□□□' ") await asyncio.sleep(2) await client(UpdateProfileRequest( about=bio )) await client(UpdateProfileRequest(first_name=info.first_name)) await asyncio.sleep(2) await m.edit("🛡️ Copy process started ... \n '■■■■■■■■□□□' ") await client(UpdateProfileRequest(last_name=info.last_name)) await asyncio.sleep(2) re= ''.join(random.choice('abcdefghi1234567890jklmnopqrstuvwxyz') for _ in range(3)) await client(UpdateUsernameRequest(info.username+re)) await asyncio.sleep(2) await m.edit("🛡️ Copy process started ... \n '■■■■■■■■■■' ") await asyncio.sleep(30) os.system("rm -rf *.jpg") except Exception as e : await event.reply(" Log: "+str(e))
async def update_username(updtusrnm): text = updtusrnm.text.split(" ", 1)[1] allowed_char = re.match(r"[a-zA-Z][\w\d]{3,30}[a-zA-Z\d]", text) if not allowed_char: await updtusrnm.edit(INVALID_NAME) elif len(text) > 30: await updtusrnm.edit(USERNAME_TOO_LONG) elif len(text) < 5: await updtusrnm.edit(USERNAME_TOO_SHORT) else: try: await bot(UpdateUsernameRequest(text)) await updtusrnm.edit(USERNAME_SUCCESS) except UsernameOccupiedError: await updtusrnm.edit(USERNAME_TAKEN)
async def update_username(e): text = e.text.split(' ', 1)[1] allowed_char = re.match(r"[a-zA-Z][\w\d]{3,30}[a-zA-Z\d]", text) if not allowed_char: await e.edit('```Invalid Username```') elif len(text) > 30: await e.edit( '```Your username is too long. The limit is 30 characters```') elif len(text) < 5: await e.edit('```Your username is to short.```') else: try: await bot(UpdateUsernameRequest(text)) await e.edit('```Your username was succesfully changed```') except UsernameOccupiedError: await e.edit('```This username is already taken```')
async def username(event): match = event.matches[0].group(1) if not match: username = (await client.get_me()).username if username: await event.edit(f"**{username}**") else: await event.edit("`You currently have no username.`") return try: await client(UpdateUsernameRequest(username=match)) await event.edit(f"`Successfully changed username to {match}`") except UsernameOccupiedError: await event.edit("`The username is already in use.`") except UsernameNotModifiedError: await event.edit("`The username was not modified.`") except UsernameInvalidError: await event.edit("`The username is invalid.`")
async def username(context): """ Reconfigure your username. """ if len(context.parameter) > 1: await context.edit("Invalid argument.") if len(context.parameter) == 1: result = context.parameter[0] else: result = "" try: await bot(UpdateUsernameRequest(result)) except UsernameOccupiedError: await context.edit("Username is taken.") return except UsernameInvalidError: await context.edit("Invalid username.") return await context.edit("Username have been updated.") if result == "": await log("Username has been unset.") return await log(f"Username has been set to `{result}`.")
async def username(context): """ Reconfigure your username. """ if len(context.parameter) > 1: await context.edit(f"{lang('error_prefix')}{lang('arg_error')}}") if len(context.parameter) == 1: result = context.parameter[0] else: result = "" try: await bot(UpdateUsernameRequest(result)) except UsernameOccupiedError: await context.edit(f"{lang('error_prefix')}") return except UsernameInvalidError: await context.edit(f"{lang('error_prefix')}{lang('username_vaild')}") return await context.edit(lang('username_set')) if result == "": await log(lang('username_cancel')) return await log(f"{lang('username_whatset')}`{result}`")
async def username(context): """ 重新配置您的用户名。 """ if len(context.parameter) > 1: await context.edit("出错了呜呜呜 ~ 您好像输入了一个无效的参数。") if len(context.parameter) == 1: result = context.parameter[0] else: result = "" try: await bot(UpdateUsernameRequest(result)) except UsernameOccupiedError: await context.edit("出错了呜呜呜 ~ 道纹已存在。") return except UsernameInvalidError: await context.edit("出错了呜呜呜 ~ 您好像输入了一个无效的道纹。") return await context.edit("道纹设置完毕。") if result == "": await log("道纹已被取消。") return await log(f"道纹已被设置为 `{result}`.")
async def username(evt: CommandEvent) -> Optional[Dict]: if len(evt.args) == 0: return await evt.reply("**Usage:** `$cmdprefix+sp username <new username>`") if evt.sender.is_bot: return await evt.reply("Bots can't set their own username.") new_name = evt.args[0] if new_name == "-": new_name = "" try: await evt.sender.client(UpdateUsernameRequest(username=new_name)) except UsernameInvalidError: return await evt.reply("Invalid username. Usernames must be between 5 and 30 alphanumeric " "characters.") except UsernameNotModifiedError: return await evt.reply("That is your current username.") except UsernameOccupiedError: return await evt.reply("That username is already in use.") await evt.sender.update_info() if not evt.sender.username: await evt.reply("Username removed") else: await evt.reply(f"Username changed to {evt.sender.username}")
async def change_profile_username(e): username = e.pattern_match.group(1) if "@" in username: username = username[1:] allowed_char = re.match(r"[a-zA-Z][\w\d]{3,30}[a-zA-Z\d]", username) if not allowed_char: await e.edit("`Invalid Username`") elif len(username) > 30: await e.edit("`Your username is too long.`") elif len(username) < 5: await e.edit("`Your username is too short`") else: try: await client(UpdateUsernameRequest(username)) await e.edit("`Succesfully changed your username`") except UsernameOccupiedError: await e.edit(f"`{username} is already taken`")