Skip to content

Commit 9132bd3

Browse files
committed
UwU
1 parent e87a40c commit 9132bd3

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

commands/addQuestion.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@ const Enmap = require("enmap");
33
const jsonfile = require("jsonfile");
44
const file = "./questions.json";
55
const { MessageEmbed } = require("discord.js");
6+
const Discord = require("discord.js");
7+
const client = new Discord.Client();
68
function between(min, max) {
79
return Math.floor(Math.random() * (max - min + 1) + min);
810
}
911
const readline = require('readline');
1012
const fs = require('fs');
13+
function sendFAQChannel() {
14+
client.channels.cache.get('701517404659777666').send(collected.first().content, collected.last().content);
15+
}
1116

1217
module.exports = {
1318
name: "addfaq",
@@ -28,6 +33,7 @@ module.exports = {
2833
ID = Math.random().toString(36).substr(2, 9);
2934
const obj = { Question: collected.first().content, Answer: collected.last().content};
3035
jsonfile.writeFileSync(file, obj , { spaces: 2, flag: "a", EOL: '\r\n' });
36+
sendFAQChannel();
3137
message.channel.send("FAQ Logged!");
3238
// The collected.first().content is the first thing the sender of the initial message chats
3339
// The time: 60000000 represents that it won't collect data after 60 seconds

questions.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,35 @@
1010
"Question": "owo",
1111
"Answer": "what's this"
1212
}
13+
{
14+
"Question": "no",
15+
"Answer": "u"
16+
}
17+
{
18+
"Question": "no",
19+
"Answer": "u"
20+
}
21+
{
22+
"Question": "a",
23+
"Answer": "o"
24+
}
25+
{
26+
"Question": "Yes",
27+
"Answer": "Maybe"
28+
}
29+
{
30+
"Question": "question",
31+
"Answer": "answer"
32+
}
33+
{
34+
"Question": "ee",
35+
"Answer": "oo"
36+
}
37+
{
38+
"Question": "nonwo",
39+
"Answer": "nonwonownwonwonw"
40+
}
41+
{
42+
"Question": "yeyey",
43+
"Answer": "ueueueu"
44+
}

0 commit comments

Comments
 (0)