line-py
                                
                                 line-py copied to clipboard
                                
                                    line-py copied to clipboard
                            
                            
                            
                        how to make a read bot
I want to make a bot to get the mid who has read and then turn into name, finally send it to the group ......but I have some problem...... who can help me QAQ THANKS~~~
from linepy import *
client = LINE()
print(client.authToken)
tracer = OEPoll(client)
def NOTIFIED_READ_MESSAGE(op):
	try:
		gid = op.param1
		mid = op.param2
		name = client.getContact(mid).displayName
		client.sendMessage(to=gid, text=name)
	except Exception as e:
		print(e)
tracer.addOpInterrupt({
	OpType.NOTIFIED_READ_MESSAGE: NOTIFIED_READ_MESSAGE
	})
while True:
	tracer.trace()
I think that should work? been ages since ive used this, but 99% sure this'll work (if you're doing groupbot method; singletrace is slightly different)
Hi I'm wondering what's the difference between singletrace and groupchat?
These two examples looks much the same. https://github.com/fadhiilrachman/line-py/blob/master/examples/groupbot.py https://github.com/fadhiilrachman/line-py/blob/master/examples/singletrace.py They all have the comment "This is sample for implement BOT in LINE group" Thank you
@dnfatas single trace you have a single function for all op and you then do an if/else list or something like that op.type == OpType.RECEIVE_MESSAGE
with groupbot you have a seperate function for each op
In that 1% It false xxddd
OpType.NOTIFIED_READ_MESSAGE: NOTIFIED_READ_MESSAGE TypeError: addOpInterrupt() missing 1 required positional argument: 'DisposeFunc'
oh my bad, @Zero2627 its tracer.addOpInterruptWithDict (i missed out the WithDict)