Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
lxRbckl committed Jan 30, 2024
1 parent 4e6da80 commit 2ff9a80
Show file tree
Hide file tree
Showing 6 changed files with 2,145 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ FROM node:18.16.0


# referencing kubernetes environment #
ENV tokenGitHub ${tokenGitHub}
ENV tokendiscord ${tokendiscord}
ENV tokenOctokit ${tokenOctokit}
ENV tokenDiscord ${tokenDiscord}


WORKDIR /usr/app
Expand Down
32 changes: 32 additions & 0 deletions hook/pre-commit.js
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);

// >
116 changes: 116 additions & 0 deletions index.js
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;

// >
Loading

0 comments on commit 2ff9a80

Please sign in to comment.