added function to get groups messages and get messages from users