In order to use this project, you should have the following prerequisites:
-
A text editor such as Visual Studio Code or Atom.
-
Node.js installed.
-
A Twitter Account with Consumer API Keys/Access Tokens and Consumer API Secret/Access Token Secrets. To obtain these, go to this link and click on the Create New App button. Fill the form and then go to the Keys and Access Tokens tab.
-
Add the Consumer API Keys/Access Tokens and Consumer API Secret/Access Token Secrets as environment variables in the .env file (you can create one).
-
Discord.js and Twit packages should be installed.
First, clone the project from the Github Repository :
git clone https://github.com/thisisyashgarg/discord-tweeter-bot.git
And then, install the dependencies:
npm init -y
npm i
To start the bot and make it work, use the following command:
node index.js
Then, you can post a tweet on Discord with the prefix Tweet my message.
- Discord.js - Discord's Javascript library
- Twit - A twitter package for JavaScript which allows to access the Twitter API with Node.js
- [Yash Garg]