forked from embee/woomy
update rip.js to use node-fetch instead of request
This commit is contained in:
parent
d07a680b77
commit
def26feab3
1 changed files with 9 additions and 6 deletions
|
@ -1,12 +1,15 @@
|
|||
var request = require('request');
|
||||
const fetch = require('node-fetch');
|
||||
const Discord = require("discord.js")
|
||||
exports.run = (client, message) => {
|
||||
message.channel.startTyping();
|
||||
var r = request.get('http://mityurl.com/y/yKsQ/r', function (err, res, body) {
|
||||
var rip = r.uri.href
|
||||
message.channel.send(`>:] ${rip}`)
|
||||
message.channel.stopTyping();
|
||||
});
|
||||
try{
|
||||
fetch('http://mityurl.com/y/yKsQ/r', { redirect: 'follow' })
|
||||
.then(res => res)
|
||||
.then(res => message.channel.send(`>:] ${res.url}`))
|
||||
} catch(err) {
|
||||
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
|
||||
};
|
||||
message.channel.stopTyping();
|
||||
}
|
||||
|
||||
exports.conf = {
|
||||
|
|
Loading…
Reference in a new issue