Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<label><img src="web/resources/github-light.png" width="50">&nbsp; Follow along on Github!</label>
<br>
<br>
<button class="button-wide"><img src="web/resources/github-dark.png" width="20">&nbsp; Go to Repository</button>
<button class="button-wide" onclick="github()"><img src="web/resources/github-dark.png" width="20">&nbsp; Go to Repository</button>
</div>
<!--Temporarily added for testing bootstrap-->
<div class="text-card">
Expand Down Expand Up @@ -90,4 +90,5 @@
background-color: rgb(14, 14, 14);
}
</style>
<script src="scripts/redirect.js"></script>
</html>
42 changes: 42 additions & 0 deletions scripts/redirect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
NKA (Formerly PyBotDevs) 2022. For enquiries contact PyBotDevs <pybotdevs@outlook.com>
*/

/**
* @name github
* @description Redirects to the bot's Github repository page.
*/
function github()
{
git_author = "PyBotDevs";
git_repo = "isobot-lazer";
window.location = "https://github.com/" + git_author + "/" + git_repo;
}

client_id = 953278050135588905;
/**
* @name invite
* @description Redirects to the bot's Discord OAuth2 link.
* @param {number} client_id
* @param {string} permissions
*
*/
function invite(client_id, permissions)
{
permission_int = null;
if (permissions == "all")
{
// Default permissions configuration. Includes all bot functionality.
permission_int = 8;
}
else if (permissions == "no_moderation")
{
// Invites the bot without any moderation permissions. Useful if inviter does not have admin permissions or the bot is not going to be used for moderation.
permissions_int = 412387495233;
}
else
{
return console.warn("Argument \"permissions\" can only be \"all\" or \"no_moderation\".");
}
window.location = "https://discord.com/api/oauth2/authorize?client_id=" + client_id + "&permissions=" + permissions_int + "&scope=bot%20applications.commands";
}