@nubisjs/testing 0.1.0-next.0 → 0.1.0-next.2
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/dist/index.js +2 -1
- package/dist/testers.d.ts +4 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -171,6 +171,7 @@ function interactionBase(actor, type) {
|
|
|
171
171
|
const user = actor.user ?? fake.user();
|
|
172
172
|
const guild = actor.dm ? {} : {
|
|
173
173
|
guild_id: actor.guildId ?? "test-guild",
|
|
174
|
+
guild_locale: actor.guildLocale ?? "en-US",
|
|
174
175
|
member: {
|
|
175
176
|
user,
|
|
176
177
|
roles: [...actor.roles ?? []],
|
|
@@ -189,7 +190,7 @@ function interactionBase(actor, type) {
|
|
|
189
190
|
type,
|
|
190
191
|
channel_id: actor.channelId ?? "test-channel",
|
|
191
192
|
app_permissions: String(actor.appPermissions ?? 0n),
|
|
192
|
-
locale: "en-US",
|
|
193
|
+
locale: actor.locale ?? "en-US",
|
|
193
194
|
...actor.dm ? { user } : guild,
|
|
194
195
|
...actor.invoker ? {
|
|
195
196
|
message: {
|
package/dist/testers.d.ts
CHANGED
|
@@ -18,6 +18,10 @@ export interface Actor {
|
|
|
18
18
|
readonly appPermissions?: bigint;
|
|
19
19
|
/** For components: who ran the command that sent the message. */
|
|
20
20
|
readonly invoker?: APIUser;
|
|
21
|
+
/** The user's Discord language, as `interaction.locale`. Defaults to "en-US". */
|
|
22
|
+
readonly locale?: string;
|
|
23
|
+
/** The server's language, as `interaction.guild_locale`. Defaults to "en-US". */
|
|
24
|
+
readonly guildLocale?: string;
|
|
21
25
|
}
|
|
22
26
|
export interface TestResult extends Recording {
|
|
23
27
|
/** The dispatch status: "handled", "denied", "stale", "error", … */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nubisjs/testing",
|
|
3
|
-
"version": "0.1.0-next.
|
|
3
|
+
"version": "0.1.0-next.2",
|
|
4
4
|
"description": "Test Nubis commands, components and modals without Discord.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Eytak",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"lint": "biome lint ."
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@nubisjs/core": "0.1.0-next.
|
|
35
|
+
"@nubisjs/core": "0.1.0-next.2",
|
|
36
36
|
"discord-api-types": "^0.38.59"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|