Skip to content

Commit

Permalink
Update vars
Browse files Browse the repository at this point in the history
  • Loading branch information
juanegiraldoa committed Apr 17, 2024
1 parent 9b15eb5 commit 540a0c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/WednesdayMyDudes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const DATE_FORMAT = 'YYYY-MM-DD';
const postOnWednesday = async (token: string, media_ids: string) => {
if (moment().day() === 3) {
const [lastPost]: any = await getTimeLine(token);
const lastPostDate = moment(lastPost.created_at).format(DATE_FORMAT);
if (lastPostDate !== moment().format(DATE_FORMAT)) {
const lastPostDate = lastPost ? moment(lastPost.created_at).format(DATE_FORMAT) : null;
if (!lastPostDate && lastPostDate !== moment().format(DATE_FORMAT)) {
await postStatus(token, media_ids);
return "It's Wednesday My Dudes";
} else return 'Already Posted My Dude';
Expand Down
2 changes: 1 addition & 1 deletion wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ compatibility_flags = ["nodejs_compat"]

[vars]
MASTODON_TOKEN = "J_DPBhWeklP_RNirnbtFH-SIFYJtwv9CJ8Bjyog_xrY"
MASTODON_WEDNESDAY_DUDE_MEDIA = "112271920451061861"
MASTODON_WEDNESDAY_DUDE_MEDIA = "112288098480431582"

[triggers]
crons = [ "0 8 * * wed" ]

0 comments on commit 540a0c3

Please sign in to comment.