commands?
This commit is contained in:
14
torn.js
14
torn.js
@@ -1,3 +1,4 @@
|
||||
const config = require('./config')
|
||||
module.exports = (client, torn, config, state) => {
|
||||
//console.log(`example log ${client.user.tag}`);
|
||||
};
|
||||
@@ -6,4 +7,15 @@ module.exports.readyCheck = async (key) => {
|
||||
const response = await fetch(url);
|
||||
const data = await response.json();
|
||||
console.log(`Connected to Torn as ${data.name} [${data.player_id}]`);
|
||||
};
|
||||
};
|
||||
module.exports.test = async () => {
|
||||
const url = `https://api.torn.com/user/?selections=basic&key=${config.torn}`
|
||||
const response = await fetch(url);
|
||||
const data = await response.json();
|
||||
return(`Connected to Torn as ${data.name} [${data.player_id}]`);
|
||||
};
|
||||
module.exports.api = async (url) => {
|
||||
const response = await fetch(`${url}&key=${config.torn}`);
|
||||
const data = await response.json();
|
||||
return(data);
|
||||
};
|
||||
Reference in New Issue
Block a user