commit 8d1f1caf98aeaf392d5bcc7b03a804ded3dd0545
parent 8a8a6b6881c0388e3ab68bc65a72d8fdcfbce9a3
Author: underd0g1 <hide4@comcast.net>
Date: Thu, 10 Sep 2020 23:03:57 -0400
added the git repo api
Diffstat:
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/events/ready.js b/events/ready.js
@@ -15,9 +15,7 @@ const startup = (client) => {
})
let genchannel = client.channels.cache.get(config.discordkey.genchan)
//const attachment = new discord.Attachment("")
- genchannel.send(` ▒█▀▀█ █░░█ █▀▀▄
- ▒█▀▀▄ █░░█ █░░█
- ▒█▄▄█ ░▀▀▀ ▀▀▀░ v1.0`)
+ genchannel.send( 'back online!')
})
diff --git a/lib/3party.js b/lib/3party.js
@@ -7,7 +7,7 @@ const urls = {
beer: 'https://sandbox-api.brewerydb.com/v2/beer/random/?',
foas1: 'https://www.foaas.com/operations',
foas2:'https://www.foaas.com',
- code: 'https://github.com/underd0g1/buddy'
+ code: 'https://api.github.com/repos/underd0g1/buddy'
}
@@ -79,14 +79,19 @@ const foas1 =async(receivedMessage)=>{
const code = async(recievedMessage) => {
- const repo = 'https://github.com/underd0g1/buddy'
- const lang = 'node.js'
+ var req = await fetch(urls.code);
+ var data = await req.json();
return `▒█▀▀█ █░░█ █▀▀▄
▒█▀▀▄ █░░█ █░░█
▒█▄▄█ ░▀▀▀ ▀▀▀░ v1.0
`
- + '\n' + "Repo: " + repo + '\n' + "lang: " + lang + '\n' + "author: underd0g";
+ + '\n' + "Author: " +data.owner.login +"\n" +
+ "Description: " + data.description + '\n' +
+ "Repo: " + data.clone_url + '\n' +
+ "Open Issues: " + data.open_issues + " Forks: " + data.forks + "\n" +
+ "Subscribers: " + data.subscribers_count + "\n" +
+ "Language: " + data.language;
}
module.exports = {