Browse Source

Basic setup

shorten
benji7425 4 years ago
parent
commit
f743135197
  1. 6
      .gitignore
  2. 14
      .vscode/launch.json
  3. 9
      app/index.js
  4. 1
      package.json
  5. 18
      wrapper.js

6
.gitignore

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

14
.vscode/launch.json

@ -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

@ -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
};

1
package.json

@ -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

@ -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);
});
Loading…
Cancel
Save