Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewstech committed Jul 9, 2023
1 parent e1054f4 commit a17d853
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion commands/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ module.exports = {
});

await interaction.reply({ embeds: [embed] });
await fork(interaction.user.id, interaction, subdomain);
const forked = await fork(interaction.user.id, interaction, subdomain);
if (forked === "false") return;

// add a 3 second delay to allow the fork to complete
await new Promise((r) => setTimeout(r, 3000));
Expand Down
10 changes: 6 additions & 4 deletions components/fork.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require("dotenv").config();
const Sentry = require("@sentry/node");
const { GuildID } = require("../services/guildId.js");

const forkRepo = async (token, guild) => {
const forkRepo = async (token, guild, pass) => {
try {
// Fork the repository
const username = guild.github;
Expand Down Expand Up @@ -39,13 +39,14 @@ const forkRepo = async (token, guild) => {
icon_url: guild.logo,
});
await interaction.editReply({ embeds: [embed] });
pass = "true";
}

const cloneResponse = forked.data.clone_url;
if (process.env.DEBUG) {
console.log("FORKED REPO: " + cloneResponse);
}
return cloneResponse;
return pass;
} catch (error) {
console.log(error);
}
Expand All @@ -62,7 +63,8 @@ async function fork(id, interaction, subdomain) {
console.log("id: " + id);
console.log("token: " + token);
}
const responce = await forkRepo(token, guild);
return responce;
let pass = "false";
const responce = await forkRepo(token, guild, pass);
return pass;
}
exports.fork = fork;

0 comments on commit a17d853

Please sign in to comment.