A fun Nerimity bot that generates meme images by adding a gun emoji over user avatars. Built with the official @nerimity/nerimity.js SDK.
/gun [@:user]command to generate gun memes instantly- Fetches user avatars from Nerimity CDN
- Composites a gun image over avatars using Sharp
- Uploads to Catbox for easy sharing
- Fast and responsive
- Built-in error handling
- Node.js (v16 or higher recommended)
- A Nerimity bot token (Get one here)
- npm or yarn package manager
- Clone the repository:
git clone https://github.com/JoddabodScripts/Gun-bot-nerimity.git
cd Gun-bot-nerimity- Install dependencies:
npm install- Configure your bot:
Create a .env file in the root directory:
NERIMITY_TOKEN=your_nerimity_bot_token_hereYou can also copy from the example:
cp .env.example .env- Run the bot:
npm startOr in development mode with auto-restart:
npm run devOnce the bot is running and online, you can use it in any Nerimity server where it's been added:
/gun [@:userid] - Generate a gun meme with a user's avatar
Example:
/gun [@:435634564563456]
What happens:
- Bot fetches the mentioned user's avatar
- Resizes avatar to 300x300px
- Overlays a 256x256px gun image in the bottom-right corner
- Uploads the result to Catbox
- Replies with the shareable image URL
User: /gun [@:123456789]
Bot: https://files.catbox.moe/abc123.png
nerimity-gun-bot/
├── index.js # Main bot logic and command handler
├── create-gun.js # Gun image generator utility
├── gun.png # Gun overlay image
├── package.json # Project dependencies and scripts
├── .env # Environment configuration (not in repo)
├── .env.example # Example environment file
├── README.md # This file
├── LICENSE # MIT License
└── CONTRIBUTING.md # Contribution guidelines
| Variable | Required | Description |
|---|---|---|
NERIMITY_TOKEN |
Yes | Your Nerimity bot authentication token |
- @nerimity/nerimity.js (^1.0.0) - Official Nerimity bot SDK
- sharp (^0.33.5) - High-performance image processing
- axios (^1.15.2) - HTTP client for Catbox uploads
- form-data (^4.0.5) - Multipart form data handling
- dotenv (^16.4.5) - Environment variable management
Want to contribute? Check out our Contributing Guide!
# Install dependencies
npm install
# Run in development mode (with auto-restart)
npm run dev
# Run in production mode
npm startThe bot handles various error cases gracefully:
- User not found - Returns "User not found" message
- No avatar - Returns "No avatar" if the user hasn't set an avatar
- Upload failures - Catches and reports upload errors
- Image processing errors - Handles Sharp processing errors
- Verify your
NERIMITY_TOKENis correct in.env - Check that the bot is online in your Nerimity server
- Ensure the bot has permission to read messages and send responses
- Verify you're using the correct user ID format:
[@:userid] - Make sure the user exists in the server
- Ensure Sharp is properly installed:
npm install sharp - Check that
gun.pngexists in the project root - Verify the user's avatar URL is accessible
- Update Node.js to v16 or higher
- Clear npm cache:
npm cache clean --force - Delete
node_modulesandpackage-lock.json, then reinstall
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Nerimity.js
- Image processing powered by Sharp
- Image hosting via Catbox
Contributions, issues, and feature requests are welcome!
See CONTRIBUTING.md for how to get started.
If you have questions or need help:
- Open an issue on GitHub
- Check existing issues for solutions
Made with ❤️ for the Nerimity community