-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: application emojis #282
base: main
Are you sure you want to change the base?
Conversation
Should it not be Also, maybe support for gif and png image uploads (by file name extension) could be useful |
Looks like this logic was pulled from the standard emoji flow which does this poorly. We do already have a MIME type gem which is used for role icons mime_type = MIME::Types.type_for(icon.__send__(path_method)).first&.to_s || 'image/jpeg' |
I will update the emoji flow to use MIME types. |
I have pushed a commit to make the |
For documentation purposes, if you need to resize before uploading: ImageWrapper = Struct.new(:blob, :original_filename_value) do
def read
blob
end
def original_filename
original_filename_value
end
end image = MiniMagick::Image.open(file_path)
image.resize('256x256')
image_wrapper = ImageWrapper.new(image.to_blob, file_path)
emoji = @bot.create_application_emoji(emoji_name, image_wrapper) |
Is this a request for an addition to the docs or is this comment meant to serve as the documentation itself. |
I needed to brain-dump this somewhere for future-self. You could add it to the docs or throw it in an example perhaps? |
Ah, alright, that's cool by me. I won't be adding this to the docs or making an example out of it, though. It would be better to just point people to your comment, imo. |
Summary
Add support for CRUD operations on application emojis via the REST API.
Added
API calls for application emojis.
API::Application.list_application_emojis
API::Application.get_application_emoji
API::Application.create_application_emoji
API::Application.edit_application_emoji
API::Application.delete_application_emoji
Abstractions for application emojis.
Bot#application_emojis
Bot#get_application_emoji
Bot#create_application_emoji
Bot#edit_application_emoji
Bot#delete_application_emoji