Compare commits

..

No commits in common. "main" and "deps" have entirely different histories.
main ... deps

4 changed files with 33 additions and 49 deletions

View file

@ -45,14 +45,6 @@ Then run `npm install .` to install npm modules `axios` and `ws`.
Start the bot with the traditional `node index.js`. Start the bot with the traditional `node index.js`.
However, you probably want this to run automatically on a web server. You can do this with `systemd` using the example unit file: `mastodon-clippy.service.example`. Adjust this for your user and paths, and then activate it:
```bash
sudo cp mastodon-clippy.service.example /etc/systemd/system/mastodon-clippy.service
sudo systemctl enable mastodon-clippy.service
sudo systemctl start mastodon-clippy service
```
## interacting with the bot ## interacting with the bot
To "sign up" for notification from your bot, users have two options: To "sign up" for notification from your bot, users have two options:

View file

@ -53,33 +53,25 @@ function initiateSettings(socket) {
// return random suggestion string // return random suggestion string
function suggestion(username) { function suggestion(username) {
const n = crypto.randomInt(12) const n = crypto.randomInt(8)
switch(n) { switch(n) {
case 0: case 0:
return 'How about logging off instead?'; return 'How about logging off instead?';
case 1: case 1:
return `Would you like to delete your toot, @${username}?`; return `Would you like to delete your toot, ${username}?`;
case 2: case 2:
return 'Can I help you take a walk outside? 🚶‍➡️'; return 'Can I help you take a walk outside?';
case 3: case 3:
return 'You may like to reconsider your life choices.'; return 'You may like to reconsider your life choices.';
case 4: case 4:
return 'Why not try looking at #CatsOfMastodon instead?'; return 'Why not try looking at #CatsOfMastodon instead?';
case 5: case 5:
return `Come on @${username}, we've talked about this. 🤷‍♂️`; return `Come on ${username}, we've talked about this.`;
case 6: case 6:
return `You should go look at some trees. Trees are calming 🌳`; return `You should go look at some trees. Trees are calming`;
case 7: case 7:
return `I'm not angry. I'm just very disappointed. 😔`; return `I'm not angry. I'm just very disappointed.`;
case 8:
return `You said you were going to stop doing that ...and yet here we are.`;
case 9:
return `Time to touch some grass 🌱`;
case 10:
return `Why not have a nice cup of tea instead? 🫖`;
case 11:
return `And yet you still haven't read all of those books in your TBR pile. 🤔`;
} }
} }

22
package-lock.json generated
View file

@ -1,26 +1,26 @@
{ {
"name": "mastodon-clippy", "name": "mastodon-clippy",
"version": "1.1.1", "version": "1.1.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"axios": { "axios": {
"version": "0.21.4", "version": "0.21.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
"integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
"requires": { "requires": {
"follow-redirects": "^1.14.0" "follow-redirects": "^1.10.0"
} }
}, },
"follow-redirects": { "follow-redirects": {
"version": "1.15.6", "version": "1.14.1",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz",
"integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==" "integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg=="
}, },
"ws": { "ws": {
"version": "7.5.10", "version": "7.5.2",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.2.tgz",
"integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==" "integrity": "sha512-lkF7AWRicoB9mAgjeKbGqVUekLnSNO4VjKVnuPHpQeOxZOErX6BPXwJk70nFslRCEEA8EVW7ZjKwXaP9N+1sKQ=="
} }
} }
} }

View file

@ -1,8 +1,8 @@
{ {
"name": "mastodon-clippy", "name": "mastodon-clippy",
"version": "1.1.2", "version": "1.1.1",
"description": "Mastodon clippy bot", "description": "Mastodon clippy bot",
"repository": "https://git.suboptimal.solutions/hugh/mastodon-clippy", "repository": "https://github.com/hughrun/mastodon-clippy.git",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
@ -10,7 +10,7 @@
"author": "Hugh Rundle <hugh@hughrundle.net> (https://www.hughrundle.net)", "author": "Hugh Rundle <hugh@hughrundle.net> (https://www.hughrundle.net)",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"dependencies": { "dependencies": {
"axios": "^1.7.3", "axios": "^0.21.2",
"ws": "^8.18" "ws": "^7.5.2"
} }
} }