Repository: line/line-bot-sdk-python
Pull request #263 (2020-04-16 15:33:31)

Updated: change sticon to emojis
Follow this news: https://developers.line.biz/en/news/2020/04/14/messaging-api-update-april-2020/

- [x] change Sticon  to Emojis.


Patch:
diff --git a/linebot/models/sticon.py b/linebot/models/emojis.py
similarity index 78%
rename from linebot/models/sticon.py
rename to linebot/models/emojis.py
index 6bd82d5..76a6be1 100644
--- a/linebot/models/sticon.py
+++ b/linebot/models/emojis.py
@@ -12,7 +12,7 @@
 #  License for the specific language governing permissions and limitations
 #  under the License.
 
-"""linebot.models.sticon module."""
+"""linebot.models.emojis module."""
 
 from __future__ import unicode_literals
 
@@ -23,20 +23,20 @@ from future.utils import with_metaclass
 from .base import Base
 
 
-class Sticon(with_metaclass(ABCMeta, Base)):
-    """Sticon.
+class Emojis(with_metaclass(ABCMeta, Base)):
+    """Emojis.
 
     https://developers.line.biz/en/reference/messaging-api/#text-message
 
     """
 
-    def __init__(self, index=None, product_id=None, sticon_id=None, **kwargs):
+    def __init__(self, index=None, product_id=None, emoji_id=None, **kwargs):
         """__init__ method.
 
         :param kwargs:
         """
-        super(Sticon, self).__init__(**kwargs)
+        super(Emojis, self).__init__(**kwargs)
 
         self.index = index
         self.product_id = product_id
-        self.sticon_id = sticon_id
+        self.emoji_id = emoji_id
diff --git a/linebot/models/messages.py b/linebot/models/messages.py
index 244eb73..32ddb83 100644
--- a/linebot/models/messages.py
+++ b/linebot/models/messages.py
@@ -20,7 +20,7 @@ from abc import ABCMeta
 
 from future.utils import with_metaclass
 
-from linebot.models.sticon import Sticon
+from linebot.models.emojis import Emojis
 from .base import Base
 
 
@@ -47,7 +47,7 @@ class TextMessage(Message):
     Message object which contains the text sent from the source.
     """
 
-    def __init__(self, id=None, text=None, sticon=None, **kwargs):
+    def __init__(self, id=None, text=None, emojis=None, **kwargs):
         """__init__ method.
 
         :param str id: Message ID
@@ -59,16 +59,16 @@ class TextMessage(Message):
 
         self.type = 'text'
         self.text = text
-        if sticon:
-            new_sticons = []
-            for action in sticon:
-                sticon_obj = self.get_or_new_from_json_dict(
-                    action, Sticon
+        if emojis:
+            new_emojis = []
+            for emoji in emojis:
+                emoji_object = self.get_or_new_from_json_dict(
+                    emoji, Emojis
                 )
-                if sticon_obj:
-                    new_sticons.append(sticon_obj)
-            self.sticon = new_sticons
-        self.sticon = sticon
+                if emoji_object:
+                    new_emojis.append(emoji_object)
+            self.emojis = new_emojis
+        self.emojis = emojis
 
 
 class ImageMessage(Message):


Test patch:
diff --git a/tests/models/test_text_message.py b/tests/models/test_text_message.py
index 73d8ef7..3b934ad 100644
--- a/tests/models/test_text_message.py
+++ b/tests/models/test_text_message.py
@@ -17,25 +17,25 @@ from __future__ import unicode_literals, absolute_import
 import unittest
 
 from linebot.models import TextMessage
-from linebot.models.sticon import Sticon
+from linebot.models.emojis import Emojis
 from tests.models.serialize_test_case import SerializeTestCase
 
 
 class TestTextMessage(SerializeTestCase):
-    def test_sticon(self):
+    def test_emojis(self):
         arg = {
             "type": "text",
             "text": "$ LINE emoji $",
-            'sticon': [
-                Sticon(
+            'emojis': [
+                Emojis(
                     index=0,
                     product_id='5ac1bfd5040ab15980c9b435',
-                    sticon_id='001'
+                    emoji_id='001'
                 ),
-                Sticon(
+                Emojis(
                     index=13,
                     product_id='5ac1bfd5040ab15980c9b435',
-                    sticon_id='002'
+                    emoji_id='002'
                 ),
             ]
         }
@@ -44,7 +44,7 @@ class TestTextMessage(SerializeTestCase):
             TextMessage(**arg).as_json_dict()
         )
 
-    def test_null_sticon(self):
+    def test_null_emojis(self):
         arg = {
             "type": "text",
             "text": "\uDBC0\uDC84 LINE original emoji"