diff --git a/handlers/oauth2.js b/handlers/oauth2.js index 7a686ee..e3c35d0 100644 --- a/handlers/oauth2.js +++ b/handlers/oauth2.js @@ -78,6 +78,7 @@ module.exports.load = async function (app, ifValidAPI, ejs) { userinfo.guilds = guilds if (process.env.discord.guild) { + const check_if_banned = (await fetch( `https://discord.com/api/guilds/${process.env.discord.guild}/bans/${userinfo.id}`, { @@ -108,6 +109,18 @@ module.exports.load = async function (app, ifValidAPI, ejs) { } else { console.log('[AUTO JOIN SERVER] For some reason, the status code is ' + check_if_banned + ', instead of 200 or 404. You should worry about this.') } + if (process.env.discord.registeredrole) { + await fetch( + `https://discord.com/api/guilds/${process.env.discord.guild}/members/${userinfo.id}/roles/${process.env.discord.registeredrole}`, + { + method: "put", + headers: { + 'Content-Type': 'application/json', + "Authorization": `Bot ${newsettings.api.client.bot.token}` + } + } + ); + } }; let dbinfo = await process.db.fetchAccountDiscordID(userinfo.id) diff --git a/settings-template.yml b/settings-template.yml index d01a36c..eeb7675 100644 --- a/settings-template.yml +++ b/settings-template.yml @@ -15,13 +15,14 @@ discord: token: "Insert your bot token here." guild: "000000000000000000" # Add your server ID you want to force users to join on login here. + registeredrole: "000000000000000000" # Add the ID of the role you want to be granted when logging into the dashboard. auditlogs: # This feature enable auditlogs for dashactyl v1 - enabled: true # enable or disable the Audit Logs + enabled: false # enable or disable the Audit Logs webhook_url: "Enter your webhook URL" email_system: # This feature enable email system for Dashactyl v1 - enabled: true # enable or disable the email system + enabled: false # enable or disable the email system smtp_host: "Enter your SMTP Host" # You need to put here your smtp host from your email software (gmail, zoho, etc.) like smtp.zoho.com smtp_port: "Enter your SMTP Port" # Put the port of your smtp host like 465 smtp_user: "Enter your SMTP User" # Your email like nohaxito@mydomain.gg @@ -29,7 +30,7 @@ email_system: # This feature enable email system for Dashactyl v1 extra: # Some additional things, this will edit some links in the HTML format that will be sent by email dashboardurl: "Enter your dashboard url with https" # Necessary dashboardname: "Dashactyl" # Necessary - + pterodactyl: domain: "Enter your Pterodactyl Panel domain here." key: "Enter your Pterodactyl Panel application API key here." # Make sure to higher/remove rate limits for application API keys, so the dashboard doesn't get rate limited.