Follow the documentation for the Auth Code flow and request the scopes you need for what you need your bot to do.