A Discord bot that sends random library-themed GIFs using the Tenor API!
- Responds to
!librarygifcommand - Fetches random library-themed GIFs from Tenor
- Easy to set up and configure
- Node.js (v16 or higher)
- A Discord Bot Token
- (Optional) A Tenor API Key
- Clone the repository
git clone https://github.com/greedygretta/GrettasBots.git
cd GrettasBots- Install dependencies
npm install- Set up environment variables
# Copy the example environment file
copy .env.example .envEdit .env and add your tokens:
DISCORD_TOKEN=your_discord_bot_token_here
TENOR_API_KEY=your_tenor_api_key_here # Optional- Start the bot
npm start- Go to Discord Developer Portal
- Click "New Application" and give it a name
- Go to the "Bot" tab and click "Add Bot"
- Copy the bot token and add it to your
.envfile - Under "Privileged Gateway Intents", enable:
- MESSAGE CONTENT INTENT
- Save changes
- Go to Discord Developer Portal
- Select your application
- Go to "OAuth2" → "URL Generator"
- Select the following scopes:
botapplications.commands
- Select bot permissions:
- Send Messages
- Embed Links
- Attach Files
- Read Message History
- Copy the generated URL and open it in your browser
- Select your server and authorize the bot
Once the bot is in your server and running, you can use:
!librarygif
The bot will respond with a random library-themed GIF.
- Go to Tenor's API Dashboard
- Sign in or create an account
- Create a new API key
- Add the key to your
.envfile asTENOR_API_KEY
- Ensure the bot is online (should show green dot in Discord)
- Check that MESSAGE CONTENT INTENT is enabled in Discord Developer Portal
- Verify the bot has correct permissions in your server
- If using Tenor: Check your API key is correct in
.env - Ensure the bot has "Embed Links" permission
- Check the console output for any error messages
- Check your
DISCORD_TOKENis correct - Ensure your Node.js version is up to date
- Look for any error messages in the console
├── src/
│ ├── commands/ # Command handlers
│ ├── lib/ # Core functionality
│ └── utils/ # Utility functions
├── tests/ # Test files
├── .env.example # Example environment variables
├── .gitignore # Git ignore rules
└── package.json # Project dependencies
npm test- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT
Open an issue on GitHub for support requests.
Remember to never share your Discord bot token or Tenor API key publicly!