-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathllms.txt
More file actions
147 lines (120 loc) · 4.88 KB
/
llms.txt
File metadata and controls
147 lines (120 loc) · 4.88 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# Holo Bridge
> A type-safe TypeScript bridge between websites and Discord bots
## Overview
Holo Bridge provides a REST API and WebSocket interface for full Discord bot capabilities. Built with TypeScript, Express, Socket.IO, and Discord.js.
## Key Features
- REST API for all Discord operations
- Real-time WebSocket event streaming via Socket.IO
- Type-safe with Zod validation
- Full Discord.js coverage
## API Endpoints
Base URL: `http://localhost:3000`
Authentication: `X-API-Key` header required
### Guilds
- GET /api/guilds - List all guilds
- GET /api/guilds/:id - Get guild details
- GET /api/guilds/:id/channels - Get guild channels
- GET /api/guilds/:id/roles - Get guild roles
- GET /api/guilds/:id/members - List members
- GET /api/guilds/:id/emojis - Get emojis
- GET /api/guilds/:id/bans - Get bans
- GET /api/guilds/:id/invites - Get invites
### Channels
- GET /api/channels/:id - Get channel
- POST /api/guilds/:guildId/channels - Create channel
- PATCH /api/channels/:id - Edit channel
- DELETE /api/channels/:id - Delete channel
- POST /api/channels/:id/threads - Create thread
- GET /api/channels/:id/threads - Get threads
- POST /api/channels/:id/clone - Clone channel
- GET /api/channels/:id/webhooks - Get webhooks
### Messages
- GET /api/channels/:id/messages - Get messages
- GET /api/channels/:id/messages/pinned - Get pinned messages
- GET /api/channels/:id/messages/:msgId - Get specific message
- POST /api/channels/:id/messages - Send message
- PATCH /api/channels/:id/messages/:msgId - Edit message
- DELETE /api/channels/:id/messages/:msgId - Delete message
- POST /api/channels/:id/messages/bulk-delete - Bulk delete
- POST /api/channels/:id/messages/:msgId/reactions/:emoji - Add reaction
- DELETE /api/channels/:id/messages/:msgId/reactions/:emoji - Remove reaction
- POST /api/channels/:id/messages/:msgId/pin - Pin message
- DELETE /api/channels/:id/messages/:msgId/pin - Unpin message
- POST /api/channels/:id/messages/:msgId/crosspost - Crosspost message
### Members
- GET /api/guilds/:id/members - List members
- GET /api/guilds/:id/members/search?q=query - Search members
- GET /api/guilds/:id/members/:userId - Get member
- POST /api/guilds/:id/members/:userId/kick - Kick member
- POST /api/guilds/:id/members/:userId/ban - Ban member
- DELETE /api/guilds/:id/bans/:userId - Unban user
- PATCH /api/guilds/:id/members/:userId/nickname - Set nickname
- PATCH /api/guilds/:id/members/:userId/roles - Modify roles
- POST /api/guilds/:id/members/:userId/timeout - Timeout member
- DELETE /api/guilds/:id/members/:userId/timeout - Remove timeout
### Roles
- GET /api/guilds/:id/roles - List roles
- GET /api/guilds/:id/roles/search?name=name - Search roles
- GET /api/guilds/:id/roles/:roleId - Get role
- POST /api/guilds/:id/roles - Create role
- PATCH /api/guilds/:id/roles/:roleId - Edit role
- DELETE /api/guilds/:id/roles/:roleId - Delete role
- GET /api/guilds/:id/roles/:roleId/members - Get role members
- PATCH /api/guilds/:id/roles/:roleId/permissions - Set permissions
### Application Commands (Slash Commands)
- GET /api/commands - List global commands
- GET /api/commands/:commandId - Get global command
- POST /api/commands - Create global command
- PATCH /api/commands/:commandId - Edit global command
- DELETE /api/commands/:commandId - Delete global command
- GET /api/guilds/:id/commands - List guild commands
- GET /api/guilds/:id/commands/:commandId - Get guild command
- POST /api/guilds/:id/commands - Create guild command
- PATCH /api/guilds/:id/commands/:commandId - Edit guild command
- DELETE /api/guilds/:id/commands/:commandId - Delete guild command
## WebSocket Events
Connect via Socket.IO with authentication:
```javascript
const socket = io('http://localhost:3000', {
auth: { apiKey: 'your_key' }
});
socket.emit('subscribe', { guildIds: ['123456789'] });
socket.on('discord', (event) => {
console.log(event.event, event.data);
});
```
### Available Events
- messageCreate, messageUpdate, messageDelete, messageDeleteBulk
- messageReactionAdd, messageReactionRemove
- guildMemberAdd, guildMemberRemove, guildMemberUpdate
- presenceUpdate, userUpdate
- channelCreate, channelUpdate, channelDelete
- threadCreate, threadUpdate, threadDelete
- roleCreate, roleUpdate, roleDelete
- voiceStateUpdate
- guildBanAdd, guildBanRemove
- typingStart
- inviteCreate, inviteDelete
## Configuration
Environment variables:
- DISCORD_TOKEN - Discord bot token (required)
- API_KEY - API authentication key (required)
- PORT - Server port (default: 3000)
- DEBUG - Enable debug logging (default: false)
## Quick Start
```bash
npm install
cp .env.example .env
# Edit .env with your values
npm run dev
```
## File Structure
- src/index.ts - Entry point
- src/api/server.ts - Express server setup
- src/api/routes/ - REST API routes
- src/api/websocket/ - WebSocket event handlers
- src/discord/ - Discord.js client and services
- src/types/ - TypeScript type definitions
- docs/ - HTML documentation
## License
MIT