-
Notifications
You must be signed in to change notification settings - Fork 244
Use LINE emoji in messages #202
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
Conversation
clsung
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func (m *TextMessage) AddEmoji(emojis *Emoji) SendingMessage {
emojis -> emoji
func (m *TextMessage) AddEmoji(emoji *Emoji) SendingMessage {
|
@clsung update by your suggestion, thank you |
Codecov Report
@@ Coverage Diff @@
## master #202 +/- ##
==========================================
+ Coverage 75.95% 76.61% +0.66%
==========================================
Files 28 30 +2
Lines 2200 2254 +54
==========================================
+ Hits 1671 1727 +56
+ Misses 432 429 -3
- Partials 97 98 +1
Continue to review full report at Codecov.
|
| return m | ||
| } | ||
|
|
||
| // AddEmoji method of TextMessage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe need to add this method to SendingMessage interface?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nasa9084 -san,
The emoji value only works for TextMessage, and not working for ImageMessage or other message types.
If I add it as an interface for XendMessage, I might do nothing if message type is not TextMessage.
How do you think?
e.g.
// AddEmoji method of ImageMessage
func (m *ImageMessage) AddEmoji(emoji *Emoji) SendingMessage {
return m
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm newer person for this project so I'm not sure though, I think the method is considered to be used as method chain like m.AddEmoji(emoji1).AddEmoji(emoji2).
I can see:
AddEmojiis returningSendingMessageinterface- the field
emojisis private field NewTextMessagedoes not have argument to set emojis
so users cannot set multiple emojis without type assertion, if SendingMessage does not have AddEmoji method. I think it is hard to use if we need to do like m.AddEmoji(emoji1).(*TextMessage).AddEmoji(emoji2)
I think we have some options:
- Add
AddEmojimethod toSendingMessageinterface - Change not to return
SendingMessagefor all methods, means removeSendingMessageinterface - Change
AddEmojimethod toAddEmojisto be able to pass[]*Emoji - Change the
NewTextMessageto be able to pass emojis - ... or maybe other choice
HDYT?
cc/ @oklahomer @k2wanko
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nasa9084 @oklahomer Any conclusion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nasa9084 Could you check again? I have fixed your question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry to be late reply, please wait for a while....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I checked and LGTM
|
sorry to be late merging |
Fixed #199
https://developers.line.biz/en/news/2020/04/14/messaging-api-update-april-2020/