Closed RainyXeon closed 2 years ago
Does it respond twice or hit the gateway/bot route?
@meister03 it respond twice when I run the code and I have this log
Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: {
body: PassThrough {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
[Symbol(kCapture)]: false,
[Symbol(kCallback)]: null
},
disturbed: false,
error: null
},
[Symbol(Response internals)]: {
url: 'https://discord.com/api/v10/gateway/bot',
status: 429,
statusText: 'Too Many Requests',
headers: Headers { [Symbol(map)]: [Object: null prototype] },
counter: 0
}
}
Could you add an event listener on the client client.on('debug', console.log)
@meister03 ok let me try
@meister03 It gives me these 2 logos and I don't know what to do with it
Provided token: OTc4NTMwNjc0MzU1MTAxNzc2.GDrWRU.**************************************
Preparing to connect to the gateway...
Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: {
body: PassThrough {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
[Symbol(kCapture)]: false,
[Symbol(kCallback)]: null
},
disturbed: false,
error: null
},
[Symbol(Response internals)]: {
url: 'https://discord.com/api/v10/gateway/bot',
status: 429,
statusText: 'Too Many Requests',
headers: Headers { [Symbol(map)]: [Object: null prototype] },
counter: 0
}
}
Hit a 429 while executing a request.
Global : false
Method : get
Path : /gateway/bot
Route : /gateway/bot
Limit : 2
Timeout : 2114ms
Sublimit: None
[7/26/2022, 5:42:16 PM] - [ERROR ] - [Rate Limited, Sleeping for 0 seconds]
[WS => Manager] Fetched Gateway Information
URL: wss://gateway.discord.gg
Recommended Shards: 1
[WS => Manager] Session Limit Information
Total: 1000
Remaining: 985
[WS => Manager] Spawning shards: 0
[WS => Shard 0] [CONNECT]
Gateway : wss://gateway.discord.gg/
Version : 9
Encoding : json
Compression: none
[WS => Shard 0] Setting a HELLO timeout for 20s.
[WS => Shard 0] [CONNECTED] Took 337ms
[WS => Shard 0] Clearing the HELLO timeout.
[WS => Shard 0] Setting a heartbeat interval for 41250ms.
[WS => Shard 0] [IDENTIFY] Shard 0/1 with intents: 641
[WS => Shard 0] [READY] Session 50e33a6acc573170d64c64f64df9ece8.
[WS => Shard 0] [ReadyHeartbeat] Sending a heartbeat.
[WS => Shard 0] Shard received all its guilds. Marking as fully ready.
Provided token: OTc4NTMwNjc0MzU1MTAxNzc2.GDrWRU.**************************************
Preparing to connect to the gateway...
[WS => Manager] Fetched Gateway Information
URL: wss://gateway.discord.gg
Recommended Shards: 1
[WS => Manager] Session Limit Information
Total: 1000
Remaining: 986
[WS => Manager] Spawning shards: 0
[WS => Shard 0] [CONNECT]
Gateway : wss://gateway.discord.gg/
Version : 9
Encoding : json
Compression: none
[WS => Shard 0] Setting a HELLO timeout for 20s.
[7/26/2022, 5:42:12 PM] - [INFO ] - [Launched Cluster 0]
[WS => Shard 0] [CONNECTED] Took 436ms
[WS => Shard 0] Clearing the HELLO timeout.
[WS => Shard 0] Setting a heartbeat interval for 41250ms.
[WS => Shard 0] [IDENTIFY] Shard 0/1 with intents: 641
[WS => Shard 0] [READY] Session d08d219a108d59e33b1e9434d5d44df0.
[WS => Shard 0] [ReadyHeartbeat] Sending a heartbeat.
[WS => Shard 0] Shard received all its guilds. Marking as fully ready.
Okay, could you log out Cluster.data. I have a guess...
@meister03 ok let me try
@meister03 but how?
const Cluster = require('discord-hybrid-sharding');
console.log(Cluster.data)
class MainClient extends Client {
@meister03 here is the Cluster.data log:
{
SHARD_LIST: [ 0 ],
TOTAL_SHARDS: 1,
CLUSTER_COUNT: 1,
CLUSTER: 0,
CLUSTER_MANAGER_MODE: 'process'
MAINTENANCE: 'undefined', CLUSTER_QUEUE_MODE: 'auto',
FIRST_SHARD_ID: 0,
LAST_SHARD_ID: 0
}
On Both Clusters?
@meister03 I dont know what you mean but may be is only this cluster.
I have an issue that when adding sharding system in my bot I always login to the bot 2 times and get rate limited, how to fix this? Here is my code file:
index.js:
login.js
bot.js