Merge branch 'main' into main
This commit is contained in:
commit
f6886ae504
26 changed files with 80 additions and 72 deletions
|
@ -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) => {
|
||||
|
|
|
@ -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');
|
||||
const { verifyInput } = require('../plugins/verifyInput.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');
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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');
|
||||
|
@ -193,14 +193,18 @@ function extractMetaData(meta, key) {
|
|||
return line ? line.split('"')[1] : "";
|
||||
}
|
||||
|
||||
function getUsername(ctx){
|
||||
let userName = String(ctx.from.first_name);
|
||||
if(userName.includes("<") && userName.includes(">")) {
|
||||
userName = userName.replaceAll("<", "").replaceAll(">", "");
|
||||
}
|
||||
return userName;
|
||||
}
|
||||
|
||||
module.exports = (bot) => {
|
||||
bot.command(['d', 'device'], spamwatchMiddleware, async (ctx) => {
|
||||
const userId = ctx.from.id;
|
||||
let userName = String(ctx.from.first_name);
|
||||
|
||||
if(userName.includes("<") && userName.includes(">")) {
|
||||
userName = userName.replaceAll("<", "").replaceAll(">", "");
|
||||
}
|
||||
const userName = getUsername(ctx);
|
||||
|
||||
const phone = ctx.message.text.split(" ").slice(1).join(" ");
|
||||
if (!phone) {
|
||||
|
@ -228,7 +232,7 @@ module.exports = (bot) => {
|
|||
bot.action(/details:(.+):(.+)/, async (ctx) => {
|
||||
const url = ctx.match[1];
|
||||
const userId = parseInt(ctx.match[2]);
|
||||
const userName = ctx.from.first_name;
|
||||
const userName = getUsername(ctx);
|
||||
|
||||
const callbackQueryUserId = ctx.update.callback_query.from.id;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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');
|
||||
const { verifyInput } = require('../plugins/verifyInput.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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) => {
|
||||
|
@ -16,8 +16,9 @@ module.exports = (bot) => {
|
|||
|
||||
bot.command('privacy', spamwatchMiddleware, async (ctx) => {
|
||||
const Strings = getStrings(ctx.from.language_code);
|
||||
ctx.reply(
|
||||
Strings.botPrivacy, {
|
||||
const message = Strings.botPrivacy.replace("{botPrivacy}", process.env.botPrivacy);
|
||||
|
||||
ctx.reply(message, {
|
||||
parse_mode: 'Markdown',
|
||||
disable_web_page_preview: true,
|
||||
reply_to_message_id: ctx.message.message_id
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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");
|
||||
const { verifyInput } = require('../plugins/verifyInput.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');
|
||||
|
||||
|
|
|
@ -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) => {
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
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 { isOnSpamWatch } = require('../spamwatch/spamwatch.js');
|
||||
const spamwatchMiddleware = require('../spamwatch/Middleware.js')(isOnSpamWatch);
|
||||
const { verifyInput } = require('../plugins/verifyInput.js');
|
||||
const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch);
|
||||
|
||||
const statusEmojis = {
|
||||
0: '⛈', 1: '⛈', 2: '⛈', 3: '⛈', 4: '⛈', 5: '🌨', 6: '🌨', 7: '🌨',
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue