PepperSalt42 / api

PepperSalt API in golang
3 stars 2 forks source link

Handle mention user in a message #6

Open post-l opened 8 years ago

post-l commented 8 years ago

Example message:

    {
        "CreatedAt": "2016-01-11T09:01:43Z", 
        "DeletedAt": null, 
        "ID": 59, 
        "Message": "Hello <@U048DRAMJ>", 
        "SentAt": "2016-01-11T08:57:36Z", 
        "UpdatedAt": "2016-01-11T09:01:43Z", 
        "UserID": 2
    }

We need to create a regexp to get the id inside <@ > and then get the user to replace by @name (need to add user.name in user model).