UNPKG

purrbot-api

Version:

The official API wrapper for the Purrbot.site API 100% API Coverage 100% Type-Script coverage

19 lines 616 B
import { baseURL } from './util.js'; export default async (text, options) => { const res = (await fetch(`${baseURL}/owoify`, { method: 'POST', body: JSON.stringify({ text, ...(options ? 'replaceWords' in options ? { ...options, 'replace-words': options.replaceWords } : options : {}), }), headers: { 'Content-Type': 'application/json' }, }).then((r) => r.json())); if (res.error) throw new Error(res.message); return res.text; }; //# sourceMappingURL=owoify.js.map