Skip to content

Commit

Permalink
oh boy too many changes to list
Browse files Browse the repository at this point in the history
  • Loading branch information
MattheousDT committed Aug 17, 2018
1 parent 4a32d5a commit 9fab937
Show file tree
Hide file tree
Showing 363 changed files with 19,686 additions and 118 deletions.
Binary file added src/bot/commands/assets/art/cards/Blank.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/bot/commands/assets/temp.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/db/schemas/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ const UserSchema = new Schema({
modules: {
about: { type: Boolean, default: true },
artwork: { type: Boolean, default: true }
}
},
premium: { type: Boolean, default: false },
premium_amount: { type: String, required: false,}
});

module.exports = mongoose.model("User", UserSchema);
99 changes: 96 additions & 3 deletions src/web/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,45 @@ router.get("/api/v3/sloc", (req, res) => {
return res.json({ code: 0 });
});

router.get("/dashboard/profiles/:discord_id", (req, res) => {
router.get("/dashboard/profiles/:discord_id", authUser, async (req, res) => {

res.render("dashboard/profile", { user_data: { id: "190914446774763520", avatar: "3e7f5ad61d210caf3c17a09b7e4a29c3", username: "gay boii mattheous" } });
let profile;
try {

profile = await axios({
method: "get",
url: `https://discordapp.com/api/v6/users/${req.params.discord_id}`,
headers: {
"Content-Type": "application/json",
"Authorization": `Bot ${config.discord_token}`
}
});
} catch(error) {

apiLogger.error(error);
}

let user;
try {

user = await axios({
method: "get",
url: `https://discordapp.com/api/v6/users/@me`,
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${req.session.discord.access_token}`
}
});
} catch(error) {

apiLogger.error(error);
}

if (profile.data.id === undefined){
res.render("index", { md: text => { return converter.makeHtml(text); }, user: {} });
} else {
res.render("dashboard/profile", { user_data: { id: user.data.id, avatar: user.data.avatar, username: user.data.username }, profile_data: { id: profile.data.id, avatar: profile.data.avatar, username: profile.data.username } })
}
});

router.get("/auth/discord", async (req, res) => {
Expand Down Expand Up @@ -273,13 +309,41 @@ router.get("/privacy", async (req, res) => {
});

router.get("/credits", async (req, res) => {
res.render("credits", { md: text => { return converter.makeHtml(text); }, user: {}});
let credits;
try {

credits = JSON.parse(fs.readFileSync(path.join(__dirname, "json", "credits.json")));
} catch (err) {

apiLogger.fatalError(`Could not read config file: ${err}`);
}
res.render("credits", { md: text => { return converter.makeHtml(text); }, user: {}, credits:credits});
});

router.get("/commands", (req, res) => {
res.render("commands", { md: text => { return converter.makeHtml(text); }, user: {}});
});

router.get("/phonedestroyer/cards", async (req, res) => {
let card;
try {

card = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "static" , "img", "pd-assets", "cards.json")));
} catch (err) {

apiLogger.fatalError(`Could not read cards file: ${err}`);
}
res.render("pd-cards-list", { md: text => { return converter.makeHtml(text); }, user: {}, card:card});
});

router.get("/phonedestroyer/cards/404", async (req, res) => {
res.render("pd-404", { md: text => { return converter.makeHtml(text); }, user: {}});
});

router.get("/phonedestroyer/cards/:cardid", async (req, res) => {
res.render("pd-card", { md: text => { return converter.makeHtml(text); }, user: {}});
});

router.get("/surveys", (req, res) => {
res.render("surveys", { md: text => { return converter.makeHtml(text); }, user: {}});
});
Expand Down Expand Up @@ -343,6 +407,35 @@ router.get("/dashboard/scripts/marketplace", authUser, async (req, res) => {
res.render("dashboard/marketplace", { user_data: user_res.data });
});

router.get("/dashboard/leaderboards/legacy", authUser, async (req, res) => {

let v1;
try {

v1 = JSON.parse(fs.readFileSync(path.join(__dirname, "json", "v1.json")));
} catch (err) {

apiLogger.fatalError(`Could not read config file: ${err}`);
}
let user;
try {

user = await axios({
method: "get",
url: `https://discordapp.com/api/v6/users/@me`,
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${req.session.discord.access_token}`
}
});
} catch(error) {

apiLogger.error(error);
}

res.render("dashboard/legacy-leaderboards", { user_data: { id: user.data.id, avatar: user.data.avatar, username: user.data.username }, v1:v1});
});

router.get("/dashboard/scripts/me", authUser, async (req, res) => {

let user_res;
Expand Down
138 changes: 138 additions & 0 deletions src/web/routes/json/credits.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
{
"developers": [{
"id": "168690518899949569",
"name": "Dragon1320",
"role": "BACKEND_DEV",
"image": "https://cdn.discordapp.com/attachments/379432139856412682/462725985356218368/Gai2.png",
"caption": "i want to die",
"socials": [{
"fa": "github",
"ic": "git",
"link": "https://github.com/dragon1320"
},
{
"fa": "reddit-alien",
"ic": "reddit",
"link": "https://reddit.com/u/dragon1320"
},
{
"fa": "",
"ic": "",
"link": "#"
}]
},
{
"id": "190914446774763520",
"name": "Mattheous",
"role": "FRONTEND_DEV",
"image": "https://cdn.discordapp.com/attachments/379432139856412682/462726578783256578/yaboi.jpg",
"caption": "i want to die",
"socials": [{
"fa": "github",
"ic": "git",
"link": "https://github.com/mattheousdt"
},
{
"fa": "reddit-alien",
"ic": "reddit",
"link": "https://reddit.com/u/redditmattheous"
},
{
"fa": "twitter",
"ic": "tw",
"link": "https://twitter.com/feinwaru"
}]
},
{
"id": "262345465306021888",
"name": "TowelRoyale",
"role": "ASSISTANT_BACKEND_DEV",
"image": "https://cdn.discordapp.com/attachments/379432139856412682/462726052280533003/Gai1.png",
"caption": "i want to die",
"socials": [{
"fa": "github",
"ic": "git",
"link": "https://github.com/towelroyale"
},
{
"fa": "reddit-alien",
"ic": "reddit",
"link": "https://reddit.com/u/smashroyaleyt"
},
{
"fa": "twitter",
"ic": "tw",
"link": "https://twitter.com/smashroyaleyt"
}]
},
{
"id": "215216840085864448",
"name": "Umustalldie2",
"role": "PD_COMMANDS",
"image": "https://cdn.discordapp.com/attachments/379432139856412682/462726578783256578/yaboi.jpg",
"caption": "i want to die",
"socials": [{
"fa": "github",
"ic": "git",
"link": "https://github.com/mattheousdt"
},
{
"fa": "reddit-alien",
"ic": "reddit",
"link": "https://reddit.com/u/redditmattheous"
},
{
"fa": "twitter",
"ic": "tw",
"link": "https://twitter.com/feinwaru"
}]
}

],
"artists": [{
"id": "168690518899949569",
"name": "Phinbella Flynn",
"role": "BACKEND_DEV",
"image": "https://cdn.discordapp.com/attachments/379432139856412682/462725985356218368/Gai2.png",
"caption": "i want to die",
"socials": [{
"fa": "github",
"ic": "git",
"link": "https://github.com/dragon1320"
},
{
"fa": "reddit-alien",
"ic": "reddit",
"link": "https://reddit.com/u/dragon1320"
},
{
"fa": "",
"ic": "",
"link": "#"
}]
},
{
"id": "190914446774763520",
"name": "Mattheous",
"role": "FRONTEND_DEV",
"image": "https://cdn.discordapp.com/attachments/379432139856412682/462726578783256578/yaboi.jpg",
"caption": "i want to die",
"socials": [{
"fa": "github",
"ic": "git",
"link": "https://github.com/mattheousdt"
},
{
"fa": "reddit-alien",
"ic": "reddit",
"link": "https://reddit.com/u/redditmattheous"
},
{
"fa": "twitter",
"ic": "tw",
"link": "https://twitter.com/feinwaru"
}]
}

]
}

0 comments on commit 9fab937

Please sign in to comment.