#count how many times someone has been mentioned

1 messages · Page 1 of 1 (latest)

hearty grove
#

message.mentions would have the users mentioned in that message

#

Go through channel.history and check if the user is in the mentions. If yes then add to a counter

grand trout
hearty grove
#

Try checking the docs

#

.rtfm channel.history

hearty grove
#

1st one

#

See the examples on GitHub to know how the library is used

grand trout
# hearty grove 1st one

i know how to loop though the chat history
i dont know how to check for a specific word (mention) in a message

hearty grove
#

Oh wait sorry

#

I thought you said you didn't know how to iterate

#

My bad

#

Well you can do if "word" in msg.content

grand trout
#

i did this but it gives me an error

mental socket
grand trout
mental socket
mental socket
# grand trout

okay, try this

x=str(user)
if x in msg.contet:
  count+=1
grand trout
hearty grove
grand trout
hearty grove
#

Np!