-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
286 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
config.js | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const { SlashCommandBuilder } = require("@discordjs/builders"); | ||
const { getVerifiedUser } = require("../util/users"); | ||
|
||
const data = new SlashCommandBuilder() | ||
.setName("minecraft") | ||
.setDescription("Links your Discord account to the (Java) Minecraft server and whitelists you.") | ||
.addStringOption(option => | ||
option.setName("minecraftUsername") | ||
.setDescription("Your Minecraft username to login to the server with..") | ||
.setRequired(true) | ||
); | ||
|
||
const execute = async (interaction) => { | ||
const userId = interaction.author.id; | ||
const verifiedUser = await getVerifiedUser(userId); | ||
if(!verifiedUser) | ||
return await interaction.reply("This command can only be used by users who are verified!"); | ||
|
||
//get user from firestore table. | ||
//check if user already has a minecraft user in the table. | ||
//if not, add user to table AND send their username to the whitelist. | ||
//if so, delete old username from the whitelist, send their new username to the whitelist, and add username to table. | ||
}; | ||
|
||
module.exports = { data: data, execute: execute, enabled: true, roleRequired: "" }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const { SlashCommandBuilder } = require("@discordjs/builders"); | ||
const { getVerifiedUser, getSheetsUser } = require("../util/users"); | ||
const { addVerifiedUser } = require("../util/users"); | ||
|
||
const data = new SlashCommandBuilder() | ||
.setName("verify") | ||
.setDescription("Command used to verify that you're a registered user.") | ||
.addStringOption(option => | ||
option.setName("email") | ||
.setDescription("The email address you used on your application.") | ||
.setRequired(true) | ||
); | ||
|
||
const execute = async (interaction) => { | ||
const userId = interaction.author.id; | ||
const verifiedUser = await getVerifiedUser(userId); | ||
if(verifiedUser) | ||
return await interaction.reply("❌ This command can only be used by users who are NOT verified!"); | ||
|
||
const email = interaction.options.getStringOption("email"); | ||
const sheetsUser = await getSheetsUser(email); | ||
if(!sheetsUser.isAccepted) | ||
return await interaction.reply("❌ This command can only be used by users who have been officially accepted!"); | ||
|
||
await addVerifiedUser(userId, interaction.author); | ||
await interaction.reply("✔️ You are now verified!"); | ||
}; | ||
|
||
module.exports = { data: data, execute: execute, enabled: true, roleRequired: "" }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module.exports = { | ||
config: { | ||
gsheets: { | ||
spreadsheetId: "18l2IrquSjLyyu0LqOt_s92J-B3Nj4vpPRMqa-7CLgxI", | ||
}, | ||
|
||
firebaseConfig: { | ||
apiKey: "AIzaSyCF4gclwE2tXz_Fh3tkZyel5ZBV0iak1yU", | ||
authDomain: "hawkhacks-2022.firebaseapp.com", | ||
databaseURL: "https://hawkhacks-2022-default-rtdb.firebaseio.com", | ||
projectId: "hawkhacks-2022", | ||
storageBucket: "hawkhacks-2022.appspot.com", | ||
messagingSenderId: "13981651926", | ||
appId: "1:13981651926:web:7d63e321884c166d830a77", | ||
measurementId: "G-W9RSGE33FK" | ||
}, | ||
|
||
discord: { | ||
teamCategoryId: "970876620648882186", | ||
verifiedRoleId: "962115254018527372" | ||
|
||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"type": "service_account", | ||
"project_id": "hawkhacks-2022", | ||
"private_key_id": "5937c9a037c08251096ef1ee5129316442ea9ef3", | ||
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDpIjTIod43TsRP\ngv1xfqSSU69AGQFKMznGwymA/n1jE8dX7uQLlWxELWImKL58KhuMuH9Cu303oMgZ\n70ZiA8MnCyWIbn57X6hBOKJSaYjiNjAlNN1IEyla9c8SqJ4W8jGG5gxEa1ulTfby\n8TXi36sJEAOcmwS6jdGukb1nwg55FriE8GxE1wf1NEyfefRFJLJz/ekXmvLM08S/\nSIJiobDTjtBsyTbn7C8QVVHMtsU3ZEtNksSK9uIr8W/ESgYH/ciXWwtwn/Jd9DW/\n/JhsiTzHedbbLwCTFgwySzAHCZMsfp+RvCtgnPOYkKbE5OZ+zgegHX6ul8KYwpUN\nCq/VkDx1AgMBAAECggEAT8+qClV/4adRhXbulQAqDv4fLO5ihqhqyyTc/JAjFNwc\njnn2EBEjc2OmCjJAo/k2XUJ8LrhI8dZVKqvDiKKJGMC0JLTPECV7UHi2+Uev2OF8\nMgCbEKWerskgDt8y3+AiHHB9Gp82TK0YMatqKzUvNHcLBX38bHFIq16xXOgOVF1P\negS01Y8FDWJcYbv9zUYEJ0MGFMddmJQCowNj0VPxGdC0apuGtPq2DXFuwLSzbodV\nGib4Y3z8SzvvJS/MekjhhQXX8/jh/LQigFJxC5giHp7pIL9SttmetMhVz87cazdz\nBe+uCbfJTRiUFcpBiYsZd3UVPFn2L2ZSEWrheEYwMQKBgQD+8Z/LsZ4FgUqzwuTD\nNTflG/HssIswQZ1KeMk5TOh8TO4WhxBjHxRHVoTFsqjJs+8Vyby7v/TK78tiKaQS\nwKlnxx+BtOJdoTXfnt8A9CA5fShmModk8EdCBOz1uHBIKRczkmvPOKMFk7yIfdMI\nuKg+75EOwpxOyouTlVron9ZOewKBgQDqGXOZ7mo58pKhiEebe4C1Rs3Ow48pjlf8\nrsN8g5V8e0nM5E7J1DzIXmbXM81mI7ee7bji7bmpPOBVEKRhKIGn/dXLEgm7vf9K\n5X9uJF8uNP33NlGsFmmWByHFAhjPqvQPyW1AQOvK0dOC7zrcCr0YTcxTm6nRQzuB\n53NRDh0lzwKBgGiXqo4/3Wu2wnYDZCTuBXN6RoNrXn86vBQcf7mBYvPz/83ANank\ny0YFKc2N4Y92wYS30jVYqE5FmLQ6DzUeU6He4H8vPZtaEyceH7Fddob/YP6khkWU\nCjf8m1aoB3CjYwBmdtJ6Eu+rz7JTpKu0TloboPBkSQpOMHso0DYVtS9XAoGBAJfc\nXuOSiBKDS5/CGkHAwmPWRJhGwE5C6s0eSe4yJf0UtXFXAc1oAu4wXyJnlm0V6n4M\n1I1Rjck9loFYRGpKrqFdxxzu3KWPwVbCvgGjUqNU+RMvh5fNCj2q7rswewvsaFr9\nXgP6mXt+1mjv7AzmYnirr0rlhiocJTRGAsaoEzx9AoGASo2mCCbAxlyE2/UOPe6d\nSOAz0vU2cwa92ma7uz9DfJWOzigUMXVZ0p3JD9WEj69wrO8EcXs1uqsRcy5b37zk\nI2wB4D84pVPB7fgMfesJsNhjyGY8NM5jKJpcJ3xNH1s9ftiNPuHRfypS3RmOa+Tu\neuuD5dFFc4Yl6IVkIKYCCZQ=\n-----END PRIVATE KEY-----\n", | ||
"client_email": "[email protected]", | ||
"client_id": "105002544491941745608", | ||
"auth_uri": "https://accounts.google.com/o/oauth2/auth", | ||
"token_uri": "https://oauth2.googleapis.com/token", | ||
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", | ||
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/google-sheets%40hawkhacks-2022.iam.gserviceaccount.com" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const { config } = require("../config"); | ||
const firebase = require("firebase"); | ||
require("firebase/firestore"); | ||
|
||
const firebaseConfig = config.firebaseConfig; | ||
firebase.initializeApp(firebaseConfig); | ||
const db = firebase.firestore(); | ||
|
||
module.exports = { firebase, db }; |
Oops, something went wrong.