Created
July 29, 2015 17:58
-
-
Save ibotdotout/382369f272b9a2804318 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# original: https://github.com/carpedm20/LINE/blob/master/examples/echobot.py | |
from line import LineClient, LineGroup, LineContact | |
try: | |
client = LineClient("ID", "PASSWORD") | |
print client.authToken #print authToken before error and use this login again | |
#client = LineClient(authToken="AUTHTOKEN") | |
except: | |
print "Login Failed" | |
while True: | |
op_list = [] | |
for op in client.longPoll(): | |
op_list.append(op) | |
for op in op_list: | |
sender = op[0] | |
receiver = op[1] | |
message = op[2] | |
msg = message.text | |
#receiver.sendMessage("[%s] %s" % (sender.name, msg)) #this send message to ourselft that make infinity loop | |
sender.sendMessage("[%s] %s" % (sender.name, msg)) #send message back to sender |
tuyl
commented
Jun 27, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment