Skip to content

Commit

Permalink
blending
Browse files Browse the repository at this point in the history
  • Loading branch information
lxRbckl committed Jan 30, 2024
1 parent b547f2c commit 6044bc7
Showing 1 changed file with 39 additions and 6 deletions.
45 changes: 39 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ const {

// setup <
// initialize <
const rate = 6;
const owner = 'lxRbckl';
const filepath = 'data.json';
const branch = 'Project-Heimir-2';
const users = ['ala2q6', 'lxRbckl'];
const repository = 'Project-Heimir';
const channelId = '1199281939547435030';
const token = {

Expand Down Expand Up @@ -77,16 +82,39 @@ async function fetch() {
}


function revise() {
async function update(data) {

return await githubUpdate({

pData : data,
pOwner : owner,
pPath : filepath,
pGithub : octokit,
opBranch : branch,
opShowError : false,
pRepository : repository

});

}


function message() {
async function message(result) {

(await client.channels.cache.get(channelId)).send({

content : {

// (failure) <
// (successful) <
true : '@silent `Failed to update.`',
false : '@silent `Update was successful.`'


// >

}[result == undefined]

});

}

Expand All @@ -95,9 +123,12 @@ function schedule() {

this.client.on('ready', async () => {

cron.schedule('', async () => {
cron.schedule('0 0 * * *', async () => {

console.log('scheduled');
let data = await fetch();
let result = await update(data);

await message(result);

});

Expand All @@ -108,7 +139,9 @@ function schedule() {

(async () => {

//
client.login(token.discord);

schedule();

})();

Expand Down

0 comments on commit 6044bc7

Please sign in to comment.