Initial commit: Miku Discord Bot

This commit is contained in:
2025-12-07 17:15:09 +02:00
commit 8c74ad5260
206 changed files with 50125 additions and 0 deletions

78
REACTION_FEATURE.md Normal file
View File

@@ -0,0 +1,78 @@
# Message Reaction Feature
## Overview
This feature allows you to make Miku react to any message in Discord with a specific emoji of your choice through the Web UI.
## How to Use
### From the Web UI
1. **Navigate to the Actions Tab**
- Open the Miku Control Panel (http://your-server:3939)
- Click on the "Actions" tab
2. **Find the "Add Reaction to Message" Section**
- Scroll down to find the "😊 Add Reaction to Message" section
3. **Fill in the Required Information**
- **Message ID**: Right-click on the target message in Discord → "Copy ID"
- **Channel ID**: Right-click on the channel name → "Copy ID"
- **Emoji**: Enter the emoji you want Miku to react with (e.g., 💙, 👍, 🎉)
4. **Click "Add Reaction"**
- Miku will add the specified reaction to the message
- You'll see a success confirmation message
### Requirements
- **Discord Developer Mode**: You need to enable Developer Mode in Discord to copy message and channel IDs
- Settings → Advanced → Developer Mode (toggle ON)
### Supported Emoji Types
- **Standard Unicode Emoji**: 💙, 👍, 🎉, ❤️, etc.
- **Custom Server Emoji**: Use the format `:emoji_name:` for custom Discord emojis
### API Endpoint
If you want to integrate this programmatically:
```bash
POST /messages/react
Content-Type: multipart/form-data
message_id: <Discord message ID>
channel_id: <Discord channel ID>
emoji: <emoji string>
```
### Example Response
Success:
```json
{
"status": "ok",
"message": "Reaction 💙 queued for message 123456789"
}
```
Error:
```json
{
"status": "error",
"message": "Channel 123456789 not found"
}
```
## Troubleshooting
- **"Channel not found"**: Make sure Miku is in the server that contains that channel
- **"Message not found"**: Verify the message ID is correct and still exists
- **"Permission denied"**: Miku needs the "Add Reactions" permission in that channel
- **Invalid emoji**: Make sure you're using a valid emoji format
## Technical Details
- The reaction is added asynchronously by the Discord bot
- The Web UI receives immediate confirmation that the request was queued
- If the reaction fails (e.g., due to permissions), an error will be logged in the bot logs