diff --git a/src/core/commands/debug.ts b/src/core/commands/debug.ts index 466af61..b35f9d2 100644 --- a/src/core/commands/debug.ts +++ b/src/core/commands/debug.ts @@ -29,13 +29,11 @@ export default () => `> Device: ${info.device.model}`, ].join("\n"); - if (ephemeral?.value) { - messageUtil.sendBotMessage(ctx.channel.id, content); - } else { - const fixNonce = Date.now().toString(); - messageUtil.sendMessage(ctx.channel.id, { content }, void 0, { - nonce: fixNonce, - }); - } - }, - }; + if (ephemeral?.value) { + messageUtil.sendBotMessage(ctx.channel.id, content); + } else { + const fixNonce = (BigInt(Date.now() - 1420070400000) << 22n).toString(); + messageUtil.sendMessage(ctx.channel.id, { content }, void 0, {nonce:fixNonce}); + } + } +}; diff --git a/src/core/commands/plugins.ts b/src/core/commands/plugins.ts index b83f6a7..dccefd9 100644 --- a/src/core/commands/plugins.ts +++ b/src/core/commands/plugins.ts @@ -190,7 +190,7 @@ export default () => if (ephemeral?.value) { messageUtil.sendBotMessage(ctx.channel.id, content); } else { - const fixNonce = Date.now().toString(); + const fixNonce = (BigInt(Date.now() - 1420070400000) << 22n).toString(); messageUtil.sendMessage(ctx.channel.id, { content }, void 0, { nonce: fixNonce, }); diff --git a/src/core/plugins/messagefix/index.ts b/src/core/plugins/messagefix/index.ts index 15731a8..0b35216 100644 --- a/src/core/plugins/messagefix/index.ts +++ b/src/core/plugins/messagefix/index.ts @@ -33,7 +33,7 @@ export default defineCorePlugin({ ) { // Ensure options exists and has a nonce options = options || {}; - options.nonce = options.nonce || Date.now().toString(); + options.nonce = options.nonce || (BigInt(Date.now() - 1420070400000) << 22n).toString(); // Call original with fixed parameters return originalSendMessage.call(