Twitter's consumer key, see README.md on how to find it.
Example: xxxxxxxxxxxxxxxxxxxxxxxx
Twitter's consumer secret, see README.md on how to find it.
Example: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Twitter's access token key, see README.md on how to find it.
Example: 0000000000000000000-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Twitter's access token secret, see README.md on how to find it.
Example: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Google Service Account JWT e-mail address, see README.md on how to find it.
Example: [email protected]
Google Service Account JWT private key, see README.md on how to find it.
Example: -----BEGIN PRIVATE KEY-----\nxxxxxxxxxxxxxxxx\n-----END PRIVATE KEY-----\n
(
The name of the folder where files are located at.
Example: Cats
- Default:
console
- Options:
discord
|slack
|console
discord
requiresDISCORD_HOOK_ENDPOINT
slack
requiresSLACK_HOOK_ENDPOINT
Specifies what notification worker should be used for success/failure messages.
Versions f578280 and below had the default as discord
, and if DISCORD_HOOK_ENDPOINT
wasn't set, all messages would've been voided. To avoid this, use NOTIFICATION_WORKER=console
.
- Requires:
NOTIFICATION_WORKER=discord
Specifies the username for Discord webhook, if it isn't specified, the default one specified in Discord channel settings is used.
- Requires:
NOTIFICATION_WORKER=discord
- Required by
NOTIFICATION_WORKER=discord
Specifies the webhook URI path.
Example: /api/webhooks/000000000000000000/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- Requires:
NOTIFICATION_WORKER=slack
- Required by
NOTIFICATION_WORKER=slack
Specifies the webhook URI path.
Example: /services/XXXXXXXXX/XXXXXXXXXXX/xxxxxxxxxxxxxxxxxxxxxxxx
- Requires:
NOTIFICATION_WORKER=slack
Specifies the username for Slack webhook, if it isn't specified, the default one specified in Slack incoming-webhook settings is used.
Deta Project key. If specified, it will cache the file listing from Google Drive inside Deta Base, which will speed up the process of fetching next time, as well as minimise the amount of Google Drive API requests. The cache is updated every 7 days.
It will also cache the last uploaded image/video as latest.(webp|mp4|gif)
and resized.jpg
(if it was an image, the resized/compressed Twitter upload) to Deta Drive, for use in other projects.
Before considering using this, consider the comment left in src/CacheWorker.ts:
/*
The thing about Deta is that its database is a glorified
REST-accessible JSON file, while it is free, it's also not very
fast for bulk operations, like updating a several-thousand
file listing cache.
So, this section bunk, while reducing the API calls to Google
Drive, it *will* eat up a lot of memory and CPU time. Beware
of this if you have a not-so-liberal serverless environment.
*/
Example: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Sentry is a service that uploads and catalogs all errors that happen in the bot. DSN is the provided link to upload all logs to, when you create a new project.
Example: https://[email protected]/0000000
- Default:
config
Deta Base table that holds values DETA_KEY_LAST_RUN
- the timestamp of last upload, DETA_KEY_LAST_CACHED
- the timestamp of last Google Drive cache (should be every 7 days), DETA_KEY_LAST_FOLDER_USED
- the name of last run's DRIVE_FOLDER
, DETA_KEY_LAST_FILENAME
- the filename of last upload.
If DRIVE_FOLDER
isn't last_folder_used
, a forced cache rebuild is initiated.
- Default:
cache
Deta Base table that holds the Google Drive listing cache.
- Default:
last_time_run
- Default:
last_time_drive_cached
- Default:
last_filename
- Default:
last_folder_used
- Default:
cache_drive
The Deta Drive name which will hold the last uploaded image/video.
- Default:
{fileName}
- Format values:
fileName
- uploaded file's filename
The status format string, seen on the uploaded Twitter post.
- Default:
Tweeted {fileName} ({id})
- Format values:
fileName
- uploaded file's filename,id
- the ID of the posted tweet
The success message format, seen on NOTIFICATION_WORKER
.
The most minimal configuration would be:
GOOGLE_EMAIL=
GOOGLE_KEY=
DRIVE_FOLDER=
TWITTER_ACCESS_TOKEN_KEY=
TWITTER_ACCESS_TOKEN_SECRET=
TWITTER_CONSUMER_KEY=
TWITTER_CONSUMER_SECRET=
All this does is upload random files from Drive to Twitter, and outputs the success/failure to the terminal, that's it.
To add Discord notifications:
<minimal>
NOTIFICATION_WORKER=discord
DISCORD_HOOK_ENDPOINT=
Or for Slack:
<minimal>
NOTIFICATION_WORKER=slack
SLACK_HOOK_ENDPOINT=
The minimal setup for Deta caching is just:
<minimal>
DETA_KEY=