modified: src/main.js
This commit is contained in:
parent
93653c5e53
commit
97bf115120
12
src/main.js
12
src/main.js
|
@ -66,7 +66,7 @@ bot.on('message', (e) => {
|
|||
tmpuser['nick'],
|
||||
e.channel.getName(),
|
||||
e.network,
|
||||
new Date().getTime(),
|
||||
Math.floor(new Date() / 1000),
|
||||
0
|
||||
]).on('result', (result) => {
|
||||
|
||||
|
@ -108,9 +108,7 @@ var getUser = (u, n) => {
|
|||
};
|
||||
|
||||
var dl = (url, dest, cb) => {
|
||||
var request = (url.match(/^https/)?https:http).get(url, (response) => {
|
||||
try { // type:1=post,type:2=stfu
|
||||
console.log(response.headers['content-type']);
|
||||
var request = (url.match(/^https/)?https:http).get(url, (response) => { // type:1=post,type:2=stfu
|
||||
if(allowed.indexOf(response.headers['content-type']) != -1) {
|
||||
if(response.headers['content-length'] <= maxFileSize) {
|
||||
checkRepost(url, (cbcr) => {
|
||||
|
@ -139,10 +137,8 @@ var dl = (url, dest, cb) => {
|
|||
else {
|
||||
cb({'status':false, 'msg':'f0ck you', 'type':2});
|
||||
}
|
||||
}
|
||||
catch(ex) {
|
||||
e.reply(ex);
|
||||
}
|
||||
}).on('error', (msg) => {
|
||||
cb({'status':false, 'msg':msg, 'type':2});
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user