Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save GuillaumeDaviid/68afbea2baebf713e225899f0ca0cf08 to your computer and use it in GitHub Desktop.

Select an option

Save GuillaumeDaviid/68afbea2baebf713e225899f0ca0cf08 to your computer and use it in GitHub Desktop.
import postMessage
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