# -*- coding: utf-8 -*-
from linepy import *

client = LineClient()
#client = LineClient(authToken='AUTHTOKEN')

client.log("Auth Token : " + str(client.authToken))

poll = LinePoll(client)

# Receive messages from LinePoll
def RECEIVE_MESSAGE(op):
    msg = op.message

    text = msg.text
    msg_id = msg.id
    receiver = msg.to
    sender = msg._from

    if msg.contentType == 0:
        contact = client.getContact(receiver)
        txt = '[%s] %s' % (contact.displayName, text)
        client.sendMessage(receiver, txt)
        client.log(txt)

# Add function to LinePoll
poll.addOpInterruptWithDict({
    OpType.RECEIVE_MESSAGE: RECEIVE_MESSAGE
})

while True:
    poll.trace()
@@ -371,40 +371,183 @@
 om%0D%0A
-%0D%0A    if msg.contentType == 0:%0D%0A
+    %0D%0A    # Check content only text message%0D%0A    if msg.contentType == 0:%0D%0A        # Check only group chat%0D%0A        if msg.toType == 2:%0D%0A            # Get sender contact%0D%0A    
     
@@ -582,19 +582,21 @@
 act(
-receiv
+send
 er)%0D%0A
+    
     
@@ -642,24 +642,58 @@
 ame, text)%0D%0A
+            # Send a message%0D%0A    
         clie
@@ -719,24 +719,53 @@
 iver, txt)%0D%0A
+            # Print log%0D%0A    
         clie
@@ -918,8 +918,10 @@
 .trace()
+%0D%0A

Change receiver contact to sender