Skip to content

Commit 93fcc65

Browse files
authored
Updated: change sticon to emojis (#263)
* updated: Sticon to Emojis * test: update Sticon to Emojis
1 parent 9592951 commit 93fcc65

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed

linebot/models/sticon.py renamed to linebot/models/emojis.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414

15-
"""linebot.models.sticon module."""
15+
"""linebot.models.emojis module."""
1616

1717
from __future__ import unicode_literals
1818

@@ -23,20 +23,20 @@
2323
from .base import Base
2424

2525

26-
class Sticon(with_metaclass(ABCMeta, Base)):
27-
"""Sticon.
26+
class Emojis(with_metaclass(ABCMeta, Base)):
27+
"""Emojis.
2828
2929
https://developers.line.biz/en/reference/messaging-api/#text-message
3030
3131
"""
3232

33-
def __init__(self, index=None, product_id=None, sticon_id=None, **kwargs):
33+
def __init__(self, index=None, product_id=None, emoji_id=None, **kwargs):
3434
"""__init__ method.
3535
3636
:param kwargs:
3737
"""
38-
super(Sticon, self).__init__(**kwargs)
38+
super(Emojis, self).__init__(**kwargs)
3939

4040
self.index = index
4141
self.product_id = product_id
42-
self.sticon_id = sticon_id
42+
self.emoji_id = emoji_id

linebot/models/messages.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
from future.utils import with_metaclass
2222

23-
from linebot.models.sticon import Sticon
23+
from linebot.models.emojis import Emojis
2424
from .base import Base
2525

2626

@@ -47,7 +47,7 @@ class TextMessage(Message):
4747
Message object which contains the text sent from the source.
4848
"""
4949

50-
def __init__(self, id=None, text=None, sticon=None, **kwargs):
50+
def __init__(self, id=None, text=None, emojis=None, **kwargs):
5151
"""__init__ method.
5252
5353
:param str id: Message ID
@@ -59,16 +59,16 @@ def __init__(self, id=None, text=None, sticon=None, **kwargs):
5959

6060
self.type = 'text'
6161
self.text = text
62-
if sticon:
63-
new_sticons = []
64-
for action in sticon:
65-
sticon_obj = self.get_or_new_from_json_dict(
66-
action, Sticon
62+
if emojis:
63+
new_emojis = []
64+
for emoji in emojis:
65+
emoji_object = self.get_or_new_from_json_dict(
66+
emoji, Emojis
6767
)
68-
if sticon_obj:
69-
new_sticons.append(sticon_obj)
70-
self.sticon = new_sticons
71-
self.sticon = sticon
68+
if emoji_object:
69+
new_emojis.append(emoji_object)
70+
self.emojis = new_emojis
71+
self.emojis = emojis
7272

7373

7474
class ImageMessage(Message):

tests/models/test_text_message.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,25 @@
1717
import unittest
1818

1919
from linebot.models import TextMessage
20-
from linebot.models.sticon import Sticon
20+
from linebot.models.emojis import Emojis
2121
from tests.models.serialize_test_case import SerializeTestCase
2222

2323

2424
class TestTextMessage(SerializeTestCase):
25-
def test_sticon(self):
25+
def test_emojis(self):
2626
arg = {
2727
"type": "text",
2828
"text": "$ LINE emoji $",
29-
'sticon': [
30-
Sticon(
29+
'emojis': [
30+
Emojis(
3131
index=0,
3232
product_id='5ac1bfd5040ab15980c9b435',
33-
sticon_id='001'
33+
emoji_id='001'
3434
),
35-
Sticon(
35+
Emojis(
3636
index=13,
3737
product_id='5ac1bfd5040ab15980c9b435',
38-
sticon_id='002'
38+
emoji_id='002'
3939
),
4040
]
4141
}
@@ -44,7 +44,7 @@ def test_sticon(self):
4444
TextMessage(**arg).as_json_dict()
4545
)
4646

47-
def test_null_sticon(self):
47+
def test_null_emojis(self):
4848
arg = {
4949
"type": "text",
5050
"text": "\uDBC0\uDC84 LINE original emoji"

0 commit comments

Comments
 (0)