From 0cbdb1791a3d36ca554c2003593d5da03d755a8b Mon Sep 17 00:00:00 2001 From: NightCrystal169 <35397935+NightCrystal169@users.noreply.github.com> Date: Sat, 13 Jan 2018 21:23:18 +0900 Subject: [PATCH] Update run.js --- run.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/run.js b/run.js index 8b13789..79e1e25 100644 --- a/run.js +++ b/run.js @@ -1 +1,26 @@ +const Discord = require('discord.js'); +const Client = new Discord.Client(); +const prefix = "-" +Client.on("ready", () => { + Client.user.setGame('@NightCrystal|-help'); + Client.user.setStatus('online'); + console.log("online"); +}); + +Client.on("message", message => { + if (message.author.bot) return; + if (!message.content.startsWith(prefix)) return; + let command = message.content.split(" ")[0]; + command = command.slice(prefix.length); + let args = message.content.split(" ").slice(1); + if (command === "help") { + const embed = new Discord.RichEmbed().setColor(0x0000FF).setAuthor("HELP", "https://goo.gl/ENFFtn").addField("-help: ", "コマンドリストを表示します。").addField("-ping: ", "通信速度を表示します。").addField("-lobi-allkick", "900人以上居るCorePvPのメンバーを全員Kickします。(機能実装予定)") + message.channel.send(embed); + } else + if (command === "ping") { + message.channel.sendMessage(new Date().getTime() - message.createdTimestamp + "ms"); + } +}); + +Client.login("Token");