try fix the loop
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 19s

This commit is contained in:
Karl 2025-07-05 16:57:26 +01:00
parent 45dd0686e4
commit 342c063011
3 changed files with 6 additions and 6 deletions

View File

@ -23,8 +23,7 @@ module.exports = {
// console.log(subs);
fs.writeFileSync('./data/group/subs.json', JSON.stringify(subs))
bot.sendMessage(msg.chat.id, sub + " sub updated")
msg.chat.id = process.env.CHANNEL_ID
questions.subStatus(bot, msg, logger, true)
questions.subStatus(bot, msg, logger, true, process.env.CHANNEL_ID)
}
}

View File

@ -13,7 +13,7 @@ module.exports = {
bot.sendMessage(msg.chat.id, randomSub.SUB + "!");
}
},
subStatus: async (bot, msg, logger, notify = false) => {
subStatus: async (bot, msg, logger, notify = false, chatId = null) => {
let subs = JSON.parse(fs.readFileSync('./data/group/subs.json', 'utf8'))
let string = ""
@ -32,9 +32,10 @@ module.exports = {
}
});
// console.log(string)
data = await bot.sendMessage(msg.chat.id, string, { parse_mode: "HTML", disable_notification: notify })
const targetChatId = chatId || msg.chat.id;
data = await bot.sendMessage(targetChatId, string, { parse_mode: "HTML", disable_notification: notify })
if (notify == true) {
bot.pinChatMessage(process.env.CHANNEL_ID, data.message_id)
bot.pinChatMessage(targetChatId, data.message_id)
}
},
updates_page: async (bot, msg, logger) => {

View File

@ -1,6 +1,6 @@
{
"name": "bblbtv_bot",
"version": "1.0.1",
"version": "1.0.2",
"description": "",
"main": "index.js",
"scripts": {