Skip to content

Discord Rich Presence for Genshin Impact (aka. Anime Game)

License

Notifications You must be signed in to change notification settings

Artprozew/GenshinRichPresence

Repository files navigation

GenshinRichPresence

GitHub top language pypresence GitHub branch check runs Downloads Release

Check it out on GameBanana:

Overview

Show your friends on Discord what you're up to in Genshin Impact!

This is a Discord Rich Presence program for Genshin Impact that works by analyzing GIMI's log file in real-time to determine the current game status, updating your Discord game activity accordingly.

image image

Why do it this way?

You're right, accessing game information through GIMI's log file might not be the most elegant solution. Ideally, the game would directly share your activity with Discord. But this method is currently one of the few ways to get in-game information like this without changing the game files itself. Additionally, this method doesn't use OCR (Optical Character Recognition) at all, which makes it potentially even more performant.

Is it safe?

Yes, this program is considered safe. It just reads a log file generated by GIMI, and does not modify any game files, so there's no risk of harming your game or your computer.

Features

  • Automatically displays your current character, region or other info
  • Doesn't modify your game files and does not use OCR
  • Fully customizable Rich Presence through the config.ini file, custom gifs are also allowed
  • Can start GIMI and Genshin Impact automatically when you launch the program's executable
  • Program stays hidden on your system tray, and when you close your game, the program will also close itself
  • Can now be installed easily through the installer!

Running the Executable

The pre-built executable is a convenient option for users who want to avoid installing Python. However, anti-virus might flag the .exe incorrectly as a "virus", you can check the anti-virus disclaimer.

Prerequisites

  • Download the setup/installer from Releases.
  • Have GIMI set-up.

Instructions

  • Run the installer, it will guide you.
  • Run the GenshinRichPresence.exe
  • Your activity must now be visible on your Discord profile, have fun!

Read Considerations for more info.

Running from Source Code

This method is suitable for users familiar with Python or encountering issues with the executable.

Prerequisites

Installation

Tip

(Optional) For Poetry: If you want to install the developer dependencies, you can append --group=dev to the poetry install command.

  1. Download and extract the repository (or just clone it).
  2. Open the project folder, right click on a blank space and click "open Command Prompt/Terminal".
  3. Install dependencies using the command for either pip (python -m pip install -r requirements.txt) or Poetry (poetry install).

Instructions

See above Instructions, for step 2 you can instead:

  • Open a command prompt on the project root directory and run the command pythonw src/main.py. You could also save a .bat file with that command if you want.
  • Alternatively, you can run the main.py file inside the src folder by double-clicking, but it will also bring up the unwanted command prompt, rename the main.py to main.pyw if you don't want that to happen.

Considerations

If you install and launch the program while your game is still running, press F10 to reload it.
Make sure the game is running with 3DMigoto.

For now, the program also creates a "RichPresenceData" folder inside your GIMI's Mods folder when you launch it. This is required for it to work.

You can always install the program on the same folder, if you would want to update it, for example. The settings at your config.ini are going to be preserved and applied when you run the program.

If you play on the Chinese servers, your game executable must be named YuanShen.exe, in this case, run the installer in the Chinese language.

If you want to customize or change something, read and edit the config.ini file, and then restart the program.

This program is not fully tested yet and may have some problems. Any feedback is appreciated.

When the program starts, it will stay hidden on your system tray, and will wait your game to open within 60 seconds, if it doesn't find it or if you close your game, the program will also close itself.

If any error occurs, the program may exit by itself, and will write the error on the traceback.txt file.

Known issues

Although still under development, this method is not perfect and may have limitations. But keep in mind that it does work as expected most of the time. Some of the issues described here may be fixed or worked around in the future. The problems observed are:

  • When you start the game, it might not detect your current character/region until you switch your character or walk/teleport to another place.
  • Occasionally, especially during teleports, the program might display an incorrect character. This issue can also be fixed when you switch characters. (#17)
  • When there's more than one playable character on screen, the program can also struggle to detect your character correctly (e.g.: Multiplayer or cutscenes).
  • Due to the program relying on analyzing hashes, some information might be incorrect at times. These hashes may be wrong or outdated. (#27)

Disclaimer

GenshinRichPresence is an unofficial third-party application and is not affiliated with HoYoverse in any way. It is developed and maintained independently.

Anti-Virus Disclaimer

Some anti-virus software (Windows Defender or similar) might flag the executable as a potential threat due to overly cautious heuristics. This is a known issue called "false positive", especially considering the program is built from Python code.

Python is a widely used and well-established programming language known for its security. However, anti-virus software might sometimes misinterpret the behavior of programs created with Python. See: Windows Defender false positives

If you're confident the program is safe, you can add an exclusion for the program's executable file in your anti-virus software settings. This will prevent it from being flagged in the future.

We assure you that the program is entirely safe and does not contain any malicious code. If you encounter any issues running the program from the downloaded executable file, you can try running from source code

Contributing

There's still a lot to do, if you want to contribute, fork the repo, submit pull requests, or share any bug fixes or feature ideas you have, you're much welcome!

Licensing

This project is licensed under MIT license; Refer to: LICENSE

Credits

  • Region data/hashes extracted from golanah921's Region.ini
  • Temporary app icon image (used as a placeholder icon) by @KisekiHikari on Twitter