Using flags is the right way to report inappropriate content
Flags are the appropriate way to report inappropriate content. For issues in chat, it's more common for a reporting user to use chat flags, but "in need of moderator intervention" flags on SO or MSO will also work as long as you're clear what the flag is about (e.g. include links to the actual problem chat message(s)).
Flags on SO main will be investigated
If someone flags one of your SO posts for moderator attention (one of their own posts, or, really, any post) with a link to a specific chat message and explains the issue, then moderators will investigate. Prior to being a moderator, I, personally, used the option of flagging either one of the user's posts on SO, or one of my own posts, with an "in need of moderator intervention" flag when the issue needed more space to explain than was available in a chat "Flag for moderator" flag.
Flags in chat
Someone flagging the message in chat is substantially more common than someone going to SO main to flag a post.
In chat, there are two types of flags:
"Spam, inappropriate, or offensive" chat flags are shown for handling to all users in chat with > 10k reputation.
If a user with >10k reputation chooses to click on the notification, then they are shown the flagged message and asked to indicate if the flag is "valid", "invalid", or "unsure". A "valid" response raises an additional similar flag on the message. An "invalid" response counters a single such flag. An "unsure" response results in dismissing the flag handling dialog and not showing it again for that flag to that user. If a net total of 6 flags are raised, or a moderator raises such a flag, the chat message is deleted and the system gives the author of the message a 30 minute suspension from chat. The system will give the 30 minute suspension to the user who the chat system thinks is the author of the message. In the case of a relay bot being used as you describe, the system will think it is the bot that authored the message, so the bot will receive a 30 minute chat suspension.
The control to raise this type of flag is available from either the "meta" menu for the chat message which appears when the message is hovered or from the popup for the message which is displayed when the down-arrow is clicked which is displayed at the left of the message when the message is hovered.
As described above, these flags can be resolved without the intervention of moderators. If a moderator sees the notification that such a flag was raised, the moderator is quite likely to respond (see below). A moderator seeing the notification will depend on which, if any, moderators are looking at a chat tab during the time the flag(s) are active. If a user wants to guarantee handling by an actual moderator, then a "flag for moderator" flag should be raised.
"Flag for moderator" flags are seen only by moderators.
These flags allow you to write a short amount of text to explain the issue to the moderators. The button to raise this flag is displayed in the popup for the message, which you can access as described above.
Moderator handling of the flag(s)
Depending on what was actually happening, and assuming that a moderator's attention was called into the issue, then the response is likely to be more significant than the automatic 30 minute chat. What, in total, to do would be a judgement call made by the moderator.
Moderators, usually, aren't idiots. We do make mistakes from time to time, but we wouldn't be fooled by a bot which was created with, or being used with, the intent to avoid the requirement that discussions in chat must comply with the Code of Conduct. The bot you're thinking of may not have been created with that intent, but it would certainly be looked at to see if it was being used that way. However, the bot I'm thinking of which does what you describe was created with the explicit intent of allowing users to avoid suspensions resulting from the handling of their chat messages which violated the Code of Conduct.
That bot was created with the false assumption that a moderator would not investigate such flags. While a moderator investigating such flags may not happen, it's quite likely that a moderator will find out that such flags were raised and manually investigate. At this point, there are several moderators who are routinely active in chat, so it's quite likely at least one of them will see any notification. Even if no moderators see the flag notification while it's active, it's still quite likely moderators will be informed:
- If the chat message was deleted, there's a stub "(removed)" message which is visible to moderators in chat and transcripts. Moderators can see the deleted content. While the default chat UI makes seeing the deleted content a bit inconvenient, there are a few userscripts that make seeing the deleted content easy/trivial and/or the deleted content obvious (e.g. always shown and/or shown on hover).
- If the flagged message(s) were moved out of the room by a room owner, there's a trail to follow left in the chat room which can't be deleted by non-moderators. The flag notification follows the message, so it will still be found. There's an entry in the message's history that indicates where it was moved to and from and the user who moved it.
- Commonly, there are comments about the flags in chat rooms (both the room with the flagged message and other rooms). Given that "Spam, inappropriate, or offensive" chat flags are shown to all users in chat with >10k reputation, it's not uncommon for there to be comments about the flags and messages in rooms other than the room in which the flags were raised.
- Room owners for most of the major rooms have an alternate channel where they can bring issues to moderator attention. A bot posting inappropriate content is likely to be brought to the attention of moderators, even by ROs of other rooms, many of whom have > 10k reputation, so are likely to have seen the flags.
- There's a list available to moderators of all messages on which such flags have been raised which goes back quite a ways (months or years).
So, overall, it's not all that likely that such issues won't come to the attention of moderators. It's almost a certainty if there's more than one such message flagged.
The actual user who wrote the comment(s) is likely to be suspended
If a moderator is involved, then the actual user who made the comment would likely be the one affected by disciplinary action, because we'd be looking at what actually happened and who was responsible for the posted content. However, because the messages were forwarded by the bot, we may not be able to be sufficiently sure [note: "sufficiently sure", not "prove"] that the user which the bot claimed said what was posted was actually the user responsible for the statement. So, applying any penalty to the presumed author would be a judgement call made by the moderator, which would be based on the totality of the situation.
Bot owners/operators are always responsible for everything their bot does as if done by their main account
The bot account and the user who owns the bot are also responsible for everything the bot posts. In all likelihood, the bot account would be suspended and deleted, as it would be an alternate account that was used to post "spam, inappropriate, or offensive" content. Our normal response to alternate accounts which are used to violate the rules is to suspend the alternate account for 365 days and delete/destroy that alternate account, and, potentially, any other alternate accounts owned by the same user (depends on actual situation). The user or users who own and/or control the bot would at least be warned, if not suspended and barred from using alternate accounts (e.g. bot accounts) for a period of time equivalent to the suspension applied to the bot account. The moderator who responds to the situation may choose that the actual situation doesn't warrant the above response, but it is what is normally done for alternate accounts which are used to violate the rules, including violating the Code of Conduct.
As should be clear from the above, the owner/operator of a bot that forwards comments by other people into chat takes on a significant additional risk and responsibility. They take on the responsibility of having posted whatever the bot forwards into chat. It doesn't matter that they may not have intended to post something like whatever was posted. The owner/operator of such a bot should consider if they want the burden of that responsibility (i.e. if they want to risk having the bot account being deleted/destroyed and their main account suspended as the result of how the actions of other people combine with their choice to run the bot).
RelayBot [That person's username]: [My username]: <response>