This repository has been archived by the owner on Jan 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
88 lines (78 loc) · 4.26 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
const fetch = require('node-fetch');
const fs = require('fs');
module.exports = (themeConfig={}) => {
console.log(`
██████ ██████ ██████ ██████ ██████ ██████ ██████ ██████ ██████ ██████ ██████
IMPORTANT
This DBD theme has been deprecated!
This theme is no longer supported. Please use dbd-soft-ui Theme instead:
https://www.npmjs.com/package/dbd-soft-ui
██████ ██████ ██████ ██████ ██████ ██████ ██████ ██████ ██████ ██████ ██████
`)
if(
require('discord-dashboard').version.startsWith('1')
||
require('discord-dashboard').version.startsWith('2.0')
||
require('discord-dashboard').version.startsWith('2.1')
||
require('discord-dashboard').version.startsWith('2.2')
)throw new TypeError("This theme supports only discord-dashboard@>2.3 # Please update your discord-dashboard module.");
return {
themeCodename: 'cprihm',
viewsPath: require('path').join(__dirname, '/views'),
staticPath: require('path').join(__dirname, '/views/src'),
embedBuilderComponent: (require('fs').readFileSync(require('path').join(__dirname, '/embedBuilderComponent.txt'), 'utf8')).replace('{{Colour}}', themeConfig.colourUpperCase ? themeConfig.colourUpperCase : 'Colour').replace('{{colour}}', themeConfig.colourLowerCase ? themeConfig.colourLowerCase : 'colour'),
themeConfig: themeConfig,
init: (app, config)=>{
app.use('/commands', (req,res)=>{
res.render('commands', {req:req,config:config,themeConfig:themeConfig});
});
app.use('/debug', async(req, res) => {
/*
If you are modifying the theme, please do not remove this page.
It will be used with support in the discord server.
*/
let onlineFiles = {
index: await fetch(`https://adn.siondevelopment.xyz/dbd-capri/src/ejs/index.ejs`),
guild: await fetch(`https://adn.siondevelopment.xyz/dbd-capri/src/ejs/guild.ejs`),
guilds: await fetch(`https://adn.siondevelopment.xyz/dbd-capri/src/ejs/guilds.ejs`)
}
onlineFiles.index = await onlineFiles.index.text();
onlineFiles.guild = await onlineFiles.guild.text();
onlineFiles.guilds = await onlineFiles.guilds.text();
let localFiles = {
index: await fs.readFileSync(__dirname + '/views/index.ejs', 'utf-8'),
guild: await fs.readFileSync(__dirname + '/views/guild.ejs', 'utf-8'),
guilds: await fs.readFileSync(__dirname + '/views/guilds.ejs', 'utf-8')
}
res.render('debug', {bot: config.bot, req, config, rawUptime: process.uptime(), onlineFiles, localFiles, nodeVersion: process.version, themeConfig: themeConfig, discordVersion: require('discord.js').version, dbdVersion: require('discord-dashboard').version, themeVersion: require('./package.json').version});
});
app.use('/privacy-policy', (req,res) => {
res.render('pp', {req:req,config:config,themeConfig:themeConfig});
});
},
customThemeOptions: {
manage: async ({req,res,config}) => {
return {
isPremium: req.session.user.id == "123" ? true : false,
}
},
getGuild: async ({req,res,config,guildId}) => {
return {
isPremium: req.session.user.id == "123" ? true : false,
}
},
settingsUpdate: async ({req,res,config,guildId,categoryId}) => {
return {
isPremium: req.session.user.id == "123" ? true : false,
}
},
index: async ({req,res,config}) => {
return {
isPremium: req.session.user.id == "123" ? true : false,
}
}
}
};
};