To make Telegram work with bitlbee you need version compiled with libpurple support enabled - bitlbee-libpurple for example, although there are patched or development versions also available.
Next, install telegram-purple and restart bitlbee via systemd.
In the control channel, &bitlbee, type the following commands:
11:45:03 <@user> account add telegram <phone_number_with_region_prefix> <anything>
11:45:03 <@root> Account successfully added
11:45:06 <@user> account telegram on
After connecting a separate chat window will open, asking for the SMS code - enter it and Telegram will work with your setup.