aboutsummaryrefslogtreecommitdiff
path: root/discord/http.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-09-26 23:02:28 -0400
committerRapptz <[email protected]>2016-09-26 23:02:28 -0400
commit9322bc78beb6f527746646aaf4dfe24476f3de4f (patch)
treea230b60103092ed5a03e0949d65ff2c45890572c /discord/http.py
parentAdd support for "Do Not Disturb" and "Invisible" statuses. (diff)
downloaddiscord.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.py22
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):