The purpose of this project is to create a Discord bot that allows users to create and manage proposals on a Discord server.
Project Benefits
This project helps in organizing and managing proposals within a Discord community, making it easier for users to submit, vote, and discuss proposals.
How the Project Works
The project uses Node.js to create a Discord bot that listens for specific commands to create and manage proposals. Users can interact with the bot to submit new proposals and vote on existing ones.
Repository and Installation
To install and use the project:
-
Clone the repository:
Terminal window git clone https://github.com/Fulldroper/discord.bot.propoziciicd discord.bot.propozicii -
Install dependencies and start the bot:
Terminal window npm installnpm start
Project Workflow
-
Setup Project: Initialize the project structure and dependencies.
Terminal window npm initnpm install -
Create Discord Bot: Set up the bot to connect to Discord and listen for proposal commands.
// env configurationprocess.env.NODE_ENV || await require('dotenv').config({ debug: false })// req discord frameworkconst { Client, GatewayIntentBits } = await require('discord.js');const importer = await require('fd-importer');// init discord bot && rest objconst bot = new Client({ intents: [GatewayIntentBits.Guilds,GatewayIntentBits.GuildMessages,GatewayIntentBits.MessageContent,GatewayIntentBits.GuildMembers,GatewayIntentBits.GuildIntegrations] });// set datebase collection namebot.collection = process.env.npm_package_name -
Implement Proposal Features: Add functionalities for creating and managing proposals.
// add event listenerslet temp = await importer('src/events/', {debug: process.env.DEBUG})for (const event in temp) {bot.on(event, temp[event])}// add custom methodstemp = await importer('src/methods/', {debug: process.env.DEBUG})for (const method in temp) {bot[method] = temp[method]}// clear datadelete temp// run botbot.login(process.env.TOKEN)
Skills Gained
- Developing Discord bots with Node.js
- Implementing proposal management features
- Managing and configuring bot settings for server interaction