see all references to topic in CWs

- not just exact matches :-)
This commit is contained in:
Hugh Rundle 2021-05-23 15:43:09 +10:00
parent 23735ced6f
commit e4ad64b0c8
3 changed files with 5 additions and 5 deletions

View file

@ -2,7 +2,7 @@
Clippy bot for mastodon. Clippy bot for mastodon.
(c) Hugh Rundle, licensed AGPL 3.0+ (c) Hugh Rundle, licensed AGPL 3.0 or later
Contact @hugh@ausglam.space Contact @hugh@ausglam.space
NOTE: Since requesting users must be followed by the bot, they will "out" themselves by using it. NOTE: Since requesting users must be followed by the bot, they will "out" themselves by using it.
@ -11,7 +11,7 @@
// require modules // require modules
const axios = require('axios') const axios = require('axios')
const crypto = require('crypto') // built in node module requires v12.19 or higher const crypto = require('crypto') // built-in node module requires v12.19 or higher
const WebSocket = require('ws') const WebSocket = require('ws')
// clippy settings // clippy settings
@ -143,7 +143,7 @@ ws.on('message', msg => {
if ( data.content.includes(topic) ) { if ( data.content.includes(topic) ) {
sendResponse(rip, user) sendResponse(rip, user)
} }
else if (data.spoiler_text == topic) { else if (data.spoiler_text.includes(topic)) {
sendResponse(rip, user) sendResponse(rip, user)
} }
else if (data.tags.includes(topic)) { else if (data.tags.includes(topic)) {

2
package-lock.json generated
View file

@ -1,6 +1,6 @@
{ {
"name": "mastodon-clippy", "name": "mastodon-clippy",
"version": "0.1.0", "version": "1.0.1",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View file

@ -1,6 +1,6 @@
{ {
"name": "mastodon-clippy", "name": "mastodon-clippy",
"version": "1.0.0", "version": "1.0.1",
"description": "Mastodon clippy bot", "description": "Mastodon clippy bot",
"repository": "https://github.com/hughrun/mastodon-clippy.git", "repository": "https://github.com/hughrun/mastodon-clippy.git",
"main": "index.js", "main": "index.js",