AminoJS / Amino.JS

A powerful JavaScript library for interacting with the Amino API :star2:
MIT License
27 stars 5 forks source link

Fire a event when message is received? #59

Closed kurai021 closed 5 years ago

kurai021 commented 5 years ago

I want to do a bot for Amino but I can't find a method to get the last message, fire an event and send a message (not using intervals), maybe like Telegram bots API

akatsukilevi commented 5 years ago

Last message from a specific chat you mean?

kurai021 commented 5 years ago

I want to get the last message received from a chat in real time. But I'm not sure that using an interval every certain number of seconds calling getChat is the smartest way to do it

akatsukilevi commented 5 years ago

First of all, i'm really sorry for the delay! I was checking the Amino on a MIMT proxy over my computer, and i checked that it does exactly this way. You can make a function to compare the message list. If the list it just got is the same as the list it already have, it can fire a new message event, sending only the messages who are different

kurai021 commented 5 years ago

thanks for your answer :D