From 7e067fc7762e9b827283dbca9ebaa95c1f0543d1 Mon Sep 17 00:00:00 2001 From: UltraLion <49597041+UltraLionfr@users.noreply.github.com> Date: Sat, 5 Nov 2022 23:03:54 +0100 Subject: [PATCH] Add files via upload --- .env | 1 + README.md | 17 ++++++++++++-- config.json | 29 ++++++++++++++++++++++++ index.js | 14 ++++++++++++ package.json | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 121 insertions(+), 2 deletions(-) create mode 100644 .env create mode 100644 config.json create mode 100644 index.js create mode 100644 package.json diff --git a/.env b/.env new file mode 100644 index 0000000..593ff17 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +TOKEN = token_discord \ No newline at end of file diff --git a/README.md b/README.md index bd2b039..09734ea 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,15 @@ -# discord-forum-automessage -this bot allows to send automatic messages when creating a post in a discord forum +# Discord bot for jessydavid49 + +## Features + +- [ ] Send a message when a user creates a new forum post +- [ ] Configurable Message +- [x] Userinfo command + +## SETUP + +1. First, type `npm install` in your console. +2. You need to make .env file. This process is very important and this file will serve to store the bot's tokens. Type this in your .env file `TOKEN = token` +**YOU NEED TO CHANGE token TO YOUR BOT'S TOKEN.** +3. Change the message in config.json file. +4. Type `node .` or `node index.js` in your console. diff --git a/config.json b/config.json new file mode 100644 index 0000000..44536e7 --- /dev/null +++ b/config.json @@ -0,0 +1,29 @@ +{ + "default": "test", + "forumPostChannelId": [ + "id_forum_n1", + "id_forum_n2" + ], + "forumPostMessage": [ + "message_forum_n1", + "message_forum_n2" + ], + "forumPostTitle": [ + "Title_Embed_post_n1", + "Title_Embed_post_n2" + ], + "forumPostButtons": { + "id_forum_n1": [ + { + "label": "Google", + "url": "https://google.fr" + } + ], + "id_forum_n2": [ + { + "label": "Google", + "url": "https://pastebin.com" + } + ] + } +} \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000..866b49c --- /dev/null +++ b/index.js @@ -0,0 +1,14 @@ +require("dotenv").config(); +const { Client, Collection } = require("discord.js"); + +const client = new Client({ intents: 32767 }); +module.exports = client; + +// Global Variables +client.commands = new Collection(); +client.slashCommands = new Collection(); + +// Initializing the project +require("./handler")(client); + +client.login(process.env.TOKEN); diff --git a/package.json b/package.json new file mode 100644 index 0000000..3a43bac --- /dev/null +++ b/package.json @@ -0,0 +1,62 @@ +{ + "name": "discord-forum-automessage", + "version": "1.0.0", + "description": "this bot allows to send automatic messages when creating a post in a discord forum", + "main": "index.js", + "dependencies": { + "balanced-match": "^1.0.2", + "brace-expansion": "^1.1.11", + "concat-map": "^0.0.1", + "common-tags": "^1.8.2", + "busboy": "^1.6.0", + "discord.js": "^14.6.0", + "fast-deep-equal": "^3.1.3", + "discord-api-types": "^0.37.16", + "fs.realpath": "^1.0.0", + "dotenv": "^16.0.3", + "file-type": "^18.0.0", + "glob": "^7.2.3", + "ieee754": "^1.2.1", + "lodash.snakecase": "^4.1.1", + "inflight": "^1.0.6", + "inherits": "^2.0.4", + "minimatch": "^3.1.2", + "once": "^1.4.0", + "lodash.uniqwith": "^4.5.0", + "peek-readable": "^5.0.0", + "path-is-absolute": "^1.0.1", + "readable-stream": "^3.6.0", + "readable-web-to-node-stream": "^3.0.2", + "safe-buffer": "^5.2.1", + "streamsearch": "^1.1.0", + "string_decoder": "^1.3.0", + "strtok3": "^7.0.0", + "ts-mixer": "^6.0.1", + "token-types": "^5.0.1", + "tslib": "^2.4.1", + "undici": "^5.12.0", + "util-deprecate": "^1.0.2", + "wrappy": "^1.0.2", + "ws": "^8.10.0" + }, + "devDependencies": {}, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/UltraLionfr/discord-forum-automessage.git" + }, + "keywords": [ + "forum", + "discord", + "post", + "automessage" + ], + "author": "https://github.com/UltraLionfr", + "license": "ISC", + "bugs": { + "url": "https://github.com/UltraLionfr/discord-forum-automessage/issues" + }, + "homepage": "https://github.com/UltraLionfr/discord-forum-automessage#readme" +}