summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlee14 <Alee14498@gmail.com>2018-01-12 19:06:32 -0500
committerAlee14 <Alee14498@gmail.com>2018-01-12 19:06:32 -0500
commit0bd7dac470c21a3aeea6b31c3644459f2c528527 (patch)
treef6f4545c952c4a08a4a591d0cd80bd26a0195a34
parenta9220483be2486fd6559f3456e625f02463087d2 (diff)
downloadVTBot-0bd7dac470c21a3aeea6b31c3644459f2c528527.tar.gz
VTBot-0bd7dac470c21a3aeea6b31c3644459f2c528527.tar.bz2
VTBot-0bd7dac470c21a3aeea6b31c3644459f2c528527.zip
Added help and ping command + added setgame
-rw-r--r--.gitignore3
-rw-r--r--bot.js51
-rw-r--r--package-lock.json63
3 files changed, 117 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index cd2946a..aafe42c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,3 +45,6 @@ $RECYCLE.BIN/
Network Trash Folder
Temporary Items
.apdisk
+
+node_modules/
+config.json
diff --git a/bot.js b/bot.js
new file mode 100644
index 0000000..9e9943f
--- /dev/null
+++ b/bot.js
@@ -0,0 +1,51 @@
+const Discord = require("discord.js");
+const client = new Discord.Client();
+const config = require('./config.json');
+const vtVersion = "1.0.0";
+const prefix = "vt!";
+
+function setGame() {
+ var games = [
+ "For help: vt!help",
+ "QT Creator",
+ "theShell",
+ "VS Code"
+ ]
+
+ client.user.setPresence({
+ status: 'online',
+ afk: false,
+ game: {
+ type: 0,
+ name: games[Math.floor(Math.random() * games.length)]
+ }
+ })
+}
+
+client.on('ready', () => {
+ console.log(`[STATUS] Bot is now ready!`);
+ console.log(`[STATUS] Logged in as ${client.user.tag}!`);
+ setGame();
+ client.setInterval(setGame, 200000);
+});
+
+client.on('message', msg => {
+
+ 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.setColor("00C8FF")
+ msg.channel.send({embed});
+ }
+
+ if (msg.content == prefix + 'ping') {
+ msg.reply(':warning: Pong!')
+ }
+
+
+});
+
+client.login(config.token); \ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
new file mode 100644
index 0000000..92064d1
--- /dev/null
+++ b/package-lock.json
@@ -0,0 +1,63 @@
+{
+ "requires": true,
+ "lockfileVersion": 1,
+ "dependencies": {
+ "async-limiter": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz",
+ "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg=="
+ },
+ "discord.js": {
+ "version": "11.2.1",
+ "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-11.2.1.tgz",
+ "integrity": "sha512-8Mor+IREVWHinjRd6Bu6OwRfT+ET/WEoLWMl8crFvBVcTFmaO/TSwP39C8QIGCB2YMVMYMdljjX/w17AUMemqg==",
+ "requires": {
+ "long": "3.2.0",
+ "prism-media": "0.0.1",
+ "snekfetch": "3.6.1",
+ "tweetnacl": "1.0.0",
+ "ws": "3.3.3"
+ }
+ },
+ "long": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz",
+ "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s="
+ },
+ "prism-media": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-0.0.1.tgz",
+ "integrity": "sha1-o0JcnKvVDRxsAuVDlBoRiVZnvRA="
+ },
+ "safe-buffer": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
+ "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg=="
+ },
+ "snekfetch": {
+ "version": "3.6.1",
+ "resolved": "https://registry.npmjs.org/snekfetch/-/snekfetch-3.6.1.tgz",
+ "integrity": "sha512-aLEvf1YR440pINb0LEo/SL2Q2s/A26+YEqPlx09A0XpGH7qWp8iqIFFolVILHn2yudWXJne9QWyQu+lzDp+ksQ=="
+ },
+ "tweetnacl": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.0.tgz",
+ "integrity": "sha1-cT2LgY2kIGh0C/aDhtBHnmb8ins="
+ },
+ "ultron": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz",
+ "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og=="
+ },
+ "ws": {
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz",
+ "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==",
+ "requires": {
+ "async-limiter": "1.0.0",
+ "safe-buffer": "5.1.1",
+ "ultron": "1.1.1"
+ }
+ }
+ }
+}