1.0.6 • Published 10 months ago

evecordjs v1.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

EvecordJS

EvecordJS is a JavaScript library for creating easily configurable Discord bots. This bot has the ability to automatically reply to specific messages.

Features

  • Easy setup
  • Flexible configuration of message triggers and responses
  • Persistence of reactions using JSON files

Requirements

  • Node.js (version 12.0.0 or higher)
  • npm (comes with Node.js)
  • Discord account and bot token

Installation

  1. Clone or download this repository.
  2. Navigate to the project folder and run the following command to install the necessary dependencies:

    npm install discord.js

Usage

  1. Create a .env file in the root directory of your project and add the following content:

    TOKEN=YourDiscordBotToken
  2. Initialize and start the bot with code like this:

    const EvecordJS = require("./EvecordJS");
    
    const bot = new EvecordJS();
    bot.start();
  3. To start the bot, run the following command:

    node your_bot_file.js

Detailed Feature Explanation

Setting Up Message Reactions

You can set up reactions to specific messages using the registerReaction method:

bot.registerReaction("hello", "Nice to meet you!");

This will make the bot automatically reply "Nice to meet you!" when someone posts "hello" in the chat.

Saving and Loading Reactions

  • Configured reactions are automatically saved to a reactions.json file.
  • When the bot restarts, it loads the reactions from this file.

Error Handling

  • The bot properly handles issues such as login failures or message sending errors, displaying error messages in the console.

Important Notes

  • This bot uses GatewayIntentBits.MessageContent, so you need to enable the Message Content Intent in the Discord Developer Portal.
  • Always manage your bot token securely and be careful not to upload it to public repositories.

Troubleshooting

  1. If the bot doesn't come online:

    • Check that the .env file is correctly set up.
    • Verify that the bot token is correct in the Discord Developer Portal.
  2. If the bot doesn't react:

    • Check the console logs for error messages.
    • Verify that the reactions.json file is being generated correctly.

Customization

While this code provides basic functionality, you can extend the EvecordJS class to add more features if desired. For example, you could add command handling, database integration, webhooks, and more.

Support

If you encounter any issues or need further clarification, please post your questions in the Issues section of this repository.(https://github.com/Emon2358/evecordjs)

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago