diff options
| author | Nadir Chowdhury <[email protected]> | 2020-06-28 19:48:04 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-06-28 14:48:04 -0400 |
| commit | 2b3c6e0d4776fae080191e605c2caf89fa132e1b (patch) | |
| tree | dd870ce057115cd852d59749092709caee2b4d78 /discord/http.py | |
| parent | [commands] Raise TypeError when Optional is used with Greedy converter (diff) | |
| download | discord.py-2b3c6e0d4776fae080191e605c2caf89fa132e1b.tar.xz discord.py-2b3c6e0d4776fae080191e605c2caf89fa132e1b.zip | |
Add support for Discord templates
Diffstat (limited to 'discord/http.py')
| -rw-r--r-- | discord/http.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/discord/http.py b/discord/http.py index dba174b6..c5650c24 100644 --- a/discord/http.py +++ b/discord/http.py @@ -630,6 +630,17 @@ class HTTPClient: return self.request(Route('PATCH', '/guilds/{guild_id}', guild_id=guild_id), json=payload, reason=reason) + def get_template(self, code): + return self.request(Route('GET', '/guilds/templates/{code}', code=code)) + + def create_from_template(self, code, name, region, icon): + payload = { + 'name': name, + 'icon': icon, + 'region': region + } + return self.request(Route('POST', '/guilds/templates/{code}', code=code), json=payload) + def get_bans(self, guild_id): return self.request(Route('GET', '/guilds/{guild_id}/bans', guild_id=guild_id)) |