Skip to content

Commit bb5634b

Browse files
authored
Merge pull request #1 from AlexanderShK/master
[Added] new functions, updated module declaration as a new org and basis for README
2 parents 3d4c3ae + 35a8cf8 commit bb5634b

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# matterclient
2+
[![Go](https://img.shields.io/badge/Go-1.21%2B-blue?style=flat-square&logo=go)](https://go.dev/)
3+
[![License](https://img.shields.io/badge/License-Apache%202.0-blue?style=flat-square)](LICENSE)
4+
5+
**Mattermost client library in Golang**
6+
7+
A lightweight, robust Go library for interacting with [Mattermost](https://mattermost.com/) servers.
8+
9+
It supports authentication (password, token, MFA), team/channel discovery, real-time messaging over WebSocket and more.
10+
11+
It is used internally by Matterbridge (and was originally extracted from it).
12+
13+
## Related projects
14+
15+
- [Matterbridge](https://github.com/matterbridge-org/matterbridge/tree/master) - the universal chat bridge
16+
17+
## Acknowledgments
18+
19+
Original author / maintainer: This library was originally developed by **Wim** (@42wim) as part of the Matterbridge project.
20+
This repository is a fork of the original [matterbridge/matterclient](https://github.com/matterbridge/matterclient) for continued maintenance and updates.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/matterbridge/matterclient
1+
module github.com/matterbridge-org/matterclient
22

33
go 1.21
44

users.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@ func (m *Client) GetNickName(userID string) string {
1414
return ""
1515
}
1616

17+
func (m *Client) GetFirstName(userID string) string {
18+
if user := m.GetUser(userID); user != nil {
19+
return user.FirstName
20+
}
21+
22+
return ""
23+
}
24+
25+
func (m *Client) GetLastName(userID string) string {
26+
if user := m.GetUser(userID); user != nil {
27+
return user.LastName
28+
}
29+
30+
return ""
31+
}
32+
1733
func (m *Client) GetStatus(userID string) string {
1834
res, _, err := m.Client.GetUserStatus(context.TODO(), userID, "")
1935
if err != nil {

0 commit comments

Comments
 (0)