Skip to content

Instantly share code, notes, and snippets.

@ibotdotout
Last active August 29, 2015 14:26
Show Gist options
  • Save ibotdotout/0a4aabc85c7767cb0679 to your computer and use it in GitHub Desktop.
Save ibotdotout/0a4aabc85c7767cb0679 to your computer and use it in GitHub Desktop.
send line message by using line ID
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"
lineID = "Enter target LineID"
try:
target = client._client.findContactByUserid(lineID)
c = LineContact(client, target)
c.sendMessage("hello")
except:
print("cant find LineID or your LineID is private ID")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment