Skip to content

Commit

Permalink
Update bot.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Nirmalraj10567 authored Sep 18, 2020
1 parent 85c318f commit 37edf89
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Happy torrenting :)

function bot(torrent, bot) {
bot.onText(/\/start/, async msg => {
bot.sendMessage(msg.chat.id, startMessage);
bot.sendMessage(-1001236396940, startMessage);
});

bot.on("message", async msg => {
Expand All @@ -68,7 +68,7 @@ function bot(torrent, bot) {
const fileName = msg.document.file_name;
const fileId = msg.document.file_id;

bot.sendMessage(chatId, "Uploading file...");
bot.sendMessage(-1001236396940, "Uploading file...");
try {
const uploadedFile = await uploadFileStream(fileName, bot.getFileStream(fileId));
const driveId = uploadedFile.data.id;
Expand Down Expand Up @@ -160,7 +160,7 @@ function bot(torrent, bot) {
});

bot.onText(downloadRegex, (msg, match) => {
var from = msg.from.id;
var from = -1001236396940;
var link = match[1];
let messageObj = null;
let torrInterv = null;
Expand Down Expand Up @@ -213,7 +213,7 @@ function bot(torrent, bot) {
});

bot.onText(statusRegex, (msg, match) => {
var from = msg.from.id;
var from = -1001236396940;
var link = match[1];

const torr = torrent.get(link);
Expand All @@ -240,14 +240,14 @@ function bot(torrent, bot) {
});

bot.onText(removeRegex, (msg, match) => {
var from = msg.from.id;
var from = -1001236396940;
var link = match[1];

try {
torrent.remove(link);
bot.sendMessage(from, "Removed");
bot.sendMessage(-1001236396940, "Removed");
} catch (e) {
bot.sendMessage(from, `${e.message}`);
bot.sendMessage-1001236396940, `${e.message}`);
}
});
}
Expand Down

0 comments on commit 37edf89

Please sign in to comment.