Using Twitter bots is legal, but their actions must comply with Twitter's terms of service, and the use of bots for certain activities such as spamming or impersonating others can result in suspension or termination of your account.