forked from DreamBoy65/soundBoard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreadme.js
78 lines (72 loc) · 1.77 KB
/
readme.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
const fs = require("fs")
let array = []
let total = 0
fs.readdirSync("./src/").forEach(dir => {
const files = fs.readdirSync(`./src/${dir}/`).filter(f => f.endsWith(".mp4") || f.endsWith(".mp3"))
array.push({
category: dir,
files: []
})
let Arr = array.find(c => c.category === dir)
files.forEach(file => {
Arr.files.push(`+ - ${file.split(".")[0]}`)
})
})
array.map(c => {
c.files.map(f => {
total++
})
})
fs.writeFileSync("readme.MD", [
`<p ="center">
<img src="https://img.shields.io/npm/dt/djs-soundboard?style=for-the-badge">
<img src="https://img.shields.io/npm/v/djs-soundboard?style=for-the-badge">
<a href = "https://discord.gg/7UQaVPBQka" > <img src="https://img.shields.io/badge/Server-Invite-brightgreen" href = "">
</a>
</p>`,
"",
"# Invite Bot:",
"",
"+ https://dsc.gg/waifu.gg",
"",
"# Example",
"",
"+ Soundboard:",
"```js",
'const SoundBoard = require("djs-soundboard")',
"",
"let sound = new SoundBoard()",
"",
'let channel = message.member.voice.channel // required*',
"",
'sound.play(channel, "bruh") //Sound',
'```',
"",
"+ TTS",
"```js",
'const SoundBoard = require("djs-soundboard")',
"",
"let sound = new SoundBoard()",
"",
'let channel = message.member.voice.channel // required*',
"",
'sound.tts(channel, "bruh") //Text',
"```",
"",
"```js",
"+ Functions:",
"+ - 1: getAllSounds => get all soundboard sounds\nType: Array.",
"",
"+ - 2: getAllLocales => get all supported languages for tts\nType: Array.",
"```",
"",
'# Sounds:',
array.map(c => {
return `\n\n+ ${c.category.toUpperCase()}\n${c.files.join("\n")}`
}),
"",
"Total Sounds:",
`${total}`,
"",
`Last Updated: ${new Date()}`
].join("\n"))