Skip to content

Commit

Permalink
client: support setting status message in SetPresence (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
nexy7574 authored Dec 22, 2024
1 parent 33b4e82 commit 5c4474a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1404,10 +1404,9 @@ func (cli *Client) GetOwnPresence(ctx context.Context) (resp *RespPresence, err
return cli.GetPresence(ctx, cli.UserID)
}

func (cli *Client) SetPresence(ctx context.Context, status event.Presence) (err error) {
req := ReqPresence{Presence: status}
func (cli *Client) SetPresence(ctx context.Context, presence ReqPresence) (err error) {
u := cli.BuildClientURL("v3", "presence", cli.UserID, "status")
_, err = cli.MakeRequest(ctx, http.MethodPut, u, req, nil)
_, err = cli.MakeRequest(ctx, http.MethodPut, u, presence, nil)
return
}

Expand Down
3 changes: 2 additions & 1 deletion requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ type ReqTyping struct {
}

type ReqPresence struct {
Presence event.Presence `json:"presence"`
Presence event.Presence `json:"presence"`
StatusMsg string `json:"status_msg,omitempty"`
}

type ReqAliasCreate struct {
Expand Down

0 comments on commit 5c4474a

Please sign in to comment.