@@ -283,7 +283,18 @@ async function run(ctx, argv) {
|
||||
intents.push(GatewayIntentBits.MessageContent)
|
||||
}
|
||||
|
||||
const client = new Client({ intents: intents })
|
||||
const osName =
|
||||
(typeof process !== 'undefined' && process.platform) || 'darwin'
|
||||
const client = new Client({
|
||||
intents: intents,
|
||||
ws: {
|
||||
identifyProperties: {
|
||||
os: osName,
|
||||
browser: 'bare-os',
|
||||
device: 'bare-os'
|
||||
}
|
||||
}
|
||||
})
|
||||
const pingCommand = new SlashCommandBuilder()
|
||||
.setName('ping')
|
||||
.setDescription('Replies with pong.')
|
||||
@@ -357,6 +368,14 @@ async function run(ctx, argv) {
|
||||
})
|
||||
}
|
||||
|
||||
if (Events.Raw) {
|
||||
client.on(Events.Raw, function (packet) {
|
||||
if (!loggingIn) return
|
||||
const t = packet && packet.t
|
||||
if (t) ctx.console.log('discord-bot: dispatch ' + t)
|
||||
})
|
||||
}
|
||||
|
||||
let loggingIn = true
|
||||
let loginTimer = null
|
||||
let loginTick = null
|
||||
|
||||
+20
-1
@@ -573,7 +573,18 @@ async function run(ctx, argv) {
|
||||
intents.push(GatewayIntentBits.MessageContent)
|
||||
}
|
||||
|
||||
const client = new Client({ intents: intents })
|
||||
const osName =
|
||||
(typeof process !== 'undefined' && process.platform) || 'darwin'
|
||||
const client = new Client({
|
||||
intents: intents,
|
||||
ws: {
|
||||
identifyProperties: {
|
||||
os: osName,
|
||||
browser: 'bare-os',
|
||||
device: 'bare-os'
|
||||
}
|
||||
}
|
||||
})
|
||||
const pingCommand = new SlashCommandBuilder()
|
||||
.setName('ping')
|
||||
.setDescription('Replies with pong.')
|
||||
@@ -647,6 +658,14 @@ async function run(ctx, argv) {
|
||||
})
|
||||
}
|
||||
|
||||
if (Events.Raw) {
|
||||
client.on(Events.Raw, function (packet) {
|
||||
if (!loggingIn) return
|
||||
const t = packet && packet.t
|
||||
if (t) ctx.console.log('discord-bot: dispatch ' + t)
|
||||
})
|
||||
}
|
||||
|
||||
let loggingIn = true
|
||||
let loginTimer = null
|
||||
let loginTick = null
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"schema": 2,
|
||||
"profileId": "bare-os-posix-like",
|
||||
"generatedAt": "2026-08-13T13:13:39.277Z",
|
||||
"generatedAt": "2026-08-13T13:37:56.952Z",
|
||||
"note": "Sparse POSIX Issue 7 coverage hints; commandIndex is generated each coreutils build.",
|
||||
"commandIndex": [
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"schema": 1,
|
||||
"atMs": 1786626819273,
|
||||
"atMs": 1786628276944,
|
||||
"commands": [
|
||||
"agent",
|
||||
"appctl",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -286,6 +286,14 @@ test('zlib-sync pack stub is not truthy (empty {} would hang login)', (t) => {
|
||||
/typeof zlib\.Inflate !== 'function'/.test(wsMgr),
|
||||
'discord.js ignores zlib-sync without Inflate'
|
||||
)
|
||||
const wsJs = fs.readFileSync(
|
||||
path.join(root, 'node_modules/@discordjs/ws/dist/index.js'),
|
||||
'utf8'
|
||||
)
|
||||
t.ok(
|
||||
/yielding before identify/.test(wsJs),
|
||||
'@discordjs/ws defers identify after HELLO'
|
||||
)
|
||||
})
|
||||
|
||||
test('default login does not request Message Content Intent', async (t) => {
|
||||
|
||||
+5
@@ -49,6 +49,11 @@
|
||||
"flags": "m",
|
||||
"replaceWith": "const connection = new WebSocketConstructor(url, [], {\\n handshakeTimeout: this.strategy.options.handshakeTimeout ?? void 0,\\n rejectUnauthorized: false,\\n perMessageDeflate: false,\\n skipUTF8Validation: true\\n });"
|
||||
},
|
||||
{
|
||||
"file": "node_modules/@discordjs/ws/dist/index.js",
|
||||
"findRegex": "const \\{ ok \\} = await this\\.waitForEvent\\(\"hello\" /\\* Hello \\*/ , this\\.strategy\\.options\\.helloTimeout\\);\\n if \\(!ok\\) \\{\\n return;\\n \\}\\n if \\(session",
|
||||
"replaceWith": "const { ok } = await this.waitForEvent(\"hello\" /* Hello */, this.strategy.options.helloTimeout);\\n if (!ok) {\\n return;\\n }\\n this.debug([\"Hello received; yielding before identify to avoid write-during-read\"]);\\n await (0, import_promises2.setTimeout)(25);\\n if (session"
|
||||
},
|
||||
{
|
||||
"file": "node_modules/discord.js/src/client/websocket/WebSocketManager.js",
|
||||
"findRegex": "try \\{\\n zlib = require\\(['\\\"]zlib-sync['\\\"]\\);\\n\\} catch \\{\\}",
|
||||
|
||||
@@ -260,7 +260,18 @@ async function run(ctx, argv) {
|
||||
intents.push(GatewayIntentBits.MessageContent)
|
||||
}
|
||||
|
||||
const client = new Client({ intents: intents })
|
||||
const osName =
|
||||
(typeof process !== 'undefined' && process.platform) || 'darwin'
|
||||
const client = new Client({
|
||||
intents: intents,
|
||||
ws: {
|
||||
identifyProperties: {
|
||||
os: osName,
|
||||
browser: 'bare-os',
|
||||
device: 'bare-os'
|
||||
}
|
||||
}
|
||||
})
|
||||
const pingCommand = new SlashCommandBuilder()
|
||||
.setName('ping')
|
||||
.setDescription('Replies with pong.')
|
||||
@@ -334,6 +345,14 @@ async function run(ctx, argv) {
|
||||
})
|
||||
}
|
||||
|
||||
if (Events.Raw) {
|
||||
client.on(Events.Raw, function (packet) {
|
||||
if (!loggingIn) return
|
||||
const t = packet && packet.t
|
||||
if (t) ctx.console.log('discord-bot: dispatch ' + t)
|
||||
})
|
||||
}
|
||||
|
||||
let loggingIn = true
|
||||
let loginTimer = null
|
||||
let loginTick = null
|
||||
|
||||
@@ -573,7 +573,18 @@ async function run(ctx, argv) {
|
||||
intents.push(GatewayIntentBits.MessageContent)
|
||||
}
|
||||
|
||||
const client = new Client({ intents: intents })
|
||||
const osName =
|
||||
(typeof process !== 'undefined' && process.platform) || 'darwin'
|
||||
const client = new Client({
|
||||
intents: intents,
|
||||
ws: {
|
||||
identifyProperties: {
|
||||
os: osName,
|
||||
browser: 'bare-os',
|
||||
device: 'bare-os'
|
||||
}
|
||||
}
|
||||
})
|
||||
const pingCommand = new SlashCommandBuilder()
|
||||
.setName('ping')
|
||||
.setDescription('Replies with pong.')
|
||||
@@ -647,6 +658,14 @@ async function run(ctx, argv) {
|
||||
})
|
||||
}
|
||||
|
||||
if (Events.Raw) {
|
||||
client.on(Events.Raw, function (packet) {
|
||||
if (!loggingIn) return
|
||||
const t = packet && packet.t
|
||||
if (t) ctx.console.log('discord-bot: dispatch ' + t)
|
||||
})
|
||||
}
|
||||
|
||||
let loggingIn = true
|
||||
let loginTimer = null
|
||||
let loginTick = null
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"schema": 2,
|
||||
"profileId": "bare-os-posix-like",
|
||||
"generatedAt": "2026-08-13T13:13:39.277Z",
|
||||
"generatedAt": "2026-08-13T13:37:56.952Z",
|
||||
"note": "Sparse POSIX Issue 7 coverage hints; commandIndex is generated each coreutils build.",
|
||||
"commandIndex": [
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"schema": 1,
|
||||
"atMs": 1786626819273,
|
||||
"atMs": 1786628276944,
|
||||
"commands": [
|
||||
"agent",
|
||||
"appctl",
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user