Merge branch 'main' of git.corrupt.link:liz/m2b

This commit is contained in:
Elizabeth Cray 2025-02-06 22:20:06 -05:00
commit d9201697cf
2 changed files with 6 additions and 3 deletions

View File

@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// TODO: IMPORTANT... links aren't showing previews on Bsky
import "dotenv/config";
import { appendFileSync, existsSync, readFileSync, unlinkSync, writeFileSync, createWriteStream } from 'fs';
import { finished } from 'stream/promises';
@ -171,6 +173,7 @@ client.get(`/accounts/${process.env.MASTODON_ID}/statuses`, {
});
if (status.mentions > 0 && status.in_reply_to_id !== null){
// Post is a reply
// TODO: This isn't working yet
const replyTo = [...status.mentions].filter((mention) => mention.id === status.in_reply_to_account_id);
if (replyTo.length > 0){
text = `Reply to: ${replyTo[0].url}/@${replyTo[0].acct}/${status.in_reply_to_id}\n${text}`;
@ -205,4 +208,4 @@ client.get(`/accounts/${process.env.MASTODON_ID}/statuses`, {
}
}
}
});
});

4
run.sh Normal file → Executable file
View File

@ -1,3 +1,3 @@
#!/bin/bash
/usr/bin/node index.mjs
rm .temp_*
/usr/bin/node /home/liz/m2b/index.mjs
rm .temp_*