Thanks. One thing I noticed is that the example in the documentation doesn’t seem to quite match what I encountered in the wild.
The message payload (without the standard PubSub frame around it) in the example is:
{
"id":"some-automod-caught-message-id",
"content":{
"text":"a bad word",
"fragments":[
{
"text":"a bad word",
"automod":{
"topics":{
"swearing":6
}
}
}
]
},
"sender":{
"user_id":"559969259",
"login":"msongvo222",
"display_name":"msongvo222",
"chat_color":"#8A2BE2"
},
"sent_at":"2021-05-24T18:46:20.964Z",
"content_classification":{
"category":"swearing",
"level":2
},
"status":"PENDING",
"reason_code":"",
"resolver_id":"",
"resolver_login":""
}
What I encountered is more something like this:
{
"type":"automod_caught_message",
"data":{
"content_classification":{
"category":"misogyny",
"level":1
},
"message":{
"content":{
"text":"Stupid message you badword, swearword",
"fragments":[
{
"text":"Stupid",
"automod":{
"topics":{
"bullying":7
}
}
},
{
"text":" message "
},
more fragments..
]
},
"id":"a-message-id",
"sender":{
"user_id":"12345",
"login":"a_username",
"display_name":"A_Username",
"chat_color":"#FF0000"
},
"sent_at":"2021-05-25T14:46:42.597220201Z"
},
"reason_code":"",
"resolver_id":"",
"resolver_login":"",
"status":"PENDING"
}
}
Not a big deal, but if someone implements it sticking to the example it could be confusing.