carpedm20 / LINE

May the LINE be with you...
http://carpedm20.github.io/line/
Other
819 stars 192 forks source link

how would I get Messages sent from self recognised? #148

Closed ghost closed 6 years ago

ghost commented 6 years ago

So I'm wondering how I'd go about getting messages I sent through an account which has the Bot on recognise messages like Say: etc

Shivelight commented 6 years ago

Listen to sendMessage operation

ghost commented 6 years ago

Can you give me any idea on what you mean exactly?

Shivelight commented 6 years ago

I don't really get what you mean. But if you are trying to recognize messages you sent, you have to listen to sendMessage operation (internally operation 25/SEND_MESSAGE). Otherwise, you want to listen to RECEIVE_MESSAGE operation. Have a good read here: http://altrepo.eu/git/line-protocol/blob/master/line-protocol.md

ghost commented 6 years ago

I'll take a look later on tonight thanks, and what I meant was if I put the bot on myself it doesn't recognise commands I've set that I send out Say for example :Help it works for other people but not me if that makes sense. Like it doesn't see messages it has sent only ones sent by others

Shivelight commented 6 years ago

You have to handle both SEND_MESSAGE and RECEIVE_MESSAGE to achieve that. You can't read your own message because they all are outgoing operation (technically, every operation are the same) which is SEND_MESSAGE operation. Since you are only listening/handling to RECEIVE_MESSAGE, you wil never receive your own message.

ghost commented 6 years ago

Thanks I've figured that part out after tons of attempts xD

Shivelight commented 6 years ago

Anytime 👌🏻