#Bot executed all command when started up

1 messages · Page 1 of 1 (latest)

final forum
#

So when you log in into Whatsapp web, whatsapp will fetch all the new message, my bot will respond to almost all of them and will create a massive spam. can this be prevented?

lapis oriole
#

Just ignore it based on timestamp of message chat or skip them several time after login

final forum
#

beecause sometimes if the bot is in a group that is very active

#

and the bot stay offline for a long time

#

when it turned on, it will spam all the commands

hybrid quiver
#

but this will not listen to your own messages, message_create listens to your messages.

final forum
haughty bloom
#

compare timestamps

#

compare the message's timestamp to Date.now()

#

if the message was sent before now, ignore it

final forum
haughty bloom
#

what I need is

final forum
#

My brain is dying

haughty bloom
#

if (message.timestamp + (RANGE IN MS HERE) < Date.now()) return;

#

literally

#

so for example

#

if (message.timestamp + (60000) < Date.now()) return;

#

if the message is within the last 60 seconds, process it

final forum
#

and @haughty bloom

#

Hello does anybody knows how to get message content/body form message_reaction events?

lapis oriole
haughty bloom
final forum
haughty bloom
#

not right now, no

#

you can

#

but you have to do some clever engineering

final forum
#

because my brain is overloaded

final forum
final forum
#

.