25 lines
6.0 KiB
JavaScript
25 lines
6.0 KiB
JavaScript
var client = require("./client");
|
|
var commands = require("./commands");
|
|
var config = require("./config");
|
|
|
|
var 漢字たち = [{"漢字":"日","音読み":["nichi","jitsu"],"意味":"day, sun, Japan, counter for days"},{"漢字":"一","音読み":["ichi"],"意味":"one"},{"漢字":"国","音読み":["koku"],"意味":"country"},{"漢字":"人","音読み":["jin","nin"],"意味":"person"},{"漢字":"年","音読み":["nen"],"意味":"year, counter for years"},{"漢字":"大","音読み":["dai","tai"],"意味":"large, big"},{"漢字":"十","音読み":["juu"],"意味":"ten, 10"},{"漢字":"二","音読み":["ni","ji"],"意味":"two, 2"},{"漢字":"本","音読み":["hon"],"意味":"book, present, true, counter for long cylindrical things"},{"漢字":"中","音読み":["chuu"],"意味":"in, inside, middle, mean, center"},{"漢字":"長","音読み":["chou"],"意味":"long, leader, superior, senior"},{"漢字":"出","音読み":["shutsu","sui"],"意味":"exit, leave, go out"},{"漢字":"三","音読み":["san"],"意味":"three, 3"},{"漢字":"時","音読み":["ji"],"意味":"time, hour"},{"漢字":"行","音読み":["kou","gyou","an"],"意味":"going, journey, carry out, line, row"},{"漢字":"見","音読み":["ken"],"意味":"see, hopes, chances, idea, opinion, look at, visible"},{"漢字":"月","音読み":["getsu","gatsu"],"意味":"month, moon"},{"漢字":"分","音読み":["bun","fun","bu"],"意味":"part, minute of time, understand"},{"漢字":"後","音読み":["go","kou"],"意味":"behind, back, later"},{"漢字":"前","音読み":["zen"],"意味":"in front, before"},{"漢字":"生","音読み":["sei","shou"],"意味":"life, genuine, birth"},{"漢字":"五","音読み":["go"],"意味":"five, 5"},{"漢字":"間","音読み":["kan","ken"],"意味":"interval, space"},{"漢字":"上","音読み":["jou","shou","shan"],"意味":"above, up"},{"漢字":"東","音読み":["tou"],"意味":"east"},{"漢字":"四","音読み":["shi"],"意味":"four, 4"},{"漢字":"今","音読み":["kon","kin"],"意味":"now; the present"},{"漢字":"金","音読み":["kin","kon","gon"],"意味":"gold"},{"漢字":"九","音読み":["kyuu","ku"],"意味":"nine, 9"},{"漢字":"入","音読み":["nyuu"],"意味":"enter, insert"},{"漢字":"学","音読み":["gaku"],"意味":"study, learning, science"},{"漢字":"高","音読み":["kou"],"意味":"tall, high, expensive"},{"漢字":"円","音読み":["en"],"意味":"circle, yen, round"},{"漢字":"子","音読み":["shi","su","tsu"],"意味":"child"},{"漢字":"外","音読み":["gai","ge"],"意味":"outside"},{"漢字":"八","音読み":["hachi"],"意味":"eight, 8"},{"漢字":"六","音読み":["roku"],"意味":"six, 6"},{"漢字":"下","音読み":["ka","ge"],"意味":"below, down, descend, give, low, inferior"},{"漢字":"来","音読み":["rai","tai"],"意味":"come, due, next, cause, become"},{"漢字":"気","音読み":["ki","ke"],"意味":"spirit, mind, air, atmosphere, mood"},{"漢字":"小","音読み":["shou"],"意味":"little, small"},{"漢字":"七","音読み":["shichi"],"意味":"seven, 7"},{"漢字":"山","音読み":["san","sen"],"意味":"mountain"},{"漢字":"話","音読み":["wa"],"意味":"tale, talk"},{"漢字":"女","音読み":["jo"],"意味":"woman, female"},{"漢字":"北","音読み":["hoku"],"意味":"north"},{"漢字":"午","音読み":["go"],"意味":"noon, sign of the horse"},{"漢字":"百","音読み":["hyaku","byaku"],"意味":"hundred"},{"漢字":"書","音読み":["sho"],"意味":"write"},{"漢字":"先","音読み":["sen"],"意味":"before, ahead, previous, future, precedence"},{"漢字":"名","音読み":["mei","myou"],"意味":"name, noted, distinguished, reputation"},{"漢字":"川","音読み":["sen"],"意味":"river, stream"},{"漢字":"千","音読み":["sen"],"意味":"thousand"},{"漢字":"水","音読み":["sui"],"意味":"water"},{"漢字":"半","音読み":["han"],"意味":"half, middle, odd number, semi-"},{"漢字":"男","音読み":["dan","nan"],"意味":"male; man"},{"漢字":"西","音読み":["sei","sai"],"意味":"west"},{"漢字":"電","音読み":["den"],"意味":"electricity; electric powered"},{"漢字":"校","音読み":["kou"],"意味":"school, exam"},{"漢字":"語","音読み":["go"],"意味":"word, speech, language"},{"漢字":"土","音読み":["do","to"],"意味":"soil, earth, ground"},{"漢字":"木","音読み":["boku","moku"],"意味":"tree, wood"},{"漢字":"聞","音読み":["bun","mon"],"意味":"to hear; to listen; to ask"},{"漢字":"食","音読み":["shoku","jiki"],"意味":"eat, food"},{"漢字":"車","音読み":["sha"],"意味":"car, wheel"},{"漢字":"何","音読み":["ka"],"意味":"what"},{"漢字":"南","音読み":["nan","na"],"意味":"south"},{"漢字":"万","音読み":["man","ban"],"意味":"ten thousand, 10,000"},{"漢字":"毎","音読み":["mai"],"意味":"every"},{"漢字":"白","音読み":["haku","byaku"],"意味":"white"},{"漢字":"天","音読み":["ten"],"意味":"heavens, sky, imperial"},{"漢字":"母","音読み":["bo"],"意味":"mother"},{"漢字":"火","音読み":["ka"],"意味":"fire"},{"漢字":"右","音読み":["u","yuu"],"意味":"right"},{"漢字":"読","音読み":["doku","toku","tou"],"意味":"to read"},{"漢字":"友","音読み":["yuu"],"意味":"friend"},{"漢字":"左","音読み":["sa","sha"],"意味":"left"},{"漢字":"休","音読み":["kyuu"],"意味":"rest, day off, retire, sleep"},{"漢字":"父","音読み":["fu"],"意味":"father"},{"漢字":"雨","音読み":["u"],"意味":"rain"}];
|
|
var 今漢字 = random(漢字たち);
|
|
|
|
commands.push({
|
|
name: "kanjigame",
|
|
description: "Start kanji game",
|
|
exec: i => {
|
|
i.reply(今漢字.漢字);
|
|
}
|
|
});
|
|
|
|
client.on("messageCreate", async message => {
|
|
if (message.channel.id != config.bot_channel || message.author.id == client.user.id) return;
|
|
let a = message.content.toLowerCase();
|
|
if (今漢字.音読み.includes(a)) {
|
|
await message.reply(`${今漢字.漢字} = ${今漢字.意味}`);
|
|
await message.channel.send((今漢字 = random(漢字たち)).漢字)
|
|
} else if (a == "idk") {
|
|
await message.channel.send(今漢字.音読み.join(" or "));
|
|
}
|
|
}); |