Skip to content

Commit 97f5e87

Browse files
committed
client/user_data: add beeper_update_profile method
Signed-off-by: Sumner Evans <[email protected]>
1 parent 0b67487 commit 97f5e87

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

mautrix/client/api/user_data.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
66
from __future__ import annotations
77

8+
from typing import Any
9+
810
from mautrix.api import Method, Path
911
from mautrix.errors import MatrixResponseError, MNotFound
1012
from mautrix.types import ContentURI, Member, SerializerError, User, UserID, UserSearchResults
@@ -170,3 +172,16 @@ async def get_profile(self, user_id: UserID) -> Member:
170172
raise MatrixResponseError("Invalid member in response") from e
171173

172174
# endregion
175+
176+
# region Beeper Custom Fields API
177+
178+
async def beeper_update_profile(self, custom_fields: dict[str, Any]) -> None:
179+
"""
180+
Set custom fields on the user's profile. Only works on Hungryserv.
181+
182+
Args:
183+
custom_fields: A dictionary of fields to set in the custom content of the profile.
184+
"""
185+
await self.api.request(Method.PATCH, Path.v3.profile[self.mxid], custom_fields)
186+
187+
# endregion

0 commit comments

Comments
 (0)