ChatterMessage object is for private messages.
postFeedElement(communityId, feedElement) is for direct messages.
$A.createComponent is an asynchronous function. You cannot guarantee the order of execution when you put multiple calls in a row.
Either use $A.createComponents to create both components at once:
I have found the answer to my question.
First, let me explain why the above thing is not working. As I am getting Id from the controller and in return, the Id is getting returned from the Apex controller and it's taking time as it is an asynchronous process and hence when the tag is getting rendered it is getting rendered as undefined.
Hence, to solve this ...
Per the documentation,the only supported calls for FeedpollChoice and FeedPollVote are describeSObjects(), query(), retrieve()
Even,tools like Dataloader, Workbench do not support an operation like Insert on these objects
As mentioned in the post ,Poll votes are not currently exposed and most likely never will be since if these objects were exposed there ...
You need to set the default external sharing settings for the User Object to private. If this is set to private you can use "Portal User Vibility" from the Sharing Settings to allow user to chat with other users from their account. Internal users need to be added to the community (by profile or permission set) to enable community users to chat with ...
As mentioned in the post ,you can use the Connect Rest API to fetch the information of the pinned post. I was able to fetch this information with the below URI using workbench
Here,0F97F000000F2ltSAC is the group ID where the post was pinned in my org.
Incase you want to use ...
If you must post just one FeedItem, and have to post it to the CollaborationGroup on your instead of showing a chatter:feed, which will just show just Chatter related to that record, you could use the chatter:newsFeed tag instead. This will show all Chatter relevant for the running user. That way, if the running User is a member of the CollaborationGroup to ...
After looking in the Audit Setup Trail I couldn't find anything related to Chatter Group but on the Salesforce site I found below piece of information that gave me the answer.
Salesforce runs a weekly review of feed activity in groups. If a group
has no new feed posts or comments for 90 consecutive days, the group
is archived automatically.