A Discord bot that automatically fetches and sends redemption codes for HoYoverse games like Genshin Impact, Honkai: Star Rail, and Zenless Zone Zero. This bot allows users to receive the latest game codes directly in their Discord servers. Invite the bot here,Bot website not dashboard
- Automatic Code Detection: Checks for new redemption codes every 5 minutes.
- Manual Code Listing: Use
/listcodes
command to view all active codes for a specific game. - Code Redemption Links: Provides direct links to redeem codes on the official websites.
- Role-based Notifications: Mentions specific roles when new codes are available.
- Customizable Setup: Configure notification channels and roles per server.
- Admin Controls: Toggle auto-send feature and manually send codes.
- Error Handling: Improved error handling for API calls and interactions.
/setup
- Configure notification channels and roles (Admin only)./listcodes
- List all active codes for a selected game./redeem
- Manually send redemption codes with custom messages (Admin only)./toggleautosend
- Enable or disable automatic code notifications (Admin only).
- Node.js (version 16.9.0 or higher)
- npm
- Discord Bot Token
- MongoDB Database
- Clone the repository:
git clone https://github.com/yourusername/hoyoverse-code-bot.git
cd hoyoverse-code-bot
- Install dependencies:
npm install
- Configure environment variables: Create a .env file in the root directory and add the following:
DISCORD_TOKEN=your_discord_bot_token
MONGODB_URI=your_mongodb_connection_string
CLIENT_ID=your_discord_client_id
Replace your_discord_bot_token, your_mongodb_connection_string, and your_discord_client_id with your actual credentials. 4. Run the bot:
node index.js
Use the /setup
command to configure the notification roles and channels:
Options:
genshin_role
- Role to mention for Genshin Impact codes.hsr_role
- Role to mention for Honkai: Star Rail codes.zzz_role
- Role to mention for Zenless Zone Zero codes.channel
- Channel where the codes will be sent.
- Add language file and command changer
- Add translate dictionary to full translate the api to some language (35% complete)
Options:
game
- Select the game (genshin
,hsr
, orzzz
).
- Game selection
- Up to three codes
- An optional message Redeeming Codes
Admins can enable or disable the automatic code sending feature using the /toggleautosend
command:
Options:
status
- Chooseenable
ordisable
.
- Try-catch blocks around API calls.
- User-friendly error messages.
- Logging of errors for debugging purposes.
Uses the HoYo Codes API to fetch the latest redemption codes for:
- Genshin Impact
- Honkai: Star Rail
- Zenless Zone Zero
Contributions are welcome! Please open an issue or submit a pull request.
This project is for educational purposes. All game names and related content belong to HoYoverse.