-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
2,145 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// import < | ||
const token = require('../index.js'); | ||
|
||
// > | ||
|
||
|
||
// iterate (token) < | ||
for (const [i, j] of Object.entries(token)) { | ||
|
||
// if (existing token) < | ||
if (j) { | ||
|
||
// notify < | ||
// failure < | ||
console.log(i, 'token exists.'); | ||
process.exit(1); | ||
|
||
// > | ||
|
||
} | ||
|
||
// > | ||
|
||
} | ||
|
||
// > | ||
|
||
|
||
// success < | ||
process.exit(0); | ||
|
||
// > |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,119 @@ | ||
// < Project Heimir by Alex Arbuckle > // | ||
|
||
|
||
/// import < | ||
const cron = require('node-cron'); | ||
const {Octokit} = require('@Octokit/rest'); | ||
const { | ||
|
||
Client, | ||
Routes, | ||
IntentsBitField | ||
|
||
} = require('discord.js'); | ||
|
||
// > | ||
|
||
|
||
// setup < | ||
// initialize < | ||
const users = ['ala2q6', 'lxRbckl']; | ||
const channelId = '1199281939547435030'; | ||
const token = { | ||
|
||
octokit : '', | ||
discord : '' | ||
|
||
}; | ||
|
||
const octokit = new Octokit({auth : token.octokit}); | ||
const client = new Client({ | ||
|
||
rest : {version : '10'}, | ||
intents : [ | ||
|
||
IntentsBitField.Flags.Guilds, | ||
IntentsBitField.Flags.GuildMembers, | ||
IntentsBitField.Flags.GuildMessages, | ||
IntentsBitField.Flags.MessageContent | ||
|
||
] | ||
|
||
}); | ||
|
||
// > | ||
|
||
|
||
async function fetch() { | ||
|
||
var data = {}; | ||
await Promise.all(users.map(async u => { | ||
|
||
const repos = await octokit.paginate(`GET /users/${u}/repos`); | ||
for (const r of repos) { | ||
|
||
let result = (await octokit.repos.get({ | ||
|
||
owner : u, | ||
repo : r.name | ||
|
||
})).data; | ||
|
||
data[result.name] = { | ||
|
||
'url' : result.url, | ||
'topics' : result.topics, | ||
'language' : result.language, | ||
'description' : result.description | ||
|
||
}; | ||
|
||
} | ||
|
||
})); | ||
|
||
return data; | ||
|
||
} | ||
|
||
|
||
async function update() { | ||
|
||
|
||
|
||
} | ||
|
||
|
||
async function message() { | ||
|
||
|
||
|
||
} | ||
|
||
|
||
function schedule() { | ||
|
||
this.client.on('ready', async () => { | ||
|
||
cron.schedule('', async () => { | ||
|
||
console.log('scheduled'); | ||
|
||
}); | ||
|
||
}); | ||
|
||
} | ||
|
||
|
||
(async () => { | ||
|
||
// | ||
|
||
})(); | ||
|
||
|
||
// export < | ||
module.exports = token; | ||
|
||
// > |
Oops, something went wrong.