Why does docker not restart on a stack trace?
The command line is order sensitive. This command:

docker run bot --restart-policy always


Runs the bot image as a container with the value of CMD set to --restart-policy always. To modify the restart policy of the container being run, you need to pass the option after run and before your image name:

docker run --restart-policy always bot