try fix the loop
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 19s
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 19s
This commit is contained in:
parent
45dd0686e4
commit
342c063011
@ -23,8 +23,7 @@ module.exports = {
|
|||||||
// console.log(subs);
|
// console.log(subs);
|
||||||
fs.writeFileSync('./data/group/subs.json', JSON.stringify(subs))
|
fs.writeFileSync('./data/group/subs.json', JSON.stringify(subs))
|
||||||
bot.sendMessage(msg.chat.id, sub + " sub updated")
|
bot.sendMessage(msg.chat.id, sub + " sub updated")
|
||||||
msg.chat.id = process.env.CHANNEL_ID
|
questions.subStatus(bot, msg, logger, true, process.env.CHANNEL_ID)
|
||||||
questions.subStatus(bot, msg, logger, true)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ module.exports = {
|
|||||||
bot.sendMessage(msg.chat.id, randomSub.SUB + "!");
|
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 subs = JSON.parse(fs.readFileSync('./data/group/subs.json', 'utf8'))
|
||||||
|
|
||||||
let string = ""
|
let string = ""
|
||||||
@ -32,9 +32,10 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
// console.log(string)
|
// 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) {
|
if (notify == true) {
|
||||||
bot.pinChatMessage(process.env.CHANNEL_ID, data.message_id)
|
bot.pinChatMessage(targetChatId, data.message_id)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updates_page: async (bot, msg, logger) => {
|
updates_page: async (bot, msg, logger) => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "bblbtv_bot",
|
"name": "bblbtv_bot",
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user