{"id":31481300,"url":"https://github.com/kynuxdev/discord-webhook-manager","last_synced_at":"2025-10-02T06:36:35.210Z","repository":{"id":316325594,"uuid":"1062891707","full_name":"KynuxDev/discord-webhook-manager","owner":"KynuxDev","description":"🚀 Easy Discord webhook manager with full TypeScript support. Send messages, embeds \u0026 files without discord.js dependency.","archived":false,"fork":false,"pushed_at":"2025-09-23T22:07:18.000Z","size":53,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-24T00:52:34.918Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KynuxDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-23T21:59:26.000Z","updated_at":"2025-09-23T22:07:21.000Z","dependencies_parsed_at":"2025-09-25T22:01:58.302Z","dependency_job_id":null,"html_url":"https://github.com/KynuxDev/discord-webhook-manager","commit_stats":null,"previous_names":["kynuxdev/discord-webhook-manager"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/KynuxDev/discord-webhook-manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KynuxDev%2Fdiscord-webhook-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KynuxDev%2Fdiscord-webhook-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KynuxDev%2Fdiscord-webhook-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KynuxDev%2Fdiscord-webhook-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KynuxDev","download_url":"https://codeload.github.com/KynuxDev/discord-webhook-manager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KynuxDev%2Fdiscord-webhook-manager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277968832,"owners_count":25907418,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-02T02:00:08.890Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-02T06:36:32.619Z","updated_at":"2025-10-02T06:36:35.203Z","avatar_url":"https://github.com/KynuxDev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discord Webhook Manager\n\n[![npm version](https://badge.fury.io/js/discord-webhook-manager.svg)](https://www.npmjs.com/package/discord-webhook-manager)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nEasy-to-use Discord webhook client for Node.js with full TypeScript support. Send messages, embeds, and files without the need for discord.js dependency.\n\n## 🚀 Features\n\n- ✅ **TypeScript Support** - Full type safety and IntelliSense\n- ✅ **Zero Discord.js Dependency** - Lightweight and focused\n- ✅ **Method Chaining** - Fluent API for embed building\n- ✅ **File Uploads** - Support for multiple file attachments\n- ✅ **Embed Builder** - Easy embed creation with validation\n- ✅ **Error Handling** - Comprehensive error management\n- ✅ **Webhook Management** - Get, update, and delete webhooks\n- ✅ **Message Editing** - Edit and delete sent messages\n- ✅ **ESM \u0026 CommonJS** - Both module formats supported\n\n## 📦 Installation\n\n```bash\nnpm install @lorayazilimltd/discord-webhook-manager\n```\n\n```bash\nyarn add @lorayazilimltd/discord-webhook-manager\n```\n\n```bash\npnpm add @lorayazilimltd/discord-webhook-manager\n```\n\n## 🎯 Quick Start\n\n```typescript\nimport { WebhookClient, EmbedBuilder } from '@lorayazilimltd/discord-webhook-manager';\n\n// Initialize webhook client\nconst webhook = new WebhookClient('YOUR_WEBHOOK_URL');\n\n// Send a simple message\nawait webhook.send('Hello Discord!');\n\n// Send an embed\nconst embed = new EmbedBuilder()\n  .setTitle('My Embed')\n  .setDescription('This is a test embed')\n  .setColor('BLUE')\n  .addField('Field Name', 'Field Value')\n  .setTimestamp();\n\nawait webhook.sendEmbed(embed);\n```\n\n## 📚 API Documentation\n\n### WebhookClient\n\n#### Constructor\n\n```typescript\nnew WebhookClient(webhookURL: string, options?: WebhookClientOptions)\n```\n\n**Options:**\n- `userAgent?: string` - Custom user agent (default: 'discord-webhook-manager/1.0.0')\n- `timeout?: number` - Request timeout in ms (default: 10000)\n- `throwErrors?: boolean` - Whether to throw errors or return them (default: true)\n\n#### Methods\n\n##### send(content: string)\nSend a simple text message.\n\n```typescript\nawait webhook.send('Hello World!');\n```\n\n##### sendEmbed(embed: EmbedBuilder | EmbedData)\nSend an embed message.\n\n```typescript\nconst embed = new EmbedBuilder()\n  .setTitle('Title')\n  .setDescription('Description');\n\nawait webhook.sendEmbed(embed);\n```\n\n##### sendEmbeds(embeds: (EmbedBuilder | EmbedData)[])\nSend multiple embeds (max 10).\n\n```typescript\nconst embed1 = new EmbedBuilder().setTitle('Embed 1');\nconst embed2 = new EmbedBuilder().setTitle('Embed 2');\n\nawait webhook.sendEmbeds([embed1, embed2]);\n```\n\n##### sendFile(file: FileData, content?: string, embed?: EmbedBuilder | EmbedData)\nSend a file with optional content and embed.\n\n```typescript\nconst file = {\n  name: 'image.png',\n  data: Buffer.from('...'),\n  contentType: 'image/png'\n};\n\nawait webhook.sendFile(file, 'Check out this image!');\n```\n\n##### sendFiles(files: FileData[], content?: string, embed?: EmbedBuilder | EmbedData)\nSend multiple files.\n\n```typescript\nconst files = [\n  { name: 'file1.txt', data: 'Content 1' },\n  { name: 'file2.txt', data: 'Content 2' }\n];\n\nawait webhook.sendFiles(files, 'Multiple files attached');\n```\n\n##### sendMessage(payload: MessagePayload)\nSend a complex message with full payload control.\n\n```typescript\nawait webhook.sendMessage({\n  content: 'Hello!',\n  username: 'Custom Bot Name',\n  avatar_url: 'https://example.com/avatar.png',\n  embeds: [embed.build()],\n  tts: false\n});\n```\n\n##### getInfo()\nGet webhook information.\n\n```typescript\nconst info = await webhook.getInfo();\nconsole.log(info.name, info.avatar);\n```\n\n##### updateInfo(data: WebhookUpdateData)\nUpdate webhook name and/or avatar.\n\n```typescript\nawait webhook.updateInfo({\n  name: 'New Webhook Name',\n  avatar: 'base64_image_data'\n});\n```\n\n##### editMessage(messageId: string, payload: MessagePayload)\nEdit a message sent by this webhook.\n\n```typescript\nawait webhook.editMessage('123456789', {\n  content: 'Updated message content'\n});\n```\n\n##### deleteMessage(messageId: string)\nDelete a message sent by this webhook.\n\n```typescript\nawait webhook.deleteMessage('123456789');\n```\n\n##### delete()\nDelete the webhook entirely.\n\n```typescript\nawait webhook.delete();\n```\n\n### EmbedBuilder\n\nCreate rich embeds with method chaining.\n\n#### Methods\n\n```typescript\nconst embed = new EmbedBuilder()\n  .setTitle('Embed Title')\n  .setDescription('Embed description')\n  .setURL('https://example.com')\n  .setColor('BLUE')\n  .setTimestamp()\n  .setAuthor('Author Name', 'icon_url', 'author_url')\n  .setFooter('Footer Text', 'footer_icon_url')\n  .setImage('https://example.com/image.png')\n  .setThumbnail('https://example.com/thumb.png')\n  .addField('Field Name', 'Field Value', true)\n  .addFields(\n    { name: 'Field 1', value: 'Value 1', inline: true },\n    { name: 'Field 2', value: 'Value 2', inline: true }\n  );\n```\n\n#### Static Helper Methods\n\n```typescript\n// Create pre-formatted embeds\nEmbedBuilder.createError('Something went wrong!');\nEmbedBuilder.createSuccess('Operation completed!');\nEmbedBuilder.createWarning('Be careful!');\nEmbedBuilder.createInfo('Just so you know...');\nEmbedBuilder.createBasic('Title', 'Description', 'GREEN');\n```\n\n#### Validation\n\n```typescript\nconst validation = embed.isValid();\nif (!validation.valid) {\n  console.log('Embed errors:', validation.errors);\n}\n\n// Get embed character count\nconsole.log('Character count:', embed.length);\n```\n\n### Colors\n\nPre-defined color constants:\n\n```typescript\nimport { Colors } from 'discord-webhook-manager';\n\nembed.setColor(Colors.RED);\nembed.setColor(Colors.GREEN);\nembed.setColor(Colors.BLUE);\nembed.setColor('RANDOM'); // Random color\nembed.setColor('#FF0000'); // Hex color\nembed.setColor(0xFF0000); // Number color\n```\n\n### File Types\n\n```typescript\ninterface FileData {\n  name: string;                    // Filename\n  data: Buffer | Uint8Array | string; // File content\n  contentType?: string;            // MIME type (auto-detected if not provided)\n}\n```\n\n## 🎨 Examples\n\n### Basic Usage\n\n```typescript\nimport { WebhookClient } from 'discord-webhook-manager';\n\nconst webhook = new WebhookClient('YOUR_WEBHOOK_URL');\n\n// Simple message\nawait webhook.send('Hello Discord!');\n```\n\n### Rich Embed\n\n```typescript\nimport { WebhookClient, EmbedBuilder, Colors } from '@lorayazilimltd/discord-webhook-manager';\n\nconst webhook = new WebhookClient('YOUR_WEBHOOK_URL');\n\nconst embed = new EmbedBuilder()\n  .setTitle('🎉 Server Status')\n  .setDescription('All systems operational!')\n  .setColor(Colors.GREEN)\n  .addField('CPU Usage', '45%', true)\n  .addField('Memory Usage', '67%', true)\n  .addField('Uptime', '7 days', true)\n  .setFooter('Last updated')\n  .setTimestamp();\n\nawait webhook.sendEmbed(embed);\n```\n\n### File Upload\n\n```typescript\nimport fs from 'fs';\n\nconst fileBuffer = fs.readFileSync('screenshot.png');\n\nawait webhook.sendFile({\n  name: 'screenshot.png',\n  data: fileBuffer,\n  contentType: 'image/png'\n}, 'Here is the latest screenshot!');\n```\n\n### Error Handling\n\n```typescript\ntry {\n  await webhook.send('Hello!');\n} catch (error) {\n  console.error('Failed to send message:', error.message);\n}\n\n// Or with throwErrors: false\nconst webhook = new WebhookClient('URL', { throwErrors: false });\nconst result = await webhook.send('Hello!');\n\nif (!result.success) {\n  console.error('Error:', result.error);\n}\n```\n\n### Message Management\n\n```typescript\n// Send and get message ID\nconst response = await webhook.send('Original message');\nconst messageId = response.message?.id;\n\n// Edit the message\nif (messageId) {\n  await webhook.editMessage(messageId, {\n    content: 'Updated message!',\n    embeds: [\n      new EmbedBuilder()\n        .setTitle('Updated')\n        .setColor('YELLOW')\n        .build()\n    ]\n  });\n  \n  // Delete after 10 seconds\n  setTimeout(() =\u003e {\n    webhook.deleteMessage(messageId);\n  }, 10000);\n}\n```\n\n### Webhook Management\n\n```typescript\n// Get webhook info\nconst info = await webhook.getInfo();\nconsole.log(`Webhook: ${info.name} in channel ${info.channel_id}`);\n\n// Update webhook\nawait webhook.updateInfo({\n  name: 'My New Bot Name'\n});\n\n// Delete webhook (be careful!)\n// await webhook.delete();\n```\n\n## ⚠️ Error Handling\n\nThe library provides comprehensive error handling:\n\n```typescript\nimport { WebhookClient } from 'discord-webhook-manager';\n\n// Throws errors by default\nconst webhook1 = new WebhookClient('URL');\n\n// Returns errors in response\nconst webhook2 = new WebhookClient('URL', { throwErrors: false });\n\nconst result = await webhook2.send('Test');\nif (!result.success) {\n  console.log('Error code:', result.error?.code);\n  console.log('Error message:', result.error?.message);\n}\n```\n\n## 📋 Limits\n\nDiscord has the following limits:\n\n- **Message content**: 2000 characters\n- **Embed title**: 256 characters\n- **Embed description**: 4096 characters\n- **Embed fields**: 25 maximum\n- **Field name**: 256 characters\n- **Field value**: 1024 characters\n- **Footer text**: 2048 characters\n- **Author name**: 256 characters\n- **Total embed**: 6000 characters\n- **Embeds per message**: 10 maximum\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🔗 Links\n\n- [npm package](https://www.npmjs.com/package/@lorayazilimltd/discord-webhook-manager)\n- [GitHub repository](https://github.com/KynuxDev/discord-webhook-manager)\n- [Discord Developer Portal](https://discord.com/developers/docs/resources/webhook)\n\n## ⭐ Support\n\nIf you find this library helpful, please consider giving it a star on GitHub!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkynuxdev%2Fdiscord-webhook-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkynuxdev%2Fdiscord-webhook-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkynuxdev%2Fdiscord-webhook-manager/lists"}