Skip to content

A Wordle-inspired game for Discord that lets you challenge your friends to word puzzles. Features include a letter tracker, persistent user stats, and both overall and monthly leaderboards. Perfect for word game enthusiasts and Discord communities looking for a fun, interactive experience!

Notifications You must be signed in to change notification settings

junadizon/guessle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

51 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Guessle Discord Bot ๐ŸŽฏ

A Wordle-inspired Discord bot that brings the popular word-guessing game to your server! Players try to guess a 5-letter word within 6 attempts, with color-coded feedback for each guess.

Features ๐Ÿš€

Game Commands

  • /guessle - Start a new game
  • /guess <word> - Make a guess in your current game
  • /status - Check your current game status
  • /giveup - End your current game and reveal the word

Leaderboards ๐Ÿ“Š

  • /leaderboard - View the server's overall leaderboard
  • /monthly - View the current month's leaderboard
  • Tracks:
    • Words successfully guessed
    • Total games played
    • Win rate percentage

Game Mechanics ๐ŸŽฎ

  • 6 attempts to guess a 5-letter word
  • Color-coded feedback:
    • ๐ŸŸฉ Green: Correct letter in correct position
    • ๐ŸŸจ Yellow: Correct letter in wrong position
    • โฌ› Gray: Letter not in the word
  • Validates guesses against a dictionary
  • Custom emoji support for feedback

Setup ๐Ÿ› ๏ธ

  1. Clone the repository:
git clone https://github.com/yourusername/guessle.git
cd guessle
  1. Create a virtual environment and activate it:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Create a .env file with your Discord bot token:
DISCORD_TOKEN=your_bot_token_here
PORT=8080  # Optional: Change if needed
  1. Run the bot:
python bot.py

Requirements ๐Ÿ“‹

  • Python 3.8 or higher
  • discord.py >= 2.3.2
  • python-dotenv >= 1.0.0
  • aiohttp >= 3.9.1
  • pyspellchecker >= 0.7.2

Contributing ๐Ÿค

Contributions are welcome! Feel free to submit issues and pull requests.

License ๐Ÿ“„

This project is licensed under the MIT License - see the LICENSE file for details.

Support ๐Ÿ’ฌ

If you encounter any issues or have questions, please open an issue in the repository.


Made with โค๏ธ by friedeggyolkie (Discord) / junadizon (GitHub)

Guessle Discord Bot - AWS EC2 Deployment Guide for hosting

Table of Contents

1. Setting Up EC2 Instance

1.1 Launch Instance

  1. Go to AWS Console โ†’ EC2
  2. Click "Launch Instance"
  3. Configure instance:
    • Name: guessle-bot
    • AMI: Amazon Linux 2023
    • Instance type: t2.micro (free tier)
    • Key pair: Create new (save .pem file)
    • Network settings:
      • Allow SSH (port 22)
      • Allow HTTP (port 8080)
    • Storage: 8GB (free tier)

1.2 Security Group Setup

Create security group guessle-bot-sg with rules:

  • Inbound:
    • SSH (22): 0.0.0.0/0
    • HTTP (8080): 0.0.0.0/0
    • HTTPS (443): 0.0.0.0/0
  • Outbound:
    • All traffic: 0.0.0.0/0

2. Connecting to EC2

2.1 Local Machine Setup

  1. Save your .pem file securely
  2. Set correct permissions:
chmod 400 guessle-bot.pem

2.2 SSH Connection

ssh -i guessle-bot.pem ec2-user@YOUR_INSTANCE_PUBLIC_IP

3. Bot Deployment

3.1 System Setup

# Update system
sudo yum update -y

# Install required packages
sudo yum install python3 python3-pip git -y

3.2 Bot Installation

# Create and enter directory
mkdir guessle-bot
cd guessle-bot

# Clone repository
git clone YOUR_REPOSITORY_URL .

# Install dependencies
pip3 install -r requirements.txt

3.3 Environment Configuration

  1. Create .env file:
nano .env
  1. Add required variables:
DISCORD_TOKEN=your_discord_token_here
DATABASE_URL=your_database_url_here
PORT=8080
  1. Set permissions:
chmod 600 .env

3.4 Service Setup

  1. Create service file:
sudo nano /etc/systemd/system/guessle-bot.service
  1. Add service configuration:
[Unit]
Description=Guessle Discord Bot
After=network.target

[Service]
Type=simple
User=ec2-user
WorkingDirectory=/home/ec2-user/guessle-bot
ExecStart=/usr/bin/python3 bot.py
Restart=always
RestartSec=10
Environment=PYTHONUNBUFFERED=1

[Install]
WantedBy=multi-user.target
  1. Enable and start service:
sudo systemctl daemon-reload
sudo systemctl enable guessle-bot
sudo systemctl start guessle-bot

4. Monitoring and Maintenance

4.1 Check Bot Status

# Check service status
sudo systemctl status guessle-bot

# View logs
sudo journalctl -u guessle-bot -f

4.2 Common Commands

# Restart bot
sudo systemctl restart guessle-bot

# Stop bot
sudo systemctl stop guessle-bot

# Start bot
sudo systemctl start guessle-bot

4.3 Troubleshooting

  1. Check logs for errors:
sudo journalctl -u guessle-bot -n 50
  1. Verify environment variables:
cat .env
  1. Test web server:
curl http://localhost:8080/health

5. Security Best Practices

  1. Keep .pem file secure
  2. Regularly update system: sudo yum update -y
  3. Monitor AWS CloudWatch for instance metrics
  4. Set up AWS Budget alerts
  5. Use IAM roles instead of hardcoded credentials

6. Cost Optimization

  1. Use AWS Free Tier monitoring
  2. Set up auto-shutdown during inactive periods
  3. Monitor usage in AWS Billing Console
  4. Set up AWS Budget alerts

Common Issues and Solutions

Bot Not Starting

  1. Check environment variables:
cat .env
  1. Check logs:
sudo journalctl -u guessle-bot -f
  1. Verify Python installation:
python3 --version

Connection Issues

  1. Verify security group settings
  2. Check instance status in AWS Console
  3. Ensure .pem file permissions are correct
  4. Verify your IP is allowed in security group

Database Connection Issues

  1. Verify DATABASE_URL in .env
  2. Check database security settings
  3. Ensure database is accessible from EC2

Additional Resources

About

A Wordle-inspired game for Discord that lets you challenge your friends to word puzzles. Features include a letter tracker, persistent user stats, and both overall and monthly leaderboards. Perfect for word game enthusiasts and Discord communities looking for a fun, interactive experience!

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages