summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bot.js44
-rw-r--r--package-lock.json5
2 files changed, 48 insertions, 1 deletions
diff --git a/bot.js b/bot.js
index 9e9943f..5527c29 100644
--- a/bot.js
+++ b/bot.js
@@ -1,6 +1,7 @@
const Discord = require("discord.js");
const client = new Discord.Client();
const config = require('./config.json');
+const readline = require('readline');
const vtVersion = "1.0.0";
const prefix = "vt!";
@@ -23,20 +24,61 @@ function setGame() {
}
client.on('ready', () => {
+ console.log(`Welcome to VTBot Terminal!`)
console.log(`[STATUS] Bot is now ready!`);
console.log(`[STATUS] Logged in as ${client.user.tag}!`);
+ console.log(`[STATUS] Prefix: ` + prefix)
+ console.log(`[STATUS] Token: ` + config.token)
setGame();
client.setInterval(setGame, 200000);
+
+ const rl = readline.createInterface({
+ input: process.stdin,
+ output: process.stdout,
+ prompt: 'VTBot> '
+ });
+
+ rl.prompt();
+
+ rl.on('line', (line) => {
+ switch (line.trim()) {
+ case 'help':
+ console.log('VTBot Terminal Help:\nhelp\nping');
+ break;
+ default:
+ console.log(`[ERROR] Unknown command: ${line.trim()}`);
+ break;
+ }
+ rl.prompt();
+ }).on('close', () => {
+ console.log('Have a great day!');
+ process.exit(0);
+ });
+
});
client.on('message', msg => {
+ if (msg.mentions != null && msg.mentions.users != null) {
+ if (msg.mentions.users.has("401491921865801728")) {
+ if (msg.author.id == 361202413165608962) {
+ msg.reply("BEGONE. You're a undertale fan. :sob:");
+ } else {
+ if (msg.content.toLowerCase().includes("hello")) {
+ msg.reply("Hi there.");
+ } else if (msg.content.toLowerCase().includes("shut") && msg.content.toLowerCase().includes("up")) {
+ msg.reply("Excuse me?")
+ }
+ }
+ }
+ }
+
if (msg.content == prefix + 'help') {
const embed = new Discord.RichEmbed();
embed.setTitle('VTBot Help')
embed.setDescription('Every command you put in this bot must start with `' + prefix + '`')
embed.addField('- General Commands', 'ping', true)
- .setFooter("VTBot Copyright 2018. The version that VTBot's running is " + vtVersion + "!")
+ embed.setFooter("VTBot Copyright 2018. The version that VTBot's running is " + vtVersion + "!")
embed.setColor("00C8FF")
msg.channel.send({embed});
}
diff --git a/package-lock.json b/package-lock.json
index 92064d1..8e7d502 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -29,6 +29,11 @@
"resolved": "https://registry.npmjs.org/prism-media/-/prism-media-0.0.1.tgz",
"integrity": "sha1-o0JcnKvVDRxsAuVDlBoRiVZnvRA="
},
+ "readline": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/readline/-/readline-1.3.0.tgz",
+ "integrity": "sha1-xYDXfvLPyHUrEySYBg3JeTp6wBw="
+ },
"safe-buffer": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",