aboutsummaryrefslogtreecommitdiff
path: root/DISCORD_TEST_README.md
blob: e38fb70ac37361b6fefe9be07546c85f6af06a8d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Discord Embed Test Script

This script allows you to test the Discord embed functionality without running the full bot.

## Setup

1. **Configure your `.env` file** with Discord webhook settings:

   ```env
   DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/your_webhook_url_here
   DISCORD_LOG_CHANNEL_ID=1419186821509939300
   ```

2. **Install dependencies** (if not already installed):
   ```bash
   pip install -r requirements.txt
   ```

## Usage

Run the test script:

```bash
python test_discord_embed.py
```

Or make it executable and run directly:

```bash
chmod +x test_discord_embed.py
./test_discord_embed.py
```

## What it tests

The script will send 4 test embeds to your Discord channel:

1. **🟢 Reflair Action**: Tests the green embed for reflair actions
2. **🔴 Removal Action**: Tests the red embed for removal actions
3. **🔴 Long Reason Truncation**: Tests how long reasons are handled (truncated to 100 chars + "...")
4. **🔵 Custom Embed**: Tests a custom blue embed with various fields

## Expected Output

If successful, you should see:

- ✅ Success messages in the terminal
- 4 embed messages in your Discord channel
- Color-coded embeds (green, red, blue)
- Proper formatting with emojis and fields
- Long reason truncation demonstration

## Troubleshooting

- **"DISCORD_WEBHOOK_URL not found"**: Make sure your `.env` file has the webhook URL
- **"Failed to send embed"**: Check that your webhook URL is valid and the bot has permission to send messages
- **Import errors**: Make sure you're running from the project root directory