diff --git a/.gitmodules b/.gitmodules index 1eb51e4..cf3ce05 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "src/plugins/lib-spamwatch"] - path = src/plugins/lib-spamwatch +[submodule "src/spamwatch"] + path = src/spamwatch url = https://github.com/ABOCN/TelegramBot-SpamWatch diff --git a/src/commands/animal.js b/src/commands/animal.js index 5355df1..204015d 100644 --- a/src/commands/animal.js +++ b/src/commands/animal.js @@ -1,7 +1,7 @@ const Resources = require('../props/resources.json'); const { getStrings } = require('../plugins/checklang.js'); -const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js'); -const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch); +const { isOnSpamWatch } = require('../spamwatch/spamwatch.js'); +const spamwatchMiddleware = require('../spamwatch/Middleware.js')(isOnSpamWatch); const axios = require("axios"); module.exports = (bot) => { diff --git a/src/commands/codename.js b/src/commands/codename.js index 4f23137..220f511 100644 --- a/src/commands/codename.js +++ b/src/commands/codename.js @@ -1,7 +1,7 @@ const Resources = require('../props/resources.json'); const { getStrings } = require('../plugins/checklang.js'); -const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js'); -const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch); +const { isOnSpamWatch } = require('../spamwatch/spamwatch.js'); +const spamwatchMiddleware = require('../spamwatch/Middleware.js')(isOnSpamWatch); const axios = require('axios'); async function getDeviceList() { diff --git a/src/commands/crew.js b/src/commands/crew.js index 52a3703..f754843 100644 --- a/src/commands/crew.js +++ b/src/commands/crew.js @@ -1,6 +1,6 @@ const { getStrings } = require('../plugins/checklang.js'); -const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js'); -const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch); +const { isOnSpamWatch } = require('../spamwatch/spamwatch.js'); +const spamwatchMiddleware = require('../spamwatch/Middleware.js')(isOnSpamWatch); const os = require('os'); const { exec } = require('child_process'); const { error } = require('console'); diff --git a/src/commands/fun.js b/src/commands/fun.js index 6fc0bba..b80696d 100644 --- a/src/commands/fun.js +++ b/src/commands/fun.js @@ -1,7 +1,7 @@ const Resources = require('../props/resources.json'); const { getStrings } = require('../plugins/checklang.js'); -const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js'); -const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch); +const { isOnSpamWatch } = require('../spamwatch/spamwatch.js'); +const spamwatchMiddleware = require('../spamwatch/Middleware.js')(isOnSpamWatch); function sendRandomReply(ctx, gifUrl, textKey) { const Strings = getStrings(ctx.from.language_code); diff --git a/src/commands/gsmarena.js b/src/commands/gsmarena.js index 6f5a01a..64b3932 100644 --- a/src/commands/gsmarena.js +++ b/src/commands/gsmarena.js @@ -4,8 +4,8 @@ // With some help from GPT (I don't really like AI but whatever) // If this were a kang, I would not be giving credits to him! -const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js'); -const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch); +const { isOnSpamWatch } = require('../spamwatch/spamwatch.js'); +const spamwatchMiddleware = require('../spamwatch/Middleware.js')(isOnSpamWatch); const axios = require('axios'); const { parse } = require('node-html-parser'); diff --git a/src/commands/help.js b/src/commands/help.js index ab9e601..163af25 100644 --- a/src/commands/help.js +++ b/src/commands/help.js @@ -1,6 +1,6 @@ const { getStrings } = require('../plugins/checklang.js'); -const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js'); -const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch); +const { isOnSpamWatch } = require('../spamwatch/spamwatch.js'); +const spamwatchMiddleware = require('../spamwatch/Middleware.js')(isOnSpamWatch); async function sendHelpMessage(ctx, isEditing) { const Strings = getStrings(ctx.from.language_code); diff --git a/src/commands/http.js b/src/commands/http.js index 13bd2ea..672a7c0 100644 --- a/src/commands/http.js +++ b/src/commands/http.js @@ -1,7 +1,7 @@ const Resources = require('../props/resources.json'); const { getStrings } = require('../plugins/checklang.js'); -const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js'); -const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch); +const { isOnSpamWatch } = require('../spamwatch/spamwatch.js'); +const spamwatchMiddleware = require('../spamwatch/Middleware.js')(isOnSpamWatch); const axios = require('axios'); module.exports = (bot) => { diff --git a/src/commands/info.js b/src/commands/info.js index b1c2c0b..f0c6354 100644 --- a/src/commands/info.js +++ b/src/commands/info.js @@ -1,6 +1,6 @@ const { getStrings } = require('../plugins/checklang.js'); -const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js'); -const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch); +const { isOnSpamWatch } = require('../spamwatch/spamwatch.js'); +const spamwatchMiddleware = require('../spamwatch/Middleware.js')(isOnSpamWatch); async function getUserInfo(ctx) { const Strings = getStrings(ctx.from.language_code); diff --git a/src/commands/lastfm.js b/src/commands/lastfm.js index 1f15f5a..ec6d126 100644 --- a/src/commands/lastfm.js +++ b/src/commands/lastfm.js @@ -2,8 +2,8 @@ const Resources = require('../props/resources.json'); const fs = require('fs'); const axios = require('axios'); const { getStrings } = require('../plugins/checklang.js'); -const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js'); -const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch); +const { isOnSpamWatch } = require('../spamwatch/spamwatch.js'); +const spamwatchMiddleware = require('../spamwatch/Middleware.js')(isOnSpamWatch); const scrobbler_url = Resources.lastFmApi; const api_key = process.env.lastKey; diff --git a/src/commands/main.js b/src/commands/main.js index 4341b56..6f36d64 100644 --- a/src/commands/main.js +++ b/src/commands/main.js @@ -1,6 +1,6 @@ const { getStrings } = require('../plugins/checklang.js'); -const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js'); -const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch); +const { isOnSpamWatch } = require('../spamwatch/spamwatch.js'); +const spamwatchMiddleware = require('../spamwatch/Middleware.js')(isOnSpamWatch); module.exports = (bot) => { bot.start(spamwatchMiddleware, async (ctx) => { diff --git a/src/commands/modarchive.js b/src/commands/modarchive.js index 86d3c99..35f2d7d 100644 --- a/src/commands/modarchive.js +++ b/src/commands/modarchive.js @@ -3,8 +3,8 @@ const axios = require('axios'); const fs = require('fs'); const path = require('path'); const { getStrings } = require('../plugins/checklang.js'); -const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js'); -const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch); +const { isOnSpamWatch } = require('../spamwatch/spamwatch.js'); +const spamwatchMiddleware = require('../spamwatch/Middleware.js')(isOnSpamWatch); async function downloadModule(moduleId) { try { diff --git a/src/commands/ponyapi.js b/src/commands/ponyapi.js index a002714..8f1239c 100644 --- a/src/commands/ponyapi.js +++ b/src/commands/ponyapi.js @@ -1,7 +1,7 @@ const Resources = require('../props/resources.json'); const { getStrings } = require('../plugins/checklang.js'); -const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js'); -const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch); +const { isOnSpamWatch } = require('../spamwatch/spamwatch.js'); +const spamwatchMiddleware = require('../spamwatch/Middleware.js')(isOnSpamWatch); const axios = require("axios"); function capitalizeFirstLetter(string) { diff --git a/src/commands/quotes.js b/src/commands/quotes.js index e73e70e..859af57 100644 --- a/src/commands/quotes.js +++ b/src/commands/quotes.js @@ -1,7 +1,7 @@ // const Resources = require('../props/resources.json'); // const { getStrings } = require('../plugins/checklang.js'); -// const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js'); -// const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch); +// const { isOnSpamWatch } = require('../spamwatch/spamwatch.js'); +// const spamwatchMiddleware = require('../spamwatch/Middleware.js')(isOnSpamWatch); // const escape = require('markdown-escape'); // const axios = require('axios'); diff --git a/src/commands/randompony.js b/src/commands/randompony.js index 814e41a..b935504 100644 --- a/src/commands/randompony.js +++ b/src/commands/randompony.js @@ -1,7 +1,7 @@ const Resources = require('../props/resources.json'); const { getStrings } = require('../plugins/checklang.js'); -const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js'); -const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch); +const { isOnSpamWatch } = require('../spamwatch/spamwatch.js'); +const spamwatchMiddleware = require('../spamwatch/Middleware.js')(isOnSpamWatch); const axios = require("axios"); module.exports = (bot) => { diff --git a/src/commands/weather.js b/src/commands/weather.js index 3818dad..ad8a5f0 100644 --- a/src/commands/weather.js +++ b/src/commands/weather.js @@ -5,8 +5,8 @@ const Resources = require('../props/resources.json'); const axios = require('axios'); const { getStrings } = require('../plugins/checklang.js'); -const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js'); -const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch); +const { isOnSpamWatch } = require('../spamwatch/spamwatch.js'); +const spamwatchMiddleware = require('../spamwatch/Middleware.js')(isOnSpamWatch); const statusEmojis = { 0: '⛈', 1: '⛈', 2: '⛈', 3: '⛈', 4: '⛈', 5: '🌨', 6: '🌨', 7: '🌨', diff --git a/src/commands/youtube.js b/src/commands/youtube.js index 2442f95..35be412 100644 --- a/src/commands/youtube.js +++ b/src/commands/youtube.js @@ -1,6 +1,6 @@ const { getStrings } = require('../plugins/checklang.js'); -const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js'); -const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch); +const { isOnSpamWatch } = require('../spamwatch/spamwatch.js'); +const spamwatchMiddleware = require('../spamwatch/Middleware.js')(isOnSpamWatch); const { execFile } = require('child_process'); const os = require('os'); const fs = require('fs'); diff --git a/src/plugins/lib-spamwatch b/src/plugins/lib-spamwatch deleted file mode 160000 index 8d35b7e..0000000 --- a/src/plugins/lib-spamwatch +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8d35b7ec4cffb48df8d1f59485b32e2484ae64e7 diff --git a/src/spamwatch b/src/spamwatch new file mode 160000 index 0000000..b71b3b9 --- /dev/null +++ b/src/spamwatch @@ -0,0 +1 @@ +Subproject commit b71b3b9eab0f172c038674fc6739fce9199ad3e0