Betting bots aren't necessarily illegal, but they are frowned upon, both by iGaming companies and other players.
Affiliate marketing and advertisement: a major method to earn funds on the bots is to let them deliver additional information on other services. You can provide advertisements or affiliate links in between certain requests or in response to particular customer questions.