virello 0.1.0 → 0.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.
Files changed (67) hide show
  1. package/BREAKING_CHANGES.md +19 -0
  2. package/README.md +15 -15
  3. package/docs/console-logging.md +25 -25
  4. package/docs/engine.md +8 -8
  5. package/docs/sharding-recovery.md +3 -3
  6. package/docs/sharding-scaling.md +2 -2
  7. package/docs/sharding-stats.md +3 -3
  8. package/examples/README.md +12 -12
  9. package/examples/bot.ts +2 -2
  10. package/examples/client.ts +4 -4
  11. package/examples/commands/ping.ts +1 -1
  12. package/examples/commands/shard.ts +2 -2
  13. package/examples/commands/stats.ts +2 -2
  14. package/examples/config.ts +1 -1
  15. package/examples/contracts.ts +1 -1
  16. package/examples/coordinator.ts +1 -1
  17. package/examples/engine/live.ts +3 -3
  18. package/examples/engine/offline.ts +2 -2
  19. package/examples/host.ts +1 -1
  20. package/examples/listeners/ready.ts +2 -2
  21. package/examples/logging.ts +1 -1
  22. package/examples/offline.ts +2 -2
  23. package/examples/registration.ts +2 -2
  24. package/examples/shutdown.ts +1 -1
  25. package/examples/stats.ts +1 -1
  26. package/package.json +2 -2
  27. package/src/commands/checks/containers/Entry.ts +3 -3
  28. package/src/commands/registration/computeDifferences/option/channelTypes.ts +1 -1
  29. package/src/commands/registration/computeDifferences/option/type.ts +2 -2
  30. package/src/commands/registration/computeDifferences/options.ts +3 -3
  31. package/src/commands/types.ts +1 -1
  32. package/src/core/Container.ts +5 -5
  33. package/src/core/client/{RiloClient.ts → VirelloClient.ts} +24 -19
  34. package/src/core/config/extensions.ts +1 -1
  35. package/src/core/index.ts +1 -1
  36. package/src/core/lifecycle/Extension.ts +5 -5
  37. package/src/core/loading/constants.ts +1 -1
  38. package/src/core/logging/LoggerLike.ts +5 -5
  39. package/src/core/logging/console.ts +9 -9
  40. package/src/core/logging/format.ts +3 -3
  41. package/src/core/runtime.ts +1 -1
  42. package/src/engine/gateway/GatewayShard.ts +2 -2
  43. package/src/engine/rest/RestClient.ts +2 -1
  44. package/src/events/events.ts +74 -59
  45. package/src/extensions/localisation/extension.ts +2 -2
  46. package/src/extensions/patternCommands/extension.ts +2 -2
  47. package/src/extensions/scheduledTasks/backends/RedisBackend.ts +1 -1
  48. package/src/extensions/scheduledTasks/extension.ts +2 -2
  49. package/src/extensions/scheduledTasks/types/TaskTypes.ts +1 -1
  50. package/src/extensions/services/extension.ts +2 -2
  51. package/src/extensions/subcommands/extension.ts +2 -2
  52. package/src/index.ts +1 -1
  53. package/src/public/client.ts +2 -2
  54. package/src/sharding/client/Link.ts +5 -5
  55. package/src/sharding/client/gateway.ts +1 -1
  56. package/src/sharding/coordinator/Coordinator.ts +4 -4
  57. package/src/sharding/manager/Manager.ts +6 -6
  58. package/src/sharding/stats.ts +1 -1
  59. package/src/sharding/types.ts +3 -3
  60. package/src/utilities/collections/bitfield/BitField.ts +1 -1
  61. package/src/utilities/decorators/module-decorators.ts +1 -1
  62. package/src/utilities/discord/pagination/PaginatedMessage.ts +10 -10
  63. package/src/utilities/discord/pagination/Pagination.ts +1 -1
  64. package/src/utilities/discord/snowflake/Snowflake.ts +5 -5
  65. package/src/utilities/parsing/strategies/FlagUnorderedStrategy.ts +1 -1
  66. package/src/utilities/result/Option.ts +2 -2
  67. package/src/utilities/result/Result.ts +3 -3
@@ -76,7 +76,7 @@ export class PaginatedMessage {
76
76
  /** The default actions of this handler. */
77
77
  public static defaultActions: PaginatedMessageAction[] = [
78
78
  {
79
- customId: "rilo/pagination.goToPage",
79
+ customId: "virello/pagination.goToPage",
80
80
  type: ComponentType.StringSelect,
81
81
  options: [],
82
82
  run: ({ handler, interaction }) =>
@@ -84,14 +84,14 @@ export class PaginatedMessage {
84
84
  (handler.index = parseInt(interaction.values[0], 10)),
85
85
  },
86
86
  {
87
- customId: "rilo/pagination.firstPage",
87
+ customId: "virello/pagination.firstPage",
88
88
  style: ButtonStyle.Primary,
89
89
  emoji: "⏪",
90
90
  type: ComponentType.Button,
91
91
  run: ({ handler }) => (handler.index = 0),
92
92
  },
93
93
  {
94
- customId: "rilo/pagination.previousPage",
94
+ customId: "virello/pagination.previousPage",
95
95
  style: ButtonStyle.Primary,
96
96
  emoji: "◀️",
97
97
  type: ComponentType.Button,
@@ -104,7 +104,7 @@ export class PaginatedMessage {
104
104
  },
105
105
  },
106
106
  {
107
- customId: "rilo/pagination.nextPage",
107
+ customId: "virello/pagination.nextPage",
108
108
  style: ButtonStyle.Primary,
109
109
  emoji: "▶️",
110
110
  type: ComponentType.Button,
@@ -117,14 +117,14 @@ export class PaginatedMessage {
117
117
  },
118
118
  },
119
119
  {
120
- customId: "rilo/pagination.goToLastPage",
120
+ customId: "virello/pagination.goToLastPage",
121
121
  style: ButtonStyle.Primary,
122
122
  emoji: "⏩",
123
123
  type: ComponentType.Button,
124
124
  run: ({ handler }) => (handler.index = handler.pages.length - 1),
125
125
  },
126
126
  {
127
- customId: "rilo/pagination.stop",
127
+ customId: "virello/pagination.stop",
128
128
  style: ButtonStyle.Danger,
129
129
  emoji: "⏹️",
130
130
  type: ComponentType.Button,
@@ -141,8 +141,8 @@ export class PaginatedMessage {
141
141
  public static emitPartialDMChannelWarning = true;
142
142
 
143
143
  /** A list of `customId` that are bound to actions that will stop the {@link PaginatedMessage}
144
- * @default ['rilo/pagination.stop'] */
145
- public static stopPaginatedMessageCustomIds = ["rilo/pagination.stop"];
144
+ * @default ['virello/pagination.stop'] */
145
+ public static stopPaginatedMessageCustomIds = ["virello/pagination.stop"];
146
146
 
147
147
  /** The reasons sent by {@linkplain https://discord.js.org/docs/packages/discord.js/main/InteractionCollector:Class#end InteractionCollector#end} event when the message (or its owner) has been deleted. */
148
148
  public static deletionStopReasons = [
@@ -1050,7 +1050,7 @@ export class PaginatedMessage {
1050
1050
  if (isMessageStringSelectInteractionData(interaction)) {
1051
1051
  return new StringSelectMenuBuilder({
1052
1052
  ...interaction,
1053
- ...(interaction.customId === "rilo/pagination.goToPage" && {
1053
+ ...(interaction.customId === "virello/pagination.goToPage" && {
1054
1054
  options: await Promise.all(
1055
1055
  this.pages.map(async (_, index) => {
1056
1056
  return {
@@ -1071,7 +1071,7 @@ export class PaginatedMessage {
1071
1071
  }
1072
1072
 
1073
1073
  throw new Error(
1074
- "Unsupported message component type detected. Validate your code and if you're sure this is a bug in Rilo make a report in the server",
1074
+ "Unsupported message component type detected. Validate your code and if you're sure this is a bug in Virello make a report in the server",
1075
1075
  );
1076
1076
  },
1077
1077
  ),
@@ -124,7 +124,7 @@ export class Pagination {
124
124
  private readonly entries: readonly string[];
125
125
  private readonly options: PaginationBaseOptions;
126
126
  private readonly mode: Mode;
127
- private readonly prefix = `rilo:${randomUUIDv7()}:`;
127
+ private readonly prefix = `virello:${randomUUIDv7()}:`;
128
128
  private readonly size: number;
129
129
  private readonly pages: number;
130
130
  private pageIndex = 0;
@@ -1,8 +1,8 @@
1
- const IncrementSymbol = Symbol("rilo/snowflake.increment");
2
- const EpochSymbol = Symbol("rilo/snowflake.epoch");
3
- const EpochNumberSymbol = Symbol("rilo/snowflake.epoch.number");
4
- const ProcessIdSymbol = Symbol("rilo/snowflake.processId");
5
- const WorkerIdSymbol = Symbol("rilo/snowflake.workerId");
1
+ const IncrementSymbol = Symbol("virello/snowflake.increment");
2
+ const EpochSymbol = Symbol("virello/snowflake.epoch");
3
+ const EpochNumberSymbol = Symbol("virello/snowflake.epoch.number");
4
+ const ProcessIdSymbol = Symbol("virello/snowflake.processId");
5
+ const WorkerIdSymbol = Symbol("virello/snowflake.workerId");
6
6
 
7
7
  /** The maximum value the `workerId` field accepts in snowflakes. */
8
8
  export const MaximumWorkerId = 0b11111n;
@@ -1,7 +1,7 @@
1
1
  import { Option } from "../../result/index";
2
2
  import { PrefixedStrategy } from "../index";
3
3
 
4
- /** The strategy options used in Rilo. */
4
+ /** The strategy options used in Virello. */
5
5
  export interface FlagStrategyOptions {
6
6
  /** Accepted key-only flags. Use true to allow any name, or false/an empty list to disable flags. Defaults to an empty list. */
7
7
  flags?: readonly string[] | boolean;
@@ -7,8 +7,8 @@ import {
7
7
  import { OptionError } from "./OptionError";
8
8
  import { type Err, err, type Ok, ok, Result } from "./Result";
9
9
 
10
- const ValueProperty = Symbol.for("rilo/result:Option.value");
11
- const ExistsProperty = Symbol.for("rilo/result:Option.exists");
10
+ const ValueProperty = Symbol.for("virello/result:Option.value");
11
+ const ExistsProperty = Symbol.for("virello/result:Option.exists");
12
12
 
13
13
  /**
14
14
  * Some(value) or None. Some can contain null or undefined explicitly; from() converts nullish values to None. Ordinary
@@ -7,10 +7,10 @@ import {
7
7
  import { type None, none, type Option, type Some, some } from "./Option";
8
8
  import { ResultError } from "./ResultError";
9
9
 
10
- const ValueProperty = Symbol.for("rilo/result:Result.value");
11
- const SuccessProperty = Symbol.for("rilo/result:Result.success");
10
+ const ValueProperty = Symbol.for("virello/result:Result.value");
11
+ const SuccessProperty = Symbol.for("virello/result:Result.success");
12
12
  /** Symbol used to delegate safe unwrapping inside safeTry generators. */
13
- const UnwrapSafeProperty = Symbol.for("rilo/result:Result.safeUnwrap");
13
+ const UnwrapSafeProperty = Symbol.for("virello/result:Result.safeUnwrap");
14
14
 
15
15
  /**
16
16
  * An Ok value or Err error. Create one with Result.ok/err. Ordinary callbacks run synchronously and propagate exceptions;