Repost tweeted messages from interested Twitter users via Discord webhooks.
- Run automated install script (installs .NET 5 SDK and clones repository):
curl https://raw.githubusercontent.com/versx/Retweety/master/scripts/install.sh > install.sh && chmod +x install.sh && ./install.sh && rm install.sh
Alternatively, if you already have .NET 5 SDK installed, run the following commands before proceeding below.
git clone https://github.com/versx/Retweety && cd Retweety
dotnet build
cp config.example.json bin/config.json
Once the project is cloned and .NET 5 SDK is installed continue on:
- Head to Twitter's Developer Portal
- Create a new Twitter App, set name, description, and website, ignore callback url.
- Click
Keys and Access Tokens
tab to get your Twitter App credentials. - Input your Twitter App's consumer key, consumer secret, access token, and access token secret in the
bin/config.json
config file. - Set interested user ID(s) as property key(s) under the
accounts
config section. - Set a new JSON key using the user ID of the Twitter account to take a list of webhook urls that will receive the tweeted message. See the below config example format if unsure.
- Input the bot properties under the
bot
config section to set the desired name and optional icon url. - Build the executable file
dotnet build
. - Start Retweety from the
bin
folder:dotnet Retweety.dll
.
{
// Twitter API consumer key
"consumerKey": "<TWITTER_ACCOUNT_CONSUMER_KEY>",
// Twitter API consumer secret
"consumerSecret": "<TWITTER_ACCOUNT_CONSUMER_SECRET>",
// Twitter API access token
"accessToken": "<TWITTER_ACCOUNT_ACCESS_TOKEN>",
// Twitter API access token secret
"accessTokenSecret": "<TWITTER_ACCOUNT_TOKEN_SECRET>",
// Dictionary of interested users to repost tweeted messages
"accounts": {
// Twitter User ID to follow and repost tweets from
"2839430431": [
// List of webhooks the tweets will be sent to
"https://discordapp.com/...."
]
},
// Bot display settings for embed post
"bot": {
// Bot name for Discord embed message
"name": "Retweety",
// Bot icon url for Discord embed message (optional)
"iconUrl": ""
},
// Discord embed message template format
"embedTemplate": "{{url}}"
}
Key | Value | Description |
---|---|---|
url |
https://twitter.com/34... | Tweet url |
text |
This is a test tweet | Tweet text |
full_text |
This is a test tweet from user test | Full Tweet text |
id |
34343434343 | Tweet ID |
created_at |
||
favorite_count |
||
favorited |
||
filter_level |
||
is_retweet |
||
language |
||
possibly_sensitive |
||
prefix |
||
quote_count |
||
reply_count |
||
retweet_count |
||
retweeted |
||
suffix |
||
truncated |
||
tweet_mode |
||
`` |