The Slack API does not provide a way to pre-fill a user's message box. If you're looking to provide a user with a default message that they might choose to send, you could simply send it to them as a dm which they could copy and paste.
You could also send the user an interactive BlockKit message containing the proposed message and a button that will automatically send the message when pressed.
Imagine a set of blocks like this
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Proposed Message*\nThis is a message that you might want to send."
}
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Send!",
"emoji": True
},
"value": "This is a message that you might want to send.",
"action_id": "send_button_pressed"
}
]
}
]
}
and a listener like this
@app.action("send_button_pressed")
def handleSendPressed(ack, body):
ack()
generalChannelID = "C123456"
message = body["actions"][0]["value"]
client.chat_postMessage(channel=generalChannelID, text=message)
If you need the message to appear as if it came from the user, you'll need to specify a slack app user token and have the scope chat:write:user
.