diff options
| author | Rapptz <[email protected]> | 2016-09-26 23:02:28 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-09-26 23:02:28 -0400 |
| commit | 9322bc78beb6f527746646aaf4dfe24476f3de4f (patch) | |
| tree | a230b60103092ed5a03e0949d65ff2c45890572c /discord/http.py | |
| parent | Add support for "Do Not Disturb" and "Invisible" statuses. (diff) | |
| download | discord.py-9322bc78beb6f527746646aaf4dfe24476f3de4f.tar.xz discord.py-9322bc78beb6f527746646aaf4dfe24476f3de4f.zip | |
Add the ability to add, delete, and edit custom emoji.
Diffstat (limited to 'discord/http.py')
| -rw-r--r-- | discord/http.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/discord/http.py b/discord/http.py index dd7c1f43..ada71f7c 100644 --- a/discord/http.py +++ b/discord/http.py @@ -425,6 +425,28 @@ class HTTPClient: } return self.get(url, params=params, bucket=_func_()) + def create_custom_emoji(self, guild_id, name, image): + payload = { + 'name': name, + 'image': image + } + + bucket = '%s:%s' % (_func_(), guild_id) + return self.post('{0.GUILDS}/{1}/emojis'.format(self, guild_id), json=payload, bucket=bucket) + + def delete_custom_emoji(self, guild_id, emoji_id): + url = '{0.GUILDS}/{1}/emojis/{2}'.format(self, guild_id, emoji_id) + bucket = '%s:%s' % (_func_(), guild_id) + return self.delete(url, bucket=bucket) + + def edit_custom_emoji(self, guild_id, emoji_id, *, name): + payload = { + 'name': name + } + url = '{0.GUILDS}/{1}/emojis/{2}'.format(self, guild_id, emoji_id) + bucket = '%s:%s' % (_func_(), guild_id) + return self.patch(url, bucket=bucket, json=payload) + # Invite management def create_invite(self, channel_id, **options): |