dcsv.js 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +16 -0
  2. package/index.js +38 -0
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -11,6 +11,7 @@ dcsv.js is a lightweight, raw-performance focused Discord library designed for m
11
11
 
12
12
  - **Stackless Architecture**: Zero caching. 100% control.
13
13
  - **Auto-Sharding**: Built-in, zero-config sharding. Just set `shards: 'auto'`.
14
+ - **Container UI**: 💎 **Exclusive:** Built-in helper for beautiful, professional "Container" style layouts (Ansi-enhanced).
14
15
  - **Memory Efficient**: Runs 20,000+ server bots on <500MB RAM.
15
16
  - **Raw Events**: Listen to any Discord event directly.
16
17
  - **Interaction Focused**: Optimized for Slash Commands and Buttons.
@@ -154,6 +155,21 @@ client.on('interactionCreate', async (interaction) => {
154
155
  });
155
156
  ```
156
157
 
158
+ ### 5. ✨ Exclusive: Create Container Message
159
+ Build professional, modern UIs instantly.
160
+
161
+ ```javascript
162
+ await client.createContainer(channelId, {
163
+ title: "SERVER STATUS",
164
+ color: 0x5865F2, // Blurple
165
+ sections: [
166
+ { title: "Performance", content: " [32mStable [0m" },
167
+ { title: "Uptime", content: " [34m99.9% [0m", inline: true }
168
+ ],
169
+ footer: "Powered by dcsv.js"
170
+ });
171
+ ```
172
+
157
173
  ## 🤝 Contributing
158
174
  Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
159
175
 
package/index.js CHANGED
@@ -370,6 +370,44 @@ class Client extends EventEmitter {
370
370
  this.emit('raw', { event, data, shardId: shard.id });
371
371
  }
372
372
 
373
+ /**
374
+ * DCSV Exclusive: Create a "Container" style message
375
+ * Auto-formats a modern Discord UI using native Embeds
376
+ * @param {string} channelId
377
+ * @param {Object} options { title, color, sections: [{ title, content, inline }] }
378
+ */
379
+ async createContainer(channelId, options) {
380
+ const embed = {
381
+ title: options.title,
382
+ color: options.color || 0x2f3136, // Standard Dark
383
+ description: options.description || null,
384
+ fields: [],
385
+ footer: options.footer ? { text: options.footer } : null,
386
+ timestamp: options.timestamp ? new Date().toISOString() : null
387
+ };
388
+
389
+ if (options.sections) {
390
+ for (const section of options.sections) {
391
+ // Add separator if needed
392
+ if (embed.fields.length > 0) {
393
+ embed.fields.push({ name: '\u200b', value: '\u200b', inline: false });
394
+ }
395
+
396
+ embed.fields.push({
397
+ name: section.title.toUpperCase(),
398
+ value: `\`\`\`ansi\n${section.content}\n\`\`\``,
399
+ inline: section.inline || false
400
+ });
401
+ }
402
+ }
403
+
404
+ return this.createMessage(channelId, {
405
+ content: options.content || null,
406
+ embeds: [embed],
407
+ components: options.components || []
408
+ });
409
+ }
410
+
373
411
  async request(method, endpoint, body = null, retries = 0) {
374
412
  await this.rateLimiter.wait(endpoint);
375
413
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dcsv.js",
3
- "version": "1.0.1",
4
- "description": "Ultra High Performance, Stackless Discord Interaction Library. Optimized for low memory usage and high scale.",
3
+ "version": "1.1.0",
4
+ "description": "Ultra High Performance, Stackless Discord Library + Container UI System",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"