@koishijs/plugin-adapter-discord 2.0.7 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -1448,11 +1448,11 @@ DiscordBot.schema = AdapterConfig;
1448
1448
 
1449
1449
  // plugins/adapter/discord/src/ws.ts
1450
1450
  var import_koishi5 = __toModule(require("koishi"));
1451
- var import_ws = __toModule(require("ws"));
1452
1451
  var logger = new import_koishi5.Logger("discord");
1453
1452
  var WebSocketClient = class extends import_koishi5.Adapter.WebSocketClient {
1454
1453
  prepare(bot) {
1455
- return new import_ws.default(bot.config.gateway);
1454
+ const http = this.ctx.http.extend(bot.config);
1455
+ return http.ws(bot.config.gateway);
1456
1456
  }
1457
1457
  heartbeat(bot) {
1458
1458
  logger.debug(`heartbeat d ${bot._d}`);