Same-token discord.js client replacement closes the previous gateway session
Gateway session ownership during a same-token client replacement A small single-shard application running discord.js v14 on Node.js 16.11.0 or newer needs to replace its gateway client with updated code while avoiding user-facing downtime. The goal is to stop the old client, start the new client with the same bot token, and preserve interaction handling with