Post to Insta when tweeting

This commit is contained in:
Jordan Eldredge 2022-02-03 02:14:33 -05:00
parent 44d3f13273
commit 06584bd593
2 changed files with 4 additions and 2 deletions

View file

@ -125,7 +125,8 @@ async function main() {
case "tweet": {
console.log("tweet");
const hash = argv._[1];
await tweet(client, hash);
const md5 = await tweet(client, hash);
await insta(client, md5);
break;
}
case "insta": {

View file

@ -11,7 +11,7 @@ import UserContext from "../data/UserContext";
import TweetModel from "../data/TweetModel";
const temp = _temp.track();
export async function tweet(discordClient: Client, anything: string | null) {
export async function tweet(discordClient: Client, anything: string | null): Promise<string> {
const ctx = new UserContext();
const tweetBotChannel = await discordClient.channels.fetch(
TWEET_BOT_CHANNEL_ID
@ -86,6 +86,7 @@ export async function tweet(discordClient: Client, anything: string | null) {
);
}
logger.info("Tweeted a skin", { md5, filename, tweetId });
return md5;
}
async function getResizedScreenshot(md5: string): Promise<Buffer> {