r/redditdev • u/MisterWoodhouse • 21h ago
General Botmanship authorFlair not present in author data for CommentUpdate event payload on edits made via old reddit
My team is migrating one of our bots to devvit and the functionality requires getting the user flair (authorFlair) from all comments on the subs where the bot is active, to check for particular user flair that then prompts the bot to take action on that comment.
The event payload for comment edits (CommentUpdate) made via new reddit include authorFlair in the comment's author details, as expected and needed, but the event payload for the same via old reddit does not.
The authorFlair is passed on the post author from both, but only new reddit sends the authorFlair for the commenter.
JSON from old:
{
"comment": {
"id": "t1_pgx1iwb",
"parentId": "t3_1x6a056",
"body": "I am, therefore I think? \n \nEdit: You can't tell me what to do!\n\nEditing this post now.",
"author": "t2_4bh0v",
"numReports": 0,
"collapsedBecauseCrowdControl": false,
"spam": false,
"deleted": false,
"createdAt": 1792078026099,
"upvotes": 1,
"downvotes": 0,
"languageCode": "",
"lastModifiedAt": 1792085183049,
"gilded": false,
"score": 1,
"permalink": "/r/Techman/comments/1x6a056/comment/pgx1iwb/",
"hasMedia": false,
"postId": "t3_1x6a056",
"subredditId": "t5_5cam9n",
"elementTypes": [
"text"
],
"mediaUrls": []
},
"author": {
"id": "t2_4bh0v",
"name": "Skellums",
"isGold": false,
"snoovatarImage": "",
"url": "https://www.reddit.com/user/Skellums",
"spam": false,
"banned": false,
"karma": 0,
"iconImage": "",
"description": "",
"suspended": false,
"accountType": 1
},
"post": {
"id": "t3_1x6a056",
"title": "Team Replies Test Post #2",
"selftext": "*[Link to first post](https://www.reddit.com/r/Techman/comments/1x3s2eh/team_replies_test_post/)*\n\n---\n\nSame deal, again. This time. The other post is not rendering comments on New Reddit for me. While the admins figure out why that is happening, I am making this new post.",
"nsfw": false,
"authorId": "t2_hmym9",
"crowdControlLevel": 0,
"numReports": 0,
"isGallery": false,
"isMeta": false,
"createdAt": 1792031161838,
"isApproved": false,
"isArchived": false,
"distinguished": 4,
"ignoreReports": false,
"isSelf": true,
"isVideo": false,
"isLocked": false,
"isSpoiler": false,
"subredditId": "t5_5cam9n",
"upvotes": 2,
"downvotes": 0,
"url": "/r/Techman/comments/1x6a056/team_replies_test_post_2/",
"isSticky": false,
"linkFlair": {
"text": "Megathread // Team Replied x3",
"cssClass": "",
"backgroundColor": "#fed801",
"templateId": "e9800c24-c778-11f1-a8fa-c234f391ea7c",
"textColor": "dark"
},
"authorFlair": {
"userId": "t2_hmym9",
"subredditId": "t5_5cam9n",
"text": "Team Member",
"cssClass": "team",
"templateId": "08e6cddc-bf9a-11f1-b7f7-ae21adb3e11b",
"textColor": "dark",
"backgroundColor": "transparent",
"enabled": true
},
"spam": false,
"deleted": false,
"languageCode": "en",
"updatedAt": 0,
"gildings": 0,
"score": 2,
"numComments": 5,
"thumbnail": "",
"media": {
"type": ""
},
"crosspostParentId": "",
"permalink": "/r/Techman/comments/1x6a056/team_replies_test_post_2/",
"isPoll": false,
"isPromoted": false,
"isMultiMedia": false,
"type": "text",
"unlisted": false,
"galleryImages": [],
"isImage": false,
"mediaUrls": [],
"isClubContent": false
},
"previousBody": "",
"subreddit": {
"id": "t5_5cam9n",
"name": "Techman",
"nsfw": false,
"type": 4,
"spam": false,
"quarantined": false,
"topics": [
"Unclassified"
],
"rating": 0,
"subscribersCount": 4,
"permalink": "/r/Techman",
"title": "Techman",
"description": "Techman's personal subreddit, mostly used for testing."
},
"type": "CommentUpdate"
}
JSON from new:
{
"comment": {
"id": "t1_pgx1iwb",
"parentId": "t3_1x6a056",
"body": "I am, therefore I think? \n \nEdit: You can't tell me what to do!\n\nEditing this post now.\n\nThis time on \"new\"",
"author": "t2_4bh0v",
"numReports": 0,
"collapsedBecauseCrowdControl": false,
"spam": false,
"deleted": false,
"createdAt": 1792078026099,
"upvotes": 1,
"downvotes": 0,
"languageCode": "",
"lastModifiedAt": 1792085326327,
"gilded": false,
"score": 1,
"permalink": "/r/Techman/comments/1x6a056/comment/pgx1iwb/",
"hasMedia": false,
"postId": "t3_1x6a056",
"subredditId": "t5_5cam9n",
"elementTypes": [
"text"
],
"mediaUrls": []
},
"author": {
"id": "t2_4bh0v",
"name": "Skellums",
"isGold": false,
"snoovatarImage": "",
"url": "https://www.reddit.com/user/Skellums",
"spam": false,
"banned": false,
"flair": {
"userId": "t2_4bh0v",
"subredditId": "t5_5cam9n",
"text": "Team Member",
"cssClass": "team",
"templateId": "08e6cddc-bf9a-11f1-b7f7-ae21adb3e11b",
"textColor": "dark",
"backgroundColor": "transparent",
"enabled": true
},
"karma": 17576,
"iconImage": "",
"description": "",
"suspended": false,
"accountType": 1
},
"post": {
"id": "t3_1x6a056",
"title": "Team Replies Test Post #2",
"selftext": "*[Link to first post](https://www.reddit.com/r/Techman/comments/1x3s2eh/team_replies_test_post/)*\n\n---\n\nSame deal, again. This time. The other post is not rendering comments on New Reddit for me. While the admins figure out why that is happening, I am making this new post.",
"nsfw": false,
"authorId": "t2_hmym9",
"crowdControlLevel": 0,
"numReports": 0,
"isGallery": false,
"isMeta": false,
"createdAt": 1792031161838,
"isApproved": false,
"isArchived": false,
"distinguished": 4,
"ignoreReports": false,
"isSelf": true,
"isVideo": false,
"isLocked": false,
"isSpoiler": false,
"subredditId": "t5_5cam9n",
"upvotes": 2,
"downvotes": 0,
"url": "/r/Techman/comments/1x6a056/team_replies_test_post_2/",
"isSticky": false,
"linkFlair": {
"text": "Megathread // Team Replied x3",
"cssClass": "",
"backgroundColor": "#fed801",
"templateId": "e9800c24-c778-11f1-a8fa-c234f391ea7c",
"textColor": "dark"
},
"authorFlair": {
"userId": "t2_hmym9",
"subredditId": "t5_5cam9n",
"text": "Team Member",
"cssClass": "team",
"templateId": "08e6cddc-bf9a-11f1-b7f7-ae21adb3e11b",
"textColor": "dark",
"backgroundColor": "transparent",
"enabled": true
},
"spam": false,
"deleted": false,
"languageCode": "en",
"updatedAt": 0,
"gildings": 0,
"score": 2,
"numComments": 5,
"thumbnail": "",
"media": {
"type": ""
},
"crosspostParentId": "",
"permalink": "/r/Techman/comments/1x6a056/team_replies_test_post_2/",
"isPoll": false,
"isPromoted": false,
"isMultiMedia": false,
"type": "text",
"unlisted": false,
"galleryImages": [],
"isImage": false,
"mediaUrls": [],
"isClubContent": false
},
"previousBody": "",
"subreddit": {
"id": "t5_5cam9n",
"name": "Techman",
"nsfw": false,
"type": 4,
"spam": false,
"quarantined": false,
"topics": [
"Unclassified"
],
"rating": 0,
"subscribersCount": 4,
"permalink": "/r/Techman",
"title": "Techman",
"description": "Techman's personal subreddit, mostly used for testing."
},
"type": "CommentUpdate"
}

