"use strict";

const Promise = require("bluebird");
const fs = require("fs");
const path = require("path");
const createSession = require("@modular-matrix/create-session");
const sendImage = require("./");

return Promise.try(() => {
	return createSession("https://pixie.town/", { accessToken: require("../../../private/access-token") });
}).then((session) => {
	return Promise.try(() => {
		return sendImage(session, {
			roomID: "!TFtSgVEJlHMAhDyHOk:pixie.town",
			description: "potato.jpg",
			file: fs.createReadStream(path.join(__dirname, "./potato.jpg")),
			filename: "potato.jpg",
		});
	}).then((result) => {
		console.log(result);
	});
});
