Public
Back
Version 2
7/9/2023
async function postQuoteOfTheDay({ instance, communityId, auth }: {
instance: string;
communityId: number;
auth: string;
}) {
const { LemmyHttp } = await import("npm:lemmy-js-client");
let client = new LemmyHttp(`https://${instance}`, {
fetchFunction: fetch,
});
const quote = me.unusuedQuotes[0];
if (!quote) {
return;
}
const ret = await client.createPost({
community_id: communityId,
name: "Test title from val.town",
body: quote,
auth: auth,
});
return ret;
}
Updated: October 23, 2023