There are some steps that have been mentioned in telegram api for creating a bot using a botfather
.
I was hoping if there is a way that these steps can turn into code.
to be specific, I want to get a token from botfather
using code, and then later in the code, I use this token.
Yes this is very possible.
You would however need to build a Telegram Client, that will interact with BotFather.
The interaction should be easy to script, as BotFather interaction follows just a few simple steps