Telegram and Facebook API integration

On Telegram or Facebook API Integration.
At first Resolution Bot starts the conversations then assigning to an agent. After closing the chat and reinitiating the conversation should start with the bot but rather it reopens the conversation with the previously assigned agent and the bot commands are not working(as it directly adds the agent and not starts with bot on reinitiating the chat)