-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathupdate.js
More file actions
17 lines (14 loc) · 894 Bytes
/
update.js
File metadata and controls
17 lines (14 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
async function update(ctx) {
try {
global.client.torrents.every((currentTorrent)=> {
ctx.reply('Torrent ' + currentTorrent.name + '\n Progress: ' + Math.trunc(currentTorrent.progress*100) + '%\n Time Remaining: ' + currentTorrent.timeRemaining + '\n Download Speed: ' + currentTorrent.downloadSpeed + '\n Upload Speed: ' + currentTorrent.uploadSpeed);
console.log('Torrent ' + currentTorrent.name + '\n Progress: ' + Math.trunc(currentTorrent.progress*100) + '%\n Time Remaining: ' + currentTorrent.timeRemaining + '\n Download Speed: ' + currentTorrent.downloadSpeed + '\n Upload Speed: ' + currentTorrent.uploadSpeed);
ctx.reply('----------------------------\n')
});
}
catch (error) {
console.log(error)
ctx.reply('An error ocurred during taking the update.')
}
}
module.exports = update