note: twitter seems to have removed the ability to read tweets from the free tier of the v1.1 API, so if the bot isn't working, that's likely why
this is an irc bot that previews tweets whenever a link to a tweet is posted in a channel
if you have img2irc
installed, or use the included docker container, it can optionally show the profile picture of the user
edit config.json.example
, the irc
and twitter
sections are self-explanatory
note: you must do this first before proceding!
docker-compose up -d
git clone https://github.com/anatolybazarov/img2irc
cd img2irc && cargo build --release
sudo cp target/release/img2irc /usr/local/bin
sudo npm install -g npx
sudo npm install -g tsx
npx tsx index.ts
command | argument | function |
---|---|---|
!image |
on or off |
toggles whether the profile picture should be displayed |
!width |
default is 10 |
the width of the profile picture |
!len |
default is 400 |
the maximum number of characters for the tweet, after which it will truncate and add an ellipsis |
!wrap |
default is 60 |
the number of characters after which to wrap the text, influences the width of the text box |
the bot.ansi
section controls the arguments which will be sent to img2irc
, and correspond to the command-line arguments which img2irc
takes
for information about those arguments, see the usage details here
the default settings are
"ansi": {
"width": 10,
"contrast": 30
},
where width
is the width of the profile picture, and contrast
increases the contrast by 30
(max: 255
)
for flags which do not take any arguments, simply set the value to true
, e.g.,
"ansi": {
"width": 10,
"contrast": 30,
"sharpen": true
},
you can change the colour of the display name, username, date, tweet text, retweets and likes
"colors": {
"name": "",
"user": "",
"date": "14",
"text": "",
"retweets": "09",
"likes": "04"
},
leaving the field blank means no explicit colour. here are the mirc colour codes
if the colour code is a single digit, you should pad it with a leading zero (e.g., 09
instead of 9
)
you can modify which symbols to use for the retweets and likes as well
"symbols": {
"retweets": "↻",
"likes": "❤"
}