It might be a better idea to use pythons built in functions to work with the path, instead of trying to parse it yourself.
To get the filename: `os.path.basename(path_to_bot)`
To remove the file extension: `os.path.splitext(filename)[0]`