Created
April 13, 2024 15:10
-
-
Save GuillaumeDaviid/68afbea2baebf713e225899f0ca0cf08 to your computer and use it in GitHub Desktop.
import postMessage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import postMessage from '../server/postMessage.js'; | |
| ... | |
| async function handleClick(e) { | |
| e.preventDefault(); | |
| setCountMsg(countMsg + 1); | |
| const response = await postMessage(newMsg); | |
| setMsg({ 'me': msg.me.concat(newMsg), 'bot': msg.bot.concat(response.content[0].text) }) | |
| setNewMsg(''); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment