From 8e5fcb4be99dd628a993ab818b9dbc8e3a7bbe09 Mon Sep 17 00:00:00 2001 From: Francisco Pessano Date: Fri, 11 Nov 2022 22:27:09 -0300 Subject: [PATCH] initial commit --- .eslintrc.json | 55 +++++++++++++++++++++++++++++++++++++++++++ .gitignore | 3 +++ .nvmrc | 1 + .vscode/settings.json | 4 ++++ app.js | 12 ++++++++++ package.json | 20 ++++++++++++++++ 6 files changed, 95 insertions(+) create mode 100644 .eslintrc.json create mode 100644 .gitignore create mode 100644 .nvmrc create mode 100644 .vscode/settings.json create mode 100644 app.js create mode 100644 package.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..cf73116 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,55 @@ +{ + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true + }, + "parserOptions": { + "ecmaVersion": 2021 + }, + "rules": { + "arrow-spacing": ["warn", { "before": true, "after": true }], + "brace-style": ["error", "stroustrup", { "allowSingleLine": true }], + "comma-dangle": ["error", "always-multiline"], + "comma-spacing": "error", + "comma-style": "error", + "curly": ["error", "multi-line", "consistent"], + "dot-location": ["error", "property"], + "handle-callback-err": "off", + "indent": ["error", "tab"], + "keyword-spacing": "error", + "max-nested-callbacks": ["error", { "max": 4 }], + "max-statements-per-line": ["error", { "max": 2 }], + "no-console": "off", + "no-empty-function": "error", + "no-floating-decimal": "error", + "no-inline-comments": "error", + "no-lonely-if": "error", + "no-multi-spaces": "error", + "no-multiple-empty-lines": [ + "error", + { "max": 2, "maxEOF": 1, "maxBOF": 0 } + ], + "no-shadow": ["error", { "allow": ["err", "resolve", "reject"] }], + "no-trailing-spaces": ["error"], + "no-var": "error", + "object-curly-spacing": ["error", "always"], + "prefer-const": "error", + "quotes": ["error", "single"], + "semi": ["error", "always"], + "space-before-blocks": "error", + "space-before-function-paren": [ + "error", + { + "anonymous": "never", + "named": "never", + "asyncArrow": "always" + } + ], + "space-in-parens": "error", + "space-infix-ops": "error", + "space-unary-ops": "error", + "spaced-comment": "error", + "yoda": "error" + } +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aba5c70 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules +yarn.lock +.env \ No newline at end of file diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..95c758c --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v18.12.1 \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c1aa157 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "editor.defaultFormatter": "dbaeumer.vscode-eslint", + "editor.formatOnSave": true +} diff --git a/app.js b/app.js new file mode 100644 index 0000000..117af43 --- /dev/null +++ b/app.js @@ -0,0 +1,12 @@ +const { GatewayIntentBits } = require('discord.js'); +const Discord = require('discord.js'); +require('dotenv').config(); + +const client = new Discord.Client({ intents: [GatewayIntentBits.Guilds] }); + +client.on('ready', () => { + console.log('working'); + console.log(client.user); +}); + +client.login(process.env.BOT_TOKEN); \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..9ccd6ea --- /dev/null +++ b/package.json @@ -0,0 +1,20 @@ +{ + "scripts": { + "start": "node app.js", + "dev": "nodemon app.js" + }, + "dependencies": { + "discord.js": "^14.6.0", + "dotenv": "^16.0.3" + }, + "name": "shopping-discord-bot", + "version": "1.0.0", + "main": "app.js", + "repository": "https://github.com/FranP-code/shopping-discord-bot", + "author": "Francisco Pessano ", + "license": "MIT", + "devDependencies": { + "eslint": "^8.27.0", + "nodemon": "^2.0.20" + } +}