Any account that breaks their rate limit, regardless of if it’s an actual user or a bot, or if the account has mod status in a channel or not, it will be temporarily banned from chat for about 30 minutes. That alone though wont result in banning of the Twitch account.
If the spamming is to the point where it regularly exceeds the rate limit resulting in being banned from chat then Twitch may take action against either the account itself, or the app through which the OAuth token was granted to connect to chat with. Twitch may attempt to reach out to the app developer first, as if your bot hits the rate limits then you’re doing something wrong, but there’s no guarantee of that and they have every right to take any action they need.
If the spam is intentionally malicious, hateful, or in any other way a violation of Twitch’s community guidelines then the account itself will likely receive a suspension. Bots that are intended to spam get banned all the time. If they are mods on a channel and only send messages to that channel then a ban is unlikely (except the chat ban for violating rate limits, which will always happen) unless the spam violates the community guidelines.