Skip to content

Commit 59da46c

Browse files
committed
miku now has her own website! OwO
1 parent 2863288 commit 59da46c

File tree

7 files changed

+400
-31
lines changed

7 files changed

+400
-31
lines changed

index.js

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,2 @@
1-
const Discord = require("discord.js");
2-
const bot = new Discord.Client({
3-
partials: ["MESSAGE", "CHANNEL", "REACTION"]
4-
});
5-
const fs = require("fs");
6-
const Enmap = require("enmap");
7-
const chalk = require("chalk");
8-
const walker = require("walker");
9-
require("./util/eventLoader.js")(bot);
10-
require("./modules/function.js")(bot);
11-
bot.config = require("./config.js").config;
12-
bot.commands = new Enmap();
13-
bot.aliases = new Enmap();
14-
bot.cdTime = new Enmap();
15-
bot.commandsConf = new Enmap();
16-
17-
// INITIALIZATION
18-
const init = async () => {
19-
const folder = walker(`./commands/`).on("file", file => {
20-
if (!file.endsWith(".js")) return;
21-
let response = bot.loadCommand(file);
22-
if (response) console.log(response);
23-
});
24-
};
25-
26-
// CLEAN USER COOLDOWNS
27-
const talkedRecently = {};
28-
writeFile("./assets/cooldowns", talkedRecently);
29-
init();
30-
bot.login(bot.config.token);
1+
require("./miku.js")();
2+
require("./site.js")();

miku.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
module.exports = () => {
2+
const Discord = require("discord.js");
3+
const bot = new Discord.Client({
4+
partials: ["MESSAGE", "CHANNEL", "REACTION"]
5+
});
6+
const fs = require("fs");
7+
const Enmap = require("enmap");
8+
const chalk = require("chalk");
9+
const walker = require("walker");
10+
require("./util/eventLoader.js")(bot);
11+
require("./modules/function.js")(bot);
12+
bot.config = require("./config.js").config;
13+
bot.commands = new Enmap();
14+
bot.aliases = new Enmap();
15+
bot.cdTime = new Enmap();
16+
bot.commandsConf = new Enmap();
17+
18+
// INITIALIZATION
19+
const init = async () => {
20+
const folder = walker(`./commands/`).on("file", file => {
21+
if (!file.endsWith(".js")) return;
22+
let response = bot.loadCommand(file);
23+
if (response) console.log(response);
24+
});
25+
};
26+
27+
// CLEAN USER COOLDOWNS
28+
const talkedRecently = {};
29+
writeFile("./assets/cooldowns", talkedRecently);
30+
init();
31+
bot.login(bot.config.token);
32+
};

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717
"discord.js": "discordjs/discord.js",
1818
"dog-names": "^2.0.0",
1919
"enmap": "^5.2.1",
20+
"express": "^4.17.1",
2021
"fs-nextra": "^0.4.5",
2122
"gfycat-sdk": "^1.4.18",
2223
"google-images": "^2.1.0",
2324
"google-spreadsheet": "^2.0.8",
25+
"hbs": "^4.0.6",
2426
"mathjs": "^6.2.3",
2527
"mongodb": "^3.3.4",
2628
"nekos.life": "^2.0.4",
@@ -38,4 +40,4 @@
3840
"url": "https://github.com/shidoitsuka/another-miku-bot/issues"
3941
},
4042
"homepage": "https://github.com/shidoitsuka/another-miku-bot#readme"
41-
}
43+
}

site.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
module.exports = () => {
2+
const express = require("express");
3+
const app = express();
4+
const path = require("path");
5+
const hbs = require("hbs");
6+
const { readdirSync } = require("fs");
7+
8+
app.use(express.static(path.join(__dirname, "views")));
9+
app.set("view engine", "hbs");
10+
app.get("/", (request, response) => {
11+
let command = {};
12+
readdirSync("./commands")
13+
.filter(folders => folders !== "Owner")
14+
.map(folders => {
15+
command[folders] = {};
16+
readdirSync(`./commands/${folders}`).map(files => {
17+
command[folders][
18+
files.replace(".js", "")
19+
] = require(`./commands/${folders}/${files}`);
20+
});
21+
});
22+
response.render("index", { data: { command } });
23+
});
24+
25+
app.listen(3000, console.log("site is ready"));
26+
};

views/css/user.css

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
.hidden {
2+
display: none;
3+
}
4+
5+
.tooltip {
6+
position: relative;
7+
padding-right: 1rem;
8+
}
9+
10+
.tooltip i.fa {
11+
position: absolute;
12+
top: 0;
13+
right: 0;
14+
font-size: 1rem;
15+
filter: #d8eef0;
16+
}
17+
18+
.tooltipped {
19+
cursor: help;
20+
border-bottom: 2px solid #a14858;
21+
}
22+
23+
.ohidden {
24+
opacity: 0;
25+
}
26+
27+
nav {
28+
position: fixed;
29+
display: none;
30+
background-color: #f5f5f5;
31+
z-index: 1;
32+
}
33+
34+
nav a {
35+
color: #707070 !important;
36+
}
37+
38+
.canvas-header h1 {
39+
text-align: center;
40+
font-size: 5rem;
41+
position: relative;
42+
top: 40%;
43+
font-family: "Indie Flower";
44+
font-size: 15vh;
45+
}
46+
47+
.canvas-header img {
48+
filter: brightness(30%);
49+
height: 250%;
50+
}
51+
52+
.header {
53+
border-bottom: 2px solid;
54+
}
55+
56+
h2.header {
57+
font-family: "Caveat";
58+
}
59+
60+
.commands table tr td,
61+
.commands table tr th {
62+
color: #236870;
63+
}
64+
65+
.commands table {
66+
margin-bottom: 2vh;
67+
}
68+
69+
.more-feature tr td {
70+
color: #424242;
71+
}
72+
73+
.more h1 {
74+
text-align: center;
75+
position: relative;
76+
top: 30%;
77+
}
78+
79+
.required {
80+
background-color: #2c656b;
81+
color: #59d1de;
82+
border-radius: 3px;
83+
margin: 2px;
84+
}
85+
86+
.optional {
87+
background-color: #59d1de;
88+
color: #2c656b;
89+
border-radius: 3px;
90+
margin: 2px;
91+
}
92+
93+
.more img {
94+
height: 150%;
95+
width: 50%;
96+
filter: brightness(50%);
97+
}
98+
99+
* {
100+
color: #1a9ca8;
101+
scroll-behavior: smooth;
102+
}
103+
104+
body {
105+
font-family: "Patrick Hand";
106+
font-size: 1.3rem !important;
107+
}
108+
109+
html {
110+
font-size: 100%;
111+
max-width: 100%;
112+
max-height: 100%;
113+
}
114+
115+
.page-footer {
116+
background-color: #e6e6e6;
117+
}

views/index.hbs

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
<!DOCTYPE html>
2+
<html lang="en" dir="ltr">
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" />
7+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
8+
<meta name="HandheldFriendly" content="true" />
9+
<!-- fonts -->
10+
<link href="https://fonts.googleapis.com/css?family=Indie+Flower&display=swap" rel="stylesheet" />
11+
<link href="https://fonts.googleapis.com/css?family=Caveat&display=swap" rel="stylesheet" />
12+
<link href="https://fonts.googleapis.com/css?family=Patrick+Hand&display=swap" rel="stylesheet" />
13+
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
14+
<!-- !fonts -->
15+
<title>Miku Bot</title>
16+
<!-- libs -->
17+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
18+
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
19+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/typeit.min.js"></script>
20+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
21+
22+
<!-- !libs -->
23+
<!-- user-defined -->
24+
<script src="js/user.js" charset="utf-8"></script>
25+
<link rel="stylesheet" href="css/user.css" />
26+
<!-- !user-defined -->
27+
</head>
28+
29+
<body>
30+
<!-- header -->
31+
<div class="canvas-header">
32+
<nav>
33+
<div class="nav-wrapper">
34+
<a href="#" class="brand-logo center">Miku</a>
35+
<ul id="nav-mobile" class="right hide-on-med-and-down">
36+
<li><a href="#about">About</a></li>
37+
<li><a href="#commands">Commands</a></li>
38+
<li><a href="#more">Additional Features!</a></li>
39+
<li><a href="#">Invite!</a></li>
40+
</ul>
41+
</div>
42+
</nav>
43+
<!-- header image -->
44+
<div class="parallax-container header-image">
45+
<h1 id="typewriting"></h1>
46+
<div class="parallax"><img src="https://cdn.glitch.com/66028ce3-d8f3-4656-aee3-c294c177ba0c%2F1.png?v=1574709973716" /></div>
47+
</div>
48+
<!-- !header image -->
49+
</div>
50+
<!-- !header -->
51+
52+
<div class="body">
53+
<!-- about -->
54+
<div class="section white" id="about">
55+
<div class="row container">
56+
<h2 class="header ohidden">About</h2>
57+
<p class="grey-text text-darken-3 lighten-3 ohidden">
58+
Miku is a <i>just4fun</i> bot made by <i>12042#5754</i> with all
59+
of his <b>♡</b>!
60+
</p>
61+
</div>
62+
</div>
63+
<!-- !about -->
64+
65+
<!-- 2nd image -->
66+
<div class="parallax-container">
67+
<div class="parallax"><img src="https://cdn.glitch.com/66028ce3-d8f3-4656-aee3-c294c177ba0c%2F3.png?v=1574710050745" /></div>
68+
</div>
69+
<!-- !2nd image -->
70+
<!-- commands -->
71+
<div class="section white" id="commands">
72+
<div class="row container">
73+
<h2 class="header ohidden">Available Commands</h2>
74+
<ul class="collapsible ohidden">
75+
{{#each data.command}}
76+
<li>
77+
<div class="collapsible-header">{{@key}}</div>
78+
<div class="collapsible-body commands">
79+
<table>
80+
<thead>
81+
<tr>
82+
<th>Name</th>
83+
<th>Description</th>
84+
<th>Usage</th>
85+
</tr>
86+
</thead>
87+
<tbody>
88+
{{#each this}}
89+
<tr>
90+
<td>{{this.help.name}}</td>
91+
<td>{{this.help.description}}</td>
92+
<td>{{this.help.usage}}</td>
93+
</tr>
94+
{{/each}}
95+
</tbody>
96+
</table>
97+
</div>
98+
</li>
99+
{{/each}}
100+
</ul>
101+
</div>
102+
</div>
103+
<!-- !commands -->
104+
105+
<!-- 3rd image -->
106+
<div class="parallax-container more">
107+
<h1>🌟🌟🌟</h1>
108+
<div class="parallax"><img src="https://cdn.glitch.com/66028ce3-d8f3-4656-aee3-c294c177ba0c%2F4.png?v=1574710040425" /></div>
109+
</div>
110+
<!-- !3rd image -->
111+
112+
<!-- more features -->
113+
<div class="section white" id="more">
114+
<div class="row container">
115+
<h2 class="header ohidden">More Features!</h2>
116+
<p class="grey-text text-darken-3 lighten-3 ohidden">
117+
Miku also comes with few more feature includings :
118+
</p>
119+
<table class="more-feature ohidden">
120+
<tr>
121+
<td>Greeting system</td>
122+
<td>:</td>
123+
<td>Miku will greet new members</td>
124+
</tr>
125+
<tr>
126+
<td>Custom prefix system</td>
127+
<td>:</td>
128+
<td>Tired of using default prefix? Change it!</td>
129+
</tr>
130+
<tr>
131+
<td>Starboard system</td>
132+
<td>:</td>
133+
<td>
134+
Everytime a message has more than 3 stars, Miku will send it
135+
to your server's starboard channel! ⭐⭐⭐
136+
</td>
137+
</tr>
138+
</table>
139+
</div>
140+
</div>
141+
<!-- !more features -->
142+
143+
<footer class="page-footer">
144+
<div class="container">
145+
<div class="row">
146+
<div class="col l6 s12">
147+
<h5 class="grey-text text-darken-4">Lorem Ipsum</h5>
148+
<hr>
149+
<p class="grey-text text-darken-2">Lorem ipsum dolor sit amet, what should I type here?</p>
150+
</div>
151+
<div class="col l4 offset-l2 s12">
152+
<h5 class="grey-text text-darken-4">Useful Links</h5>
153+
<hr>
154+
<p class="grey-text text-darken-2">No links yet!</p>
155+
</div>
156+
</div>
157+
</div>
158+
<div class="footer-copyright">
159+
<div class="container center">
160+
<span class="grey-text text-darken-1">standinshd</span>
161+
</div>
162+
</div>
163+
</footer>
164+
</div>
165+
</body>
166+
167+
</html>

0 commit comments

Comments
 (0)