import json
from .base import Base
[docs]class Emoji(Base):
endpoint = '/emoji'
[docs] def create_custom_emoji(self, emoji_name, files):
emoji = {'name': emoji_name, 'creator_id': self.client.userid}
return self.client.post(
self.endpoint,
data={'emoji': json.dumps(emoji)},
files=files
)
[docs] def get_emoji_list(self, params=None):
return self.client.get(
self.endpoint,
params=params
)
[docs] def get_custom_emoji(self, emoji_id):
return self.client.get(
self.endpoint + '/' + emoji_id
)
[docs] def delete_custom_emoji(self, emoji_id):
return self.client.delete(
self.endpoint + '/' + emoji_id
)
[docs] def get_custom_emoji_by_name(self, name):
return self.client.get(
self.endpoint + '/name/' + name
)
[docs] def get_custom_emoji_image(self, emoji_id):
return self.client.get(
self.endpoint + '/' + emoji_id + '/image'
)
[docs] def search_custom_emoji(self, options=None):
return self.client.post(
self.endpoint + '/search',
options=options
)
[docs] def autocomplete_custom_emoji(self, params=None):
return self.client.get(
self.endpoint + '/autocomplete',
params=params
)