A twitter bot written in Typescript. Features:
- Track multiple phrases (env variable
TWITTER_TRACK_PHRASES
). - Retweet the tracked phrases.
- Reply the tracked phrases (env variable
TWITTER_REPLY_MESSAGE
).
- Reply to a tweet of the user that you want to analyze, and mention the user defined in the
TWITTER_ACCOUNT_TO_LISTEN
environment variable. - The account set with
TWITTER_API_KEY, TWITTER_API_SECRET_KEY, TWITTER_ACCESS_TOKEN_KEY, TWITTER_ACCESS_TOKEN_SECRET_KEY, TWITTER_BEARER_TOKEN
will reply to the your tweet with the information.
TWITTER_API_KEY=xxxxxxxxx
TWITTER_API_SECRET_KEY=xxxxxxxxx
TWITTER_ACCESS_TOKEN_KEY=xxxxxxxxx
TWITTER_ACCESS_TOKEN_SECRET_KEY=xxxxxxxxx
TWITTER_BEARER_TOKEN=xxxxxxxxx
TWITTER_TRACK_PHRASES=javascript,typescript,nodejs,programming,software,100daysofcode,wedevelopment
TWITTER_REPLY_MESSAGE="check this out"
MAX_QUEUE_LENGTH=300
ACTION_INTERVAL=72000
BOT_SCREEN_NAME=techrtbotpls
Notes:
ACTION_INTERVAL
: don't set this lower than 72000 ms, or you will hit your twitter api rate limit.BOT_SCREEN_NAME
: this env variable is used to prevent looping when replying to another bot, set it to your bot twitter account handle (e.g techrtbotpls).
# development
$ npm run start:dev
# production mode
$ npm run build && npm run start