mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Change byte handling to only one place.
This commit is contained in:
parent
4258281a88
commit
4e2eaf7a46
1 changed files with 4 additions and 4 deletions
|
|
@ -352,10 +352,10 @@ class DiscordClient(WebSocketClientProtocol, _BASE_SESSION_CLASS):
|
|||
"""
|
||||
url = f"{DISCORD_API_BASE_URL}/{url}"
|
||||
body = FileBodyProducer(BytesIO(json.dumps(data).encode("utf-8")))
|
||||
request_type = kwargs.pop("type", b"POST")
|
||||
request_type = kwargs.pop("type", "POST")
|
||||
|
||||
d = _AGENT.request(
|
||||
request_type,
|
||||
request_type.encode("utf-8"),
|
||||
url.encode("utf-8"),
|
||||
Headers(
|
||||
{
|
||||
|
|
@ -499,12 +499,12 @@ class DiscordClient(WebSocketClientProtocol, _BASE_SESSION_CLASS):
|
|||
|
||||
data = {"nick": text}
|
||||
data.update(kwargs)
|
||||
self._post_json(f"guilds/{guild_id}/members/{user_id}", data, type=b"PATCH")
|
||||
self._post_json(f"guilds/{guild_id}/members/{user_id}", data, type="PATCH")
|
||||
|
||||
def send_role(self, role_id, guild_id, user_id, **kwargs):
|
||||
|
||||
data = kwargs
|
||||
self._post_json(f"guilds/{guild_id}/members/{user_id}/roles/{role_id}", data, type=b"PUT")
|
||||
self._post_json(f"guilds/{guild_id}/members/{user_id}/roles/{role_id}", data, type="PUT")
|
||||
|
||||
def send_default(self, *args, **kwargs):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue