Skip to content

Commit

Permalink
Episode 1
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerPottsDev committed Oct 20, 2021
0 parents commit 4c3c047
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
package-lock.json
.env
22 changes: 22 additions & 0 deletions bot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require("dotenv").config();
const { Client, Intents } = require("discord.js");
const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES
]
});

client.once("ready", () => {
console.log("Ghost is online.");
});

client.on("messageCreate", message => {
if (message.content.startsWith(">")) {
if (message.content.substring(1) === "ping") {
message.reply("Pong!!!!");
}
}
});

client.login(process.env.TOKEN);
19 changes: 19 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "ghost-bot",
"version": "1.0.0",
"description": "",
"main": "bot.js",
"scripts": {
"dev": "nodemon bot.js"
},
"keywords": [],
"author": "Tyler Potts <hello@tylerpotts.co.uk>",
"license": "ISC",
"dependencies": {
"discord.js": "^13.2.0",
"dotenv": "^10.0.0"
},
"devDependencies": {
"nodemon": "^2.0.14"
}
}

0 comments on commit 4c3c047

Please sign in to comment.