fix: normalize TOTPKey format and enhance debug messages in RequestHandler

This commit is contained in:
Elysia
2025-07-10 21:11:24 +07:00
parent 780dfe8078
commit 23c669bef9
2 changed files with 7 additions and 2 deletions

View File

@@ -874,6 +874,10 @@ class Client extends BaseClient {
) {
throw new TypeError('CLIENT_INVALID_OPTION', 'rejectOnRateLimit', 'an array or a function');
}
if (typeof options.TOTPKey === 'string') {
// Convert to base32 if not already
options.TOTPKey = options.TOTPKey.replace(/ +/g, '').toUpperCase();
}
// Hardcode
this.options.shardCount = 1;
this.options.shards = [0];