Giter VIP home page Giter VIP logo

discord-sql-bot's Introduction

Discord SQL Bot for Dragonite

This bot periodically checks Dragonite's database for accounts without a refresh token and sends a notification to a specific Discord channel.

Requirements

  • Discord bot configured and added to your discord server with creating messages permissions
  • Node.js 18 or higher
  • PM2 (Process Manager for Node.js applications)

Installation

  1. Clone the repository:

    git clone https://github.com/LucianoNeo/discord-sql-bot.git
    
  2. Navigate to the project directory:

     cd discord-sql-bot
    
  3. Install dependencies:

    npm install
    
  4. Set up environment variables:

    cp .env.example .env
  • Modify the following environment variables to the .env file:
    DB_HOST=your_mysql_host
    DB_USER=your_mysql_user
    DB_PASSWORD=your_mysql_password
    DB_NAME=your_mysql_database
    DB_PORT=your_mysql_port
    DISCORD_TOKEN=your_discord_bot_token
    CHANNEL_ID=your_discord_channel_id
    CHECK_INTERVAL=15
    
    Replace your_mysql_host, your_mysql_user, your_mysql_password, your_mysql_database, your_mysql_port, your_discord_bot_token, and your_discord_channel_id with your actual MySQL database and Discord bot information. CHECK_INTERVAL is the interval in minutes for the bot to perform the database check.

Usage

Node

You can start the bot using npm start:

npm start

This will execute the script specified in the start field of the package.json file, which is node account-checker.js.

After starting the bot with npm start, it will run in the foreground. To stop it, you'll need to terminate the process manually, for example, by pressing Ctrl + C in the terminal where the bot is running.

PM2

Alternatively, you can also start the bot with PM2, run:

pm2 start account-checker.js --name account-checker

To stop the bot, you can use:

pm2 stop account-checker

And to restart it, you can use:

pm2 restart account-checker

You can check the status of your bot using:

pm2 status

Additionally, you can monitor your bot's logs using:

pm2 logs account-checker

License

This project is licensed under the MIT License

discord-sql-bot's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.