Discord defaults to the "Public bot" setting being enabled for all newly created applications inside the Developer Portal.
Trying to disable it will result in the following error message:
This error references another setting of your custom bot application in the Installation category.
You will need to change it in order to disable the "Public bot" option.
Newly created custom bot will look like this inside your server. Note that it has "+ Add App" button:
Leaving it like this would mean that any user inside your Discord server will be able to install a copy of this same bot on their own server, or add it to their applications.
To disable this installation button and prevent others from installing your bot, please make the following changes:
By changing the Install Link from "Discord Provided Link" to "None", you will disable this button completely.
Don't forget to save the changes by clicking "Save changes" button that pops up at the bottom of the page.
Here is a short GIF animation to illustrate this from start to finish:
If you have any questions about this, do not hesitate to join our Support Server✌️