Basic setup

This commit is contained in:
benji7425 2017-07-26 22:29:05 +01:00
parent 34ab0a0a18
commit f743135197
5 changed files with 48 additions and 0 deletions

6
.gitignore vendored
View File

@ -1,3 +1,9 @@
# Project specific
token.json
guilds.json
log
### Node ###
# Logs
logs

14
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceRoot}/wrapper.js"
}
]
}

9
app/index.js Normal file
View File

@ -0,0 +1,9 @@
//acts as on ready function
module.exports = (client) => {
client.on("message", message => message.reply("Hello!"));
//check messages in channel for links posted since last online
//set up an interval to check all the feeds
//set up an on message handler to detect when links are posted
};

View File

@ -18,6 +18,7 @@
"homepage": "https://github.com/benji7425/discord-bot-feed-linker#readme",
"dependencies": {
"discord.js": "11.1.0",
"discordjs-util": "git+https://github.com/benji7425/discordjs-util.git",
"dns": "0.2.2",
"feed-read": "0.0.1",
"urijs": "1.18.10"

18
wrapper.js Normal file
View File

@ -0,0 +1,18 @@
const Discord = require("discord.js");
const Util = require("discordjs-util");
const client = new Discord.Client();
process.on("uncaughtException", (err) => {
Util.dateError(err);
});
client.login(require("./token.json").token);
client.on("ready", () => {
require("./app/index.js")(client);
});
client.on("disconnect", eventData => {
Util.dateError(eventData.code, eventData.reason);
});