Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

A Discord bot that forwards Tweets into your Discord server.

License

Notifications You must be signed in to change notification settings

peterthehan/discord-twitter-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Discord Twitter Bot

Discord Twitter Follow

A Discord bot that forwards Tweets into your Discord server.

Take note that this bot uses the search API and not the streaming API. This means that the results are not exhaustive nor are they instantaneous. The trade-off is the ability to use powerful search operators to filter the results to your needs.

Twitter Developer Account Setup

Apply for a Twitter developer account in order to access their standard APIs. You will receive the necessary keys and secrets once your account is approved.

Take note of the keys and secrets provided. You will need these in the next section.

Setup

  1. Follow the instructions in create-discord-bot.

    Don't forget to give your bot the Manage Webhooks permission!

  2. Open the .env file and add your Twitter keys and secrets:

    TWITTER_CONSUMER_KEY=PLACEHOLDER
    TWITTER_CONSUMER_SECRET=PLACEHOLDER
    TWITTER_ACCESS_TOKEN_KEY=PLACEHOLDER
    TWITTER_ACCESS_TOKEN_SECRET=PLACEHOLDER
    
  3. Download this bot and move the src-discord-twitter-bot folder into the /src/bots folder from step 1.

    Run npm i -s twitter-lite@^0.14.0 to install this bot's dependencies.

  4. Open config.json to configure your own settings:

    [
      {
        "channelId": "649020657522180128",
        "delay": 3600000,
        "randomDelay": 300000,
        "embed": true,
        "spoiler": false,
        "parameters": {
          "q": "from:@NoContextWeeb exclude:replies exclude:retweets",
          "result_type": "recent",
          "count": 1
        }
      }
    ]

    Add as many rules as you want to configure for other channels/servers.

  5. npm start to run the bot.

Visit for more help or information!