Telegram bot #150

Merged
Sirherobrine23 merged 14 commits from Telegram_bot into main 2021-08-11 02:47:35 +00:00
11 changed files with 975 additions and 971 deletions
Showing only changes of commit 5007ef76da - Show all commits

14
bin/telegram_bot.js Normal file → Executable file
View File

@ -118,14 +118,18 @@ bot.command("log", ctx => {
});
// Live Log User
global.LiveLog = [];
bot.command("live_log", ctx => {
const option = ctx.message.text.replace("/platform", "").trim();
if (/enable/.test(option)) {
SaveID(ctx.from.id)
console.log(GetID())
global.LiveLog.push(ctx);
ctx.reply("Sucess");
} else if (/disable/.test(option)) {
RemoveID(ctx.from.id)
console.log(GetID())
// ctx.from.id
for (let ctx_Logs in global.LiveLog) {
if (global.LiveLog[ctx_Logs].from.id === ctx.from.id) delete global.LiveLog[ctx_Logs];
global.LiveLog = global.LiveLog.filter(a=>a);
ctx.reply("Ok");
} else ctx.reply("Invalid option")
ctx.reply(ctx.chat.id)
})
@ -135,4 +139,4 @@ bot.catch(console.log);
// End And Lauch
process.on("exit", bot.stop)
bot.launch()
bot.launch()