Remove Config injection from PlayerManager as we are getting the values from prisma.

This commit is contained in:
Hazzajenko 2024-11-01 17:42:09 +11:00
parent 27b1a25e56
commit ba3f1d60c3

View file

@ -2,25 +2,22 @@ import {inject, injectable} from 'inversify';
import {TYPES} from '../types.js';
import Player from '../services/player.js';
import FileCacheProvider from '../services/file-cache.js';
import Config from '../services/config.js';
@injectable()
export default class {
private readonly guildPlayers: Map<string, Player>;
private readonly fileCache: FileCacheProvider;
private readonly config: Config;
constructor(@inject(TYPES.FileCache) fileCache: FileCacheProvider, @inject(TYPES.Config) config: Config) {
constructor(@inject(TYPES.FileCache) fileCache: FileCacheProvider) {
this.guildPlayers = new Map();
this.fileCache = fileCache;
this.config = config;
}
get(guildId: string): Player {
let player = this.guildPlayers.get(guildId);
if (!player) {
player = new Player(this.fileCache, guildId, this.config);
player = new Player(this.fileCache, guildId);
this.guildPlayers.set(guildId, player);
}