Skip to content

Genshin Discord Bot to access in-game data in realtime, claim daily check-in rewards, redeem codes, view builds etc.

Notifications You must be signed in to change notification settings

Lucifer7535/genshin-discord-bot

Repository files navigation

GENSHIN DISCORD BOT

Invite the Bot to your own server

Badge

Join Support Server

What does this bot do?

This bot can be used to check various information from Genshin Impact, Honkai Impact 3rd & Honkai Star Rail directly in Discord channels, including:

  • Query realtime in-game data

    • Genshin Impact:
      Includes Resin, Realm Currency, Parametric Transformer, Expedition completion time, etc.

    • Star Rail:
      Includes Exploration Power, Commission Execution.

  • Daily automatic check-in for Hoyolab (includes check-ins for Genshin Impact, Honkai Impact 3rd, Star Rail & Tears of Themis).

  • Automatic checks for real-time expeditions (Genshin Impact, Star Rail), Resins, Realm Currency, Parametric Transformer, and Expedition completion. Sends reminders when they are close to being full/complete.

  • Check Spiral Abyss records, Forgotten hall records & Pure fiction records.

  • Check Traveler's Notes

  • Personal record card (days active, achievements, Anemoculi/Geoculi, world exploration progress, etc.)

  • Display the character showcase for any player in Genshin Impact/Star Rail, showing the builds of the showcased characters.

  • View in-game announcements for Genshin Impact, including events and gacha information.

  • Use the new slash commands with auto-suggest features. No need to memorize command usage.

Project Folder Structure

genshin-discord-bot
├── assets           = Folder for storing assets
|   ├── font         = Fonts used for drawing
|   └── image        = Images and background images used for drawing
├── cogs             = Discord.py cog folder, containing all bot commands
├── cogs_external    = Custom Discord.py cog folder,add your commands.
├── configs          = Bot's Configuration file folder
├── database         = SQLAlchemy ORM, database operation-related code
|   ├── dataclass    = Custom data classes
|   └── legacy       = Old database code used for data migration
├── enka_network     = Code related to Enka Network API
|   └── enka_card    = Submodule, code related to drawing Enka images
├── genshin_db       = Code related to genshin-db API
|   └── models       =  Pydantic models for genshin-db data
├── genshin_py       = Code related to genshin.py
|   ├── auto_task    = Code for automatic scheduled tasks(daily check-in)
|   ├── client       = Code for making requests to APIs
|   └── parser       = Code for converting API data into Discord embeds.
├── star_rail        = Code for Star Rail showcase
└── utility          = Code for utility functions used in this project.

How to Setup the Bot?

Web Browser

You need to obtain the following in this step:

  1. Bot Application ID
  2. Bot Token
  3. Your Discord server ID
>>> Click to see the complete content <<<
  1. Go to Discord Developer Portal and log in with your Discord account.

  2. Click "New Application" to create an application. Enter the desired name and click "Create."

  3. On the Bot page, click "Add Bot" to add a bot.

  4. In OAuth2/URL Generator, check "bot," "applications.commands," and "Send Messages." The URL generated at the bottom is the invitation link for the bot. Open the link to invite the bot to your server.

Getting values of bot_token, application_id & test_server_id for config file.

  1. On the General Information page, get the Application ID of the bot.

  2. On the Bot page, click "Reset Token" to get the Bot Token.

  3. Right-click on your Discord server name or icon, copy the server ID (enable Developer Mode in Settings -> Advanced -> Developer Mode).

Locally

  • For Windows/Linux :
    1. Install Git & Python Version == 3.10.

    2. clone this repository using:

    git clone https://github.com/Lucifer7535/genshin-discord-bot.git
    
    1. Install pipenv to install required packages.
    pip install pipenv
    
    1. Open command prompt inside the cloned genshin-discord-bot folder. It should look like D:\Genshin-Discord-Bot>, install the packages using
    pipenv install
    
    1. Use pipenv shell in the project folder path to run the virtual environment, after the packages are succesfully installed.

    2. It would look like this (Genshin-Discord-Bot-4wfjLgXf) D:\Node\genshin-discord-bot> where (Genshin-Discord-Bot-4wfjLgXf) will be your environment name.

    3. Open the Utility\config.py file in a text editor. Fill in the Application ID, Server ID, and Bot Token obtained from the web browser. Save the file. Example:

      • application_id: int = 1234567
      • test_server_id: int = 1234567
      • bot_token: str = "abcd12345"
    4. Run the bot using

    python main.py
    
  • Using Docker (Windows/Linux): [Recommended]
    1. Install Docker

    2. Create a new folder where you want to setup the bot. for e.g. create a new folder named Genshin-Discord-Bot.

    3. Download the docker-compose.yml file and place it in that folder you just created.

    4. Open the docker-compose.yml file in a text editor. Fill in the Application ID, Server ID, and Bot Token obtained from the Web Browser. Save the file. Example:

      • application_id: int = 1234567
      • test_server_id: int = 1234567
      • bot_token: str = "abcd12345"
    5. Open Command Prompt/Powershell/Terminal in this folder and enter the following command to run it. Make sure your Docker Desktop is running.

    docker-compose up
    
  • For Android (termux):
    1. Install Termux Monet based on your device's architecture.

    2. Open the app and run these commands one by one after successfull execution of one after another.

    pkg update & pkg upgrade
    
    pkg install git
    
    pkg install tur-repo
    
    pkg install python-is-python3.10/tur-packages
    
    pkg install libjpeg-turbo libpng libzmq freetype
    
    pip install greenlet
    
    1. clone this repository using:
    git clone https://github.com/Lucifer7535/genshin-discord-bot.git
    
    1. Install pipenv to install required packages.
    pip install pipenv
    
    1. Open the folder using cd genshin-discord-bot and run
    pipenv install
    
    1. Use pipenv shell in the project folder path to run the virtual environment, after the packages are succesfully installed.

    2. It would look like this (Genshin-Discord-Bot-4wfjLgXf)~genshin-discord-bot> where (Genshin-Discord-Bot-4wfjLgXf) will be your environment name.

    3. Open the Utility\config.py file using nano. Use command ```nano utility/config.py

    4. Fill in the Application ID, Server ID, and Bot Token obtained from the web browser. Save the file. Example:

      • application_id: int = 1234567
      • test_server_id: int = 1234567
      • bot_token: str = "abcd12345"
    5. Upgrade the pillow package from version 9.5.0 due to some errors in android linux based OS.

    pip install --upgrade pillow
    
    1. Run the bot using
    python main.py
    

Notes to be Considered:

Note 1:
When the bot is running, and you see【System】on_ready: You have logged in as XXXXX, it means the parameters are set correctly, and the bot has started successfully. The bot will automatically sync all commands to your test server, known as "local sync."

Note 2:
If you can't see commands after typing /, try refreshing with CTRL + R or completely close and restart Discord.

Note 3:
To use the bot in multiple servers, type $jsk sync in the bot's DM and wait a few minutes for Discord to push the commands. This is known as "global sync."

Additionally, the bot includes the jsk command to load/reload modules, sync commands, execute code, etc. Refer to the jishaku documentation for more information.

To use jsk commands:

Use them in the bot's DM, for example: $jsk ping.
Tag the bot in a regular channel, for example: @bot_username jsk ping.

SCREENSHOTS:

>>> Click to view screenshots <<<
  1. Bot's Slash Commands


  1. /showcase-characters


  1. /abyss-record


  1. /characters-list


  1. /diary_notes


  1. /game-notices


  1. /instant-notes


  1. /record-card(data overview)


  1. /record-card(world exploration)


  1. /schedule command


  1. daily check-in


  1. scheduled reminders

Acknowledgments

SOURCE CODE:

API:

Card:

Misc:

About

Genshin Discord Bot to access in-game data in realtime, claim daily check-in rewards, redeem codes, view builds etc.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages