|
1 |
| -import { Awaited, Store } from '@sapphire/pieces'; |
| 1 | +import { Awaited, container } from '@sapphire/pieces'; |
2 | 2 | import { Client, ClientOptions, Message } from 'discord.js';
|
3 | 3 | import { join } from 'path';
|
4 | 4 | import type { Plugin } from './plugins/Plugin';
|
@@ -200,18 +200,18 @@ export class SapphireClient extends Client {
|
200 | 200 | public constructor(options: ClientOptions = {}) {
|
201 | 201 | super(options);
|
202 | 202 |
|
203 |
| - Store.injectedContext.client = this; |
| 203 | + container.client = this; |
204 | 204 |
|
205 | 205 | for (const plugin of SapphireClient.plugins.values(PluginHook.PreGenericsInitialization)) {
|
206 | 206 | plugin.hook.call(this, options);
|
207 | 207 | this.emit(Events.PluginLoaded, plugin.type, plugin.name);
|
208 | 208 | }
|
209 | 209 |
|
210 | 210 | this.logger = options.logger?.instance ?? new Logger(options.logger?.level ?? LogLevel.Info);
|
211 |
| - Store.injectedContext.logger = this.logger; |
| 211 | + container.logger = this.logger; |
212 | 212 |
|
213 | 213 | this.stores = new StoreRegistry();
|
214 |
| - Store.injectedContext.stores = this.stores; |
| 214 | + container.stores = this.stores; |
215 | 215 |
|
216 | 216 | this.fetchPrefix = options.fetchPrefix ?? (() => this.options.defaultPrefix ?? null);
|
217 | 217 |
|
@@ -290,7 +290,7 @@ declare module 'discord.js' {
|
290 | 290 | }
|
291 | 291 |
|
292 | 292 | declare module '@sapphire/pieces' {
|
293 |
| - interface PieceContextExtras { |
| 293 | + interface Container { |
294 | 294 | client: SapphireClient;
|
295 | 295 | logger: ILogger;
|
296 | 296 | stores: StoreRegistry;
|
|
0 commit comments