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")
|
const Discord = require("discord.js")
|
||||||
exports.run = (client, message) => {
|
exports.run = (client, message) => {
|
||||||
message.channel.startTyping();
|
message.channel.startTyping();
|
||||||
var r = request.get('http://mityurl.com/y/yKsQ/r', function (err, res, body) {
|
try{
|
||||||
var rip = r.uri.href
|
fetch('http://mityurl.com/y/yKsQ/r', { redirect: 'follow' })
|
||||||
message.channel.send(`>:] ${rip}`)
|
.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();
|
message.channel.stopTyping();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.conf = {
|
exports.conf = {
|
||||||
|
|
Loading…
Reference in a new issue