Botgoram is state-based telegram bot framework written in go. It is inspired by tucnak/telebot. Botgoram helps when writing large, complicated, interative bots. If you only need a small, simple, command-based bot, tucnak/telebot or telegram api implementation in botgoram would be your best friend.
We think the work flow for bot is like a Finite State Machine: given current state, transit to next state acording to the input. We write code to choose right state, and define what to do when entering/ leaving a state.
See example code on godoc.org.
It depends. Draw a flowchart, especially a data flowchart, and treat each unit as a state might be a reasonable start. The state pattern, Automata-based programming on wikipedia might also give you some thoughts.
Yes, the code will be much longer. But it will also eliminates a number of control structures and function calls. And program can be faster if you apply certain optimization on your state map.
Any version of MIT, GPL or LGPL. See LICENSE.txt for details.