@spatulox/simplediscordbot 3.1.0 → 3.1.1
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.
- package/CHANGELOG.md +4 -0
- package/dist/index.d.mts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +11 -1
- package/dist/index.mjs +11 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
Date format : dd/mm/yyyy
|
|
3
3
|
|
|
4
|
+
### 21/09/2026 - 3.1.1
|
|
5
|
+
- Add :
|
|
6
|
+
- `ComponentManager.chart(container, chart, separator?)` : adds one chart or an array of charts to a container, like `field()` / `mediaGallery()` / `selectMenu()` do, instead of calling `container.addTextDisplayComponents()` by hand. No separator by default
|
|
7
|
+
|
|
4
8
|
### 21/09/2026 - 3.1.0
|
|
5
9
|
- Add :
|
|
6
10
|
- `ChartManager` : text based charts for Components V2, since Discord has no chart component. `progressBar()` / `progressBars()` draw unicode gauges (`CPU : ███░░░░░░░ 32.7 %`), `sparkline()` / `sparklines()` draw one line curves (`▁▂▃▅▇█▆▄▃▂▁`). Each method returns a `TextDisplayBuilder` to drop into a `ContainerBuilder`, and the grouped forms render every row in a single one so a dashboard costs 1 component instead of N against the 40 components budget of a message
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EmbedBuilder, ContainerBuilder, ActionRowBuilder, MessageActionRowComponentBuilder, Message, TextChannel, DMChannel, ThreadChannel, MessageCreateOptions, User, GuildMember, BaseInteraction, InteractionResponse, Client, ActivityType, InteractionDeferReplyOptions, InteractionReplyOptions, InteractionEditReplyOptions, Snowflake, WebhookMessageCreateOptions, EmojiResolvable, Guild, BanOptions, GuildBasedChannel, GuildChannelCreateOptions, ForumChannel, NewsChannel, StageChannel, StartThreadOptions, VoiceChannel, Invite, Channel, Collection, GuildBan, ModalBuilder, StringSelectMenuBuilder, UserSelectMenuBuilder, RoleSelectMenuBuilder, MentionableSelectMenuBuilder, ChannelSelectMenuBuilder, ChannelType, SeparatorSpacingSize, ButtonBuilder,
|
|
1
|
+
import { EmbedBuilder, ContainerBuilder, ActionRowBuilder, MessageActionRowComponentBuilder, Message, TextChannel, DMChannel, ThreadChannel, MessageCreateOptions, User, GuildMember, BaseInteraction, InteractionResponse, Client, ActivityType, InteractionDeferReplyOptions, InteractionReplyOptions, InteractionEditReplyOptions, Snowflake, WebhookMessageCreateOptions, EmojiResolvable, Guild, BanOptions, GuildBasedChannel, GuildChannelCreateOptions, ForumChannel, NewsChannel, StageChannel, StartThreadOptions, VoiceChannel, Invite, Channel, Collection, GuildBan, ModalBuilder, StringSelectMenuBuilder, UserSelectMenuBuilder, RoleSelectMenuBuilder, MentionableSelectMenuBuilder, ChannelSelectMenuBuilder, ChannelType, SeparatorSpacingSize, ButtonBuilder, TextDisplayBuilder, AttachmentBuilder, ButtonStyle } from 'discord.js';
|
|
2
2
|
import { BaseSelectMenuBuilder } from '@discordjs/builders';
|
|
3
3
|
export { CacheManager, FileManager, Log, SimpleMutex, Time } from '@spatulox/utils';
|
|
4
4
|
|
|
@@ -701,6 +701,14 @@ declare class ComponentManager {
|
|
|
701
701
|
* Multiple fields
|
|
702
702
|
*/
|
|
703
703
|
static fields(container: ContainerBuilder, fields: ComponentManagerField[]): ContainerBuilder;
|
|
704
|
+
/**
|
|
705
|
+
* Add chart(s) built by the ChartManager, so a dashboard reads like the other helpers :
|
|
706
|
+
* `ComponentManager.chart(container, ChartManager.progressBars([...]))` instead of
|
|
707
|
+
* `container.addTextDisplayComponents(...)`.
|
|
708
|
+
* No separator by default : stacked charts are meant to be read as one block
|
|
709
|
+
*/
|
|
710
|
+
static chart(container: ContainerBuilder, chart: TextDisplayBuilder[], separator?: SeparatorSpacingSize | false): ContainerBuilder;
|
|
711
|
+
static chart(container: ContainerBuilder, chart: TextDisplayBuilder, separator?: SeparatorSpacingSize | false): ContainerBuilder;
|
|
704
712
|
/**
|
|
705
713
|
* Add a media gallery (links)
|
|
706
714
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EmbedBuilder, ContainerBuilder, ActionRowBuilder, MessageActionRowComponentBuilder, Message, TextChannel, DMChannel, ThreadChannel, MessageCreateOptions, User, GuildMember, BaseInteraction, InteractionResponse, Client, ActivityType, InteractionDeferReplyOptions, InteractionReplyOptions, InteractionEditReplyOptions, Snowflake, WebhookMessageCreateOptions, EmojiResolvable, Guild, BanOptions, GuildBasedChannel, GuildChannelCreateOptions, ForumChannel, NewsChannel, StageChannel, StartThreadOptions, VoiceChannel, Invite, Channel, Collection, GuildBan, ModalBuilder, StringSelectMenuBuilder, UserSelectMenuBuilder, RoleSelectMenuBuilder, MentionableSelectMenuBuilder, ChannelSelectMenuBuilder, ChannelType, SeparatorSpacingSize, ButtonBuilder,
|
|
1
|
+
import { EmbedBuilder, ContainerBuilder, ActionRowBuilder, MessageActionRowComponentBuilder, Message, TextChannel, DMChannel, ThreadChannel, MessageCreateOptions, User, GuildMember, BaseInteraction, InteractionResponse, Client, ActivityType, InteractionDeferReplyOptions, InteractionReplyOptions, InteractionEditReplyOptions, Snowflake, WebhookMessageCreateOptions, EmojiResolvable, Guild, BanOptions, GuildBasedChannel, GuildChannelCreateOptions, ForumChannel, NewsChannel, StageChannel, StartThreadOptions, VoiceChannel, Invite, Channel, Collection, GuildBan, ModalBuilder, StringSelectMenuBuilder, UserSelectMenuBuilder, RoleSelectMenuBuilder, MentionableSelectMenuBuilder, ChannelSelectMenuBuilder, ChannelType, SeparatorSpacingSize, ButtonBuilder, TextDisplayBuilder, AttachmentBuilder, ButtonStyle } from 'discord.js';
|
|
2
2
|
import { BaseSelectMenuBuilder } from '@discordjs/builders';
|
|
3
3
|
export { CacheManager, FileManager, Log, SimpleMutex, Time } from '@spatulox/utils';
|
|
4
4
|
|
|
@@ -701,6 +701,14 @@ declare class ComponentManager {
|
|
|
701
701
|
* Multiple fields
|
|
702
702
|
*/
|
|
703
703
|
static fields(container: ContainerBuilder, fields: ComponentManagerField[]): ContainerBuilder;
|
|
704
|
+
/**
|
|
705
|
+
* Add chart(s) built by the ChartManager, so a dashboard reads like the other helpers :
|
|
706
|
+
* `ComponentManager.chart(container, ChartManager.progressBars([...]))` instead of
|
|
707
|
+
* `container.addTextDisplayComponents(...)`.
|
|
708
|
+
* No separator by default : stacked charts are meant to be read as one block
|
|
709
|
+
*/
|
|
710
|
+
static chart(container: ContainerBuilder, chart: TextDisplayBuilder[], separator?: SeparatorSpacingSize | false): ContainerBuilder;
|
|
711
|
+
static chart(container: ContainerBuilder, chart: TextDisplayBuilder, separator?: SeparatorSpacingSize | false): ContainerBuilder;
|
|
704
712
|
/**
|
|
705
713
|
* Add a media gallery (links)
|
|
706
714
|
*/
|
package/dist/index.js
CHANGED
|
@@ -764,7 +764,7 @@ var BotInteraction = class {
|
|
|
764
764
|
// package.json
|
|
765
765
|
var package_default = {
|
|
766
766
|
name: "@spatulox/simplediscordbot",
|
|
767
|
-
version: "3.0
|
|
767
|
+
version: "3.1.0",
|
|
768
768
|
author: "Spatulox",
|
|
769
769
|
description: "Simple discord bot framework to set up a bot under 30 secondes",
|
|
770
770
|
exports: {
|
|
@@ -2371,6 +2371,16 @@ var ComponentManager = class {
|
|
|
2371
2371
|
});
|
|
2372
2372
|
return container;
|
|
2373
2373
|
}
|
|
2374
|
+
static chart(container, chart, separator = false) {
|
|
2375
|
+
const charts = Array.isArray(chart) ? chart : [chart];
|
|
2376
|
+
charts.forEach((c) => {
|
|
2377
|
+
container.addTextDisplayComponents(c);
|
|
2378
|
+
if (separator !== false) {
|
|
2379
|
+
container.addSeparatorComponents(this.separator(separator));
|
|
2380
|
+
}
|
|
2381
|
+
});
|
|
2382
|
+
return container;
|
|
2383
|
+
}
|
|
2374
2384
|
/**
|
|
2375
2385
|
* Add a media gallery (links)
|
|
2376
2386
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -743,7 +743,7 @@ var BotInteraction = class {
|
|
|
743
743
|
// package.json
|
|
744
744
|
var package_default = {
|
|
745
745
|
name: "@spatulox/simplediscordbot",
|
|
746
|
-
version: "3.0
|
|
746
|
+
version: "3.1.0",
|
|
747
747
|
author: "Spatulox",
|
|
748
748
|
description: "Simple discord bot framework to set up a bot under 30 secondes",
|
|
749
749
|
exports: {
|
|
@@ -2373,6 +2373,16 @@ var ComponentManager = class {
|
|
|
2373
2373
|
});
|
|
2374
2374
|
return container;
|
|
2375
2375
|
}
|
|
2376
|
+
static chart(container, chart, separator = false) {
|
|
2377
|
+
const charts = Array.isArray(chart) ? chart : [chart];
|
|
2378
|
+
charts.forEach((c) => {
|
|
2379
|
+
container.addTextDisplayComponents(c);
|
|
2380
|
+
if (separator !== false) {
|
|
2381
|
+
container.addSeparatorComponents(this.separator(separator));
|
|
2382
|
+
}
|
|
2383
|
+
});
|
|
2384
|
+
return container;
|
|
2385
|
+
}
|
|
2376
2386
|
/**
|
|
2377
2387
|
* Add a media gallery (links)
|
|
2378
2388
|
*/
|