public void Initialize() { if (this._initialized) { return; } this.UsersService = new DiscordClientUsersService(this._client); this.ChannelsService = new DiscordClientChannelsService(this._client, this.UsersService); this.RolesService = new DiscordClientRolesService(this._client, this.ChannelsService); this.ServersService = new DiscordClientServersService(this._client); this._initialized = true; Log.Information("DiscordClient initialized"); }
public void Initialize() { if (this._initialized) { return; } var serverContextFactory = this._context.Resolve <DiscordServerContextFactory>(); var userRoleFactory = this._context.Resolve <UserRoleFactory>(); var userContextFactory = this._context.Resolve <UserContextsFactory>(); var commandParser = this._context.Resolve <CommandParser>(); this.UsersService = new DiscordClientUsersService(this._client); this.ChannelsService = new DiscordClientChannelsService(this._client, this.UsersService, userContextFactory, commandParser); this.RolesService = new DiscordClientRolesService(this._client, userRoleFactory); this.ServersService = new DiscordClientServersService(this._client, serverContextFactory); this._initialized = true; Log.Information("DiscordClient initialized"); }