-
Notifications
You must be signed in to change notification settings - Fork 1
Testingbranch #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b1d058d
docs: Add initial documentation pages and styling for the Discord Web…
Coder-soft 5f66ccc
docs: Add comprehensive API reference documentation for Discord Web B…
Coder-soft 3e1d613
feat: add comprehensive WebSocket event documentation and an empty LL…
Coder-soft 150bfc9
feat: Introduce core application logic and a new documentation site w…
Coder-soft 188252d
docs: add link to external documentation
Coder-soft 50b7f1e
Update docs/getting-started.html
Coder-soft a6a7cd0
feat: Add WebSocket API for Discord event streaming, including type d…
Coder-soft 27b079c
Merge branch 'Testingbranch' of https://github.com/Coder-soft/HoloBri…
Coder-soft 627a812
feat: Implement Discord client initialization with full intents and S…
Coder-soft f5e5fa1
Update src/discord/events/index.ts
Coder-soft 33f4246
Update src/discord/events/index.ts
Coder-soft 420d626
Update src/discord/events/index.ts
Coder-soft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,190 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
|
|
||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>Getting Started - Holo Bridge</title> | ||
| <meta name="description" content="Learn how to install, configure, and run Holo Bridge."> | ||
| <link rel="stylesheet" href="styles.css"> | ||
| </head> | ||
|
|
||
| <body> | ||
| <header> | ||
| <div class="container header-content"> | ||
| <a href="index.html" class="logo">Holo Bridge</a> | ||
| <nav> | ||
| <a href="index.html">Home</a> | ||
| <a href="getting-started.html" class="active">Getting Started</a> | ||
| <a href="api-reference.html">API Reference</a> | ||
| <a href="websocket.html">WebSocket</a> | ||
| <button class="theme-toggle" onclick="toggleTheme()">Toggle Theme</button> | ||
| </nav> | ||
| </div> | ||
| </header> | ||
|
|
||
| <main> | ||
| <div class="container"> | ||
| <h1>Getting Started</h1> | ||
| <p>This guide will walk you through installing, configuring, and running Holo Bridge.</p> | ||
|
|
||
| <h2>Prerequisites</h2> | ||
| <ul> | ||
| <li>Node.js 18 or higher</li> | ||
| <li>npm or yarn package manager</li> | ||
| <li>A Discord bot token</li> | ||
| </ul> | ||
|
|
||
| <h2>Installation</h2> | ||
| <h3>1. Clone the Repository</h3> | ||
| git clone https://github.com/coder-soft/holobridge.git | ||
| cd holobridge | ||
|
|
||
| <h3>2. Install Dependencies</h3> | ||
| <pre><code>npm install</code></pre> | ||
|
|
||
| <h2>Configuration</h2> | ||
| <h3>Environment Variables</h3> | ||
| <p>Copy <code>.env.example</code> to <code>.env</code> and fill in your values:</p> | ||
| <pre><code># Discord Bot Token (required) | ||
| # Get this from https://discord.com/developers/applications | ||
| DISCORD_TOKEN=your_discord_bot_token_here | ||
|
|
||
| # API Configuration | ||
| PORT=3000 | ||
| API_KEY=your_secure_api_key_here | ||
|
|
||
| # Optional: Enable debug logging | ||
| DEBUG=false</code></pre> | ||
|
|
||
| <table> | ||
| <thead> | ||
| <tr> | ||
| <th>Variable</th> | ||
| <th>Required</th> | ||
| <th>Description</th> | ||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| <tr> | ||
| <td><code>DISCORD_TOKEN</code></td> | ||
| <td>Yes</td> | ||
| <td>Your Discord bot token</td> | ||
| </tr> | ||
| <tr> | ||
| <td><code>API_KEY</code></td> | ||
| <td>Yes</td> | ||
| <td>API key for authenticating requests</td> | ||
| </tr> | ||
| <tr> | ||
| <td><code>PORT</code></td> | ||
| <td>No</td> | ||
| <td>Server port (default: 3000)</td> | ||
| </tr> | ||
| <tr> | ||
| <td><code>DEBUG</code></td> | ||
| <td>No</td> | ||
| <td>Enable debug logging (default: false)</td> | ||
| </tr> | ||
| </tbody> | ||
| </table> | ||
|
|
||
| <h2>Running the Server</h2> | ||
| <h3>Development Mode</h3> | ||
| <pre><code>npm run dev</code></pre> | ||
|
|
||
| <h3>Production Mode</h3> | ||
| <pre><code>npm run build | ||
| npm start</code></pre> | ||
|
|
||
| <h2>Discord Bot Setup</h2> | ||
| <p>Follow these steps to create a Discord bot and invite it to your server:</p> | ||
|
|
||
| <ol> | ||
| <li>Go to the <a href="https://discord.com/developers/applications" target="_blank">Discord Developer | ||
| Portal</a></li> | ||
| <li>Click "New Application" and give it a name</li> | ||
| <li>Go to the "Bot" section in the left sidebar</li> | ||
| <li>Click "Add Bot" and confirm</li> | ||
| <li>Enable the following <strong>Privileged Gateway Intents</strong>: | ||
| <ul> | ||
| <li>Presence Intent</li> | ||
| <li>Server Members Intent</li> | ||
| <li>Message Content Intent</li> | ||
| </ul> | ||
| </li> | ||
| <li>Click "Reset Token" to get your bot token and copy it to your <code>.env</code> file</li> | ||
| </ol> | ||
|
|
||
| <h3>Inviting the Bot</h3> | ||
| <ol> | ||
| <li>Go to the "OAuth2" → "URL Generator" section</li> | ||
| <li>Select the following scopes: | ||
| <ul> | ||
| <li><code>bot</code></li> | ||
| <li><code>applications.commands</code></li> | ||
| </ul> | ||
| </li> | ||
| <li>Select the permissions your bot needs (Administrator for full access)</li> | ||
| <li>Copy the generated URL and open it in your browser</li> | ||
| <li>Select a server and authorize the bot</li> | ||
| </ol> | ||
|
|
||
| <div class="alert alert-warning"> | ||
| <strong>⚠️ Important:</strong> Keep your bot token and API key secret. Never commit them to version | ||
| control. | ||
| </div> | ||
|
|
||
| <h2>Testing the API</h2> | ||
| <p>Once the server is running, you can test the API with curl:</p> | ||
| <pre><code># List all guilds | ||
| curl -H "X-API-Key: your_api_key" http://localhost:3000/api/guilds</code></pre> | ||
|
|
||
| <h2>Next Steps</h2> | ||
| <div class="cards"> | ||
| <a href="api-reference.html" class="card"> | ||
| <h4>📖 API Reference</h4> | ||
| <p>Explore all available REST API endpoints.</p> | ||
| </a> | ||
| <a href="websocket.html" class="card"> | ||
| <h4>⚡ WebSocket Events</h4> | ||
| <p>Learn how to receive real-time Discord events.</p> | ||
| </a> | ||
| </div> | ||
| </div> | ||
| </main> | ||
|
|
||
| <footer> | ||
| <div class="container"> | ||
| <p>Holo Bridge © 2025 - MIT License</p> | ||
| </div> | ||
| </footer> | ||
|
|
||
| <script> | ||
| function toggleTheme() { | ||
| const html = document.documentElement; | ||
| const current = html.getAttribute('data-theme'); | ||
| if (current === 'dark') { | ||
| html.setAttribute('data-theme', 'light'); | ||
| localStorage.setItem('theme', 'light'); | ||
| } else if (current === 'light') { | ||
| html.setAttribute('data-theme', 'dark'); | ||
| localStorage.setItem('theme', 'dark'); | ||
| } else { | ||
| const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches; | ||
| const newTheme = prefersDark ? 'light' : 'dark'; | ||
| html.setAttribute('data-theme', newTheme); | ||
| localStorage.setItem('theme', newTheme); | ||
| } | ||
| } | ||
|
|
||
| (function () { | ||
| const saved = localStorage.getItem('theme'); | ||
| if (saved) { | ||
| document.documentElement.setAttribute('data-theme', saved); | ||
| } | ||
| })(); | ||
| </script> | ||
| </body> | ||
|
|
||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
|
|
||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>Holo Bridge - Documentation</title> | ||
| <meta name="description" | ||
| content="A type-safe TypeScript bridge between websites and Discord bots. REST API and WebSocket interface for full Discord bot capabilities."> | ||
| <link rel="stylesheet" href="styles.css"> | ||
| </head> | ||
|
|
||
| <body> | ||
| <header> | ||
| <div class="container header-content"> | ||
| <a href="index.html" class="logo">Holo Bridge</a> | ||
| <nav> | ||
| <a href="index.html" class="active">Home</a> | ||
| <a href="getting-started.html">Getting Started</a> | ||
| <a href="api-reference.html">API Reference</a> | ||
| <a href="websocket.html">WebSocket</a> | ||
| <button class="theme-toggle" onclick="toggleTheme()">Toggle Theme</button> | ||
| </nav> | ||
| </div> | ||
| </header> | ||
|
|
||
| <main> | ||
| <div class="container"> | ||
| <section class="hero"> | ||
| <h1>Holo Bridge</h1> | ||
| <p>A type-safe TypeScript bridge between websites and Discord bots. Provides a REST API and WebSocket | ||
| interface for full Discord bot capabilities.</p> | ||
| <div class="btn-group"> | ||
| <a href="getting-started.html" class="btn btn-primary">Get Started</a> | ||
| <a href="api-reference.html" class="btn btn-secondary">API Reference</a> | ||
| </div> | ||
| </section> | ||
|
|
||
| <section class="features"> | ||
| <div class="feature-card"> | ||
| <h3>🌐 REST API</h3> | ||
| <p>Full REST API for all Discord operations including guilds, channels, messages, members, and | ||
| roles.</p> | ||
| </div> | ||
| <div class="feature-card"> | ||
| <h3>⚡ WebSocket Events</h3> | ||
| <p>Real-time event streaming via Socket.IO. Subscribe to guilds and receive Discord events | ||
| instantly.</p> | ||
| </div> | ||
| <div class="feature-card"> | ||
| <h3>🔒 Type-Safe</h3> | ||
| <p>Built with TypeScript and Zod validation. Every request and response is fully typed.</p> | ||
| </div> | ||
| <div class="feature-card"> | ||
| <h3>📦 Full Coverage</h3> | ||
| <p>Guilds, Channels, Roles, Members, Bans, Timeouts, Messages, Reactions, Pins, and more.</p> | ||
| </div> | ||
| </section> | ||
|
|
||
| <h2>Quick Links</h2> | ||
| <div class="cards"> | ||
| <a href="getting-started.html" class="card"> | ||
| <h4>📚 Getting Started</h4> | ||
| <p>Installation, configuration, and running the server.</p> | ||
| </a> | ||
| <a href="api-reference.html" class="card"> | ||
| <h4>📖 API Reference</h4> | ||
| <p>Complete REST API endpoint documentation.</p> | ||
| </a> | ||
| <a href="websocket.html" class="card"> | ||
| <h4>⚡ WebSocket Events</h4> | ||
| <p>Real-time event streaming documentation.</p> | ||
| </a> | ||
| <a href="https://github.com" class="card" target="_blank"> | ||
| <h4>💻 Source Code</h4> | ||
| <p>View the source code on GitHub.</p> | ||
| </a> | ||
| </div> | ||
|
|
||
| <h2>Features Overview</h2> | ||
| <h3>Discord Operations</h3> | ||
| <ul> | ||
| <li><strong>Guilds</strong> - List guilds, get details, channels, roles, emojis, bans, invites</li> | ||
| <li><strong>Channels</strong> - Create, edit, delete channels and threads</li> | ||
| <li><strong>Messages</strong> - Send, edit, delete, bulk delete, reactions, pins</li> | ||
| <li><strong>Members</strong> - List, search, kick, ban, timeout, role management</li> | ||
| <li><strong>Roles</strong> - Create, edit, delete, permissions management</li> | ||
| </ul> | ||
|
|
||
| <h3>Real-Time Events</h3> | ||
| <ul> | ||
| <li><strong>Message Events</strong> - messageCreate, messageUpdate, messageDelete</li> | ||
| <li><strong>Member Events</strong> - guildMemberAdd, guildMemberRemove, guildMemberUpdate</li> | ||
| <li><strong>Channel Events</strong> - channelCreate, channelUpdate, channelDelete</li> | ||
| <li><strong>Role Events</strong> - roleCreate, roleUpdate, roleDelete</li> | ||
| <li><strong>Voice Events</strong> - voiceStateUpdate</li> | ||
| <li><strong>Guild Events</strong> - guildBanAdd, guildBanRemove</li> | ||
| </ul> | ||
| </div> | ||
| </main> | ||
|
|
||
| <footer> | ||
| <div class="container"> | ||
| <p>Holo Bridge © 2025 - MIT License</p> | ||
| </div> | ||
| </footer> | ||
|
|
||
| <script> | ||
| function toggleTheme() { | ||
| const html = document.documentElement; | ||
| const current = html.getAttribute('data-theme'); | ||
| if (current === 'dark') { | ||
| html.setAttribute('data-theme', 'light'); | ||
| localStorage.setItem('theme', 'light'); | ||
| } else if (current === 'light') { | ||
| html.setAttribute('data-theme', 'dark'); | ||
| localStorage.setItem('theme', 'dark'); | ||
| } else { | ||
| // First toggle - check what the current preference is | ||
| const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches; | ||
| const newTheme = prefersDark ? 'light' : 'dark'; | ||
| html.setAttribute('data-theme', newTheme); | ||
| localStorage.setItem('theme', newTheme); | ||
| } | ||
| } | ||
|
|
||
| // Load saved theme | ||
| (function () { | ||
| const saved = localStorage.getItem('theme'); | ||
| if (saved) { | ||
| document.documentElement.setAttribute('data-theme', saved); | ||
| } | ||
| })(); | ||
| </script> | ||
| </body> | ||
|
|
||
| </html> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Link points to generic
https://github.cominstead of the actual repositoryPrompt To Fix With AI