Simp-O-Matic

Dumb Discord bot in TS.
git clone git://git.knutsen.co/Simp-O-Matic
Log | Files | Refs | README | LICENSE

jsonblob.ts (422B)


import JSONBlobClient from 'jsonblob';

const JSONBLOB_ID = process.env['JSONBLOB_ID'];

const client = new JSONBlobClient(JSONBLOB_ID);

export const latest = () => new Promise((resolve, reject) => {
	client.getBlob(JSONBLOB_ID)
		.then(raw => resolve(raw))
		.catch(er => reject(er));
});

export const update = async (stringified : string) => {
	return await client.updateBlob(JSON.parse(stringified), JSONBLOB_ID);
};