-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathecho.py
42 lines (34 loc) · 929 Bytes
/
echo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# -*- coding: utf-8 -*-
import asyncio
from LineSync import *
cl = LineNext('ios')
"""
LineNext(*args)
args:
client_name: pass one of client name, see models.py
"""
cl.login(qr=True)
"""
Client.login(*args)
args:
qr: bool pass True if wanna login with qr
token: string pass a string token if have
mail: string of email which registered on Line
passwd: string of password from email registered
cert: string cert after login email pass once if want login with cert
"""
cl.auth.url('/P4')
@cl.poll.hooks(type=25, filters=Filters.text)
async def echo_message(msg):
"""
This function will be catch all any message of text
"""
text = msg.text.lower()
if text == "helo":
await cl.talk.sendMessage(msg.to, "Hello")
if text == "hey":
await cl.talk.sendMessage(msg.to, "hey")
print("Program Started")
print("Name: ",cl.profile.displayName)
loop = asyncio.get_event_loop()
loop.run_until_complete(cl.poll.streams())