path = glob.glob(get_script_directory()+"\\gifs\\"+' '.join(msg.text.split(' ')[1:]).strip()+".*")[0]' '.join(msg.text.split(' ')[1:]).strip() def composePath(....) -> string:
return ....text = "Hello world hi mir"
new_text = ' '.join(text.split(' ')[1:]).strip()
print(f'"{new_text}"') # "world hi mir"
another_new_text = text[text.find(' ')+1:]
print(f'"{another_new_text}"') # "world hi mir"path = glob.glob(fr'{get_script_directory()}\gifs\{msg.text[text.find(" ")+1:]}".*"')[0])