#Command in a response to a message

1 messages · Page 1 of 1 (latest)

edgy berry
#

Is it possible to execute a command in a response to a message and get the contents of the message?

dawn rain
#

On every message or a message with specific content?

#

For example you could use on_message if you need to run something for every message sent.

You could use prefix commands if you want it to run if it starts with "!" Or any other charecters.

#

I'm not exactly sure your usage but if it is the second option I would use slash commands instead.

#

b!rtfm pyc on_message

edgy berry
#

Thank you for your response. I meant slash commands. What I meant to ask is can I get content of message that a command was response to?

dawn rain
#

Give me a second I need to get off my bus :)

#

ctx.interaction.message.reference.message_id than you can get/fetch the message and get the content

undone basin
#

Discord on message already has a message payload with it

#

Response*

#

As you can see in on_message it returns message. You can do message.content to retrieve the content of the message

#

If you look in docs. It says

on_message(message)

message object comes with a .content 
dawn rain
#

They are using slash commands, I thought they were talking about on message but they were not.