#How to get my discord bot to respond to a certain word which may be included in a sentence

1 messages · Page 1 of 1 (latest)

unborn field
#

Sorry guys I am new to this all and am learning as I go along. I was hoping some can at least point me in the right direction as every where I look isn't helping

I want my bot to reply when it see a certain word in a message i.e the word "Ping" and reply with the word Pong

Me - hello please Ping with Pong
Bot reply - "Pong"

It is suggested is used - if (message.content == ('ping')

this only seems to work is the only word in the message is ping it will not work if I used anything else

Any ideas to help out an idiot, sorry if this is the wrong place to ask

regal bridgeBOT
#

<:_:957801942573256854> String.prototype.includes()
The includes() method performs a case-sensitive search to determine whether one string may be found within another string, returning true or false as appropriate.

unborn field
#

I have seen the .includes this does nothing and I am unsure why

plush arch
#

message.content.includes('ping')